Repository navigation
build: document a faster development build and keep the lift when switching it - #2518
Merged
Merged
Conversation
…tching it RX_HOT_OPT=O1 compiles the eight hot pieces like every other lifted file (no -O2, and no play profile when build.py runs on its own). They are about a third of the game's compile time and its longest single files. docs/development.md now describes it, with numbers from earlier builds' build_times.json and a warning never to use it for fps, timings, hitch checks or a release; CONTRIBUTING.md points to it. make_game.py's lift key no longer includes RX_HOT_OPT and RX_PGO: only nx2/build.py reads them, after the lift, so switching them translated the game again for nothing. tests/test_lift_cache.py checks that they leave the key as it was and that nothing the key covers reads them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_lift_cache.py: main's side (check_lift_sources), with the compile-only checks added; they now scan make_game.lift_sources(), the files the lift key hashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e objects Outside the checkout's own work/ folder (and without HOOKSHOT_KEEP_BUILD_FILES=1), make_game.py's clean-up keeps only the last build's objects and a translation that fits them, so each switch translates the game again and recompiles the hot pieces. Also note that build.py run on its own lacks make_game.py's environment (RX_RELEASE, A64_HOT_CHUNK). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 perf(build): updates skip the lift, a faster lift, and hot pieces that compile sooner and stay put #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).