build: document a faster development build and keep the lift when switching it #2518
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2518
Loading…
Reference in a new issue
No description provided.
Delete branch "build/fast-dev-build"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A development build that only checks whether something works (the game starts, a menu, a screenshot, a log) still waits for the eight hot pieces, which are compiled at
-O2with the play profile and take about a third of the game's compile time. Their level can already be lowered withRX_HOT_OPT=O1, but that is not written down anywhere, and throughmake_game.pyit also makes the next build translate the whole game again.What changed
docs/development.md, Building: anRX_HOT_OPTrow in the switches table and a short section, A faster build for development: what to set (RX_HOT_OPT=O1withnx2/build.py, which then uses no profile; throughmake_game.pythe shipped profile is still passed), when switching keeps the lift and the objects (the checkout's ownwork/orHOOKSHOT_KEEP_BUILD_FILES=1; elsewheremake_game.py's clean-up keeps only the last build's, so a switch lifts again and recompiles the hot pieces), what it saves, and a clear warning that it is never for fps, frame times, build timings, hitch checks, profiles, or a release or player build.CONTRIBUTING.md, Building: a one-line pointer to that section.nx2/make_game.py:lift_keyleavesRX_HOT_OPTandRX_PGOout (COMPILE_ONLY_ENV). Onlynx2/build.pyreads them, after the lift, so they never change the lifted C. Before this, settingRX_HOT_OPTfor one build, or unsetting it again, changed the key and translated the game again (minutes). Any otherA64_/OOT_/RX_variable still changes the key.tests/test_lift_cache.py: both variables, given tolift_keyor in the environment, leave the key as it was; and no file ofmake_game.lift_sources()(the translator's files, which the key hashes) names them, so a translator change that starts reading one fails the check instead of reusing a stale lift.The objects need no change: their keys include the flags, so
-O1and-O2hot objects are cached side by side.make_game.pyis not one oflift_sources(), so this edit costs no new lift. The directbuild.py --standaloneexample runs withoutmake_game.py's environment (RX_RELEASE,A64_HOT_CHUNK), so its runtime objects differ from amake_game.pybuild's; the docs say so.Measured
These numbers come from existing builds, not from a new
-O1build: the per-file compile times in thebuild_times.jsonof six earlier full builds on one Linux desktop (Ryzen 9 7900X, 24 threads, 30 GB, other work running), plus peak memory measured during earlier build work.-O2, profile)-O1)code_021_1.c)The hot pieces are 81 MB of the 1.4 GB of lifted C. At the other files' rate they would take about 200 s instead of about 1,500 s, so the game's compile needs about a quarter less time in total, and the longest single file becomes an ordinary one, so a build after a new lift can finish several minutes sooner on a CPU with many threads. Peak memory barely moves, because the ordinary files already set it. The docs give these as estimates and say where they come from.
The game still plays with the hot pieces at
-O1: the profile-counting build (RX_PGO=gen) already compiles them at-O1and is played through to record the profile. Its frame rate was not measured for this PR, and the docs ask readers to check that it is fast enough for their test.Tested
python -I -B tests/test_lift_cache.pypasses after mergingmain(with #2324'scheck_lift_sources), and fails without themake_game.pychange.python -I -B tests/run_all.pyon Linux, before mergingmain: 411 passed, 12 skipped (four checks that write to/tmpwere run again with a writable/tmp, and pass).github-sync referenced this pull request2026-11-12 06:22:54 +00:00