Repository navigation
feat(build): the lift key hashes only the environment that changes the lifted C - #2874
Open
jordanella wants to merge 1 commit into
Open
jordanella wants to merge 1 commit into
jordanella wants to merge 1 commit into
Conversation
…e lifted C The key took every A64_, OOT_ and RX_ variable, so an RX_VK_ switch left set in the shell, or RX_RELEASE, which the lift does not read, translated the game again (~5 minutes on Windows), and so did the same game in another work or game folder: OOT_WORK, OOT_EXEFS, OOT_ROMFS, OOT_DUMP and A64_HOT_FUNCS are paths, and what the lift reads through them is hashed by its contents already. The emitter's own SUYU_RECOMP_ switches were not in the key at all. This is the dev-loop proposal's A2 (NotRexed#2636), with hckrman101's point that the paths keep two checkouts of one tree from sharing a lift. lift_key now hashes the variables lift_reads_env() names: A64_ and SUYU_RECOMP_, and RX_TARGET, but not the paths (LIFT_PATH_ENV) nor the compile's own (COMPILE_ONLY_ENV). tests/test_lift_cache.py checks that the same game and inputs in other folders give the same key, that RX_RELEASE, an RX_VK_ switch and RX_MARCH leave it and SUYU_RECOMP_STRICT, RX_TARGET and an A64_ switch change it, and that every variable the lift's sources read is in the key, a path, or in LIFT_ENV_NOT_OUTPUT with why it changes nothing. The key's form changes, so the first build after this translates once. Measured on Windows: after that first lift, a build with RX_VK_NO_PROGRAM_CACHE=1 in the shell skipped the lift (15 s). Co-Authored-By: Claude Opus 5.5 (1M context) <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 switch left set in the shell made the next build translate the whole game again (about 5 minutes on Windows): the lift key took every
A64_,OOT_andRX_variable, includingRX_VK_*renderer switches andRX_RELEASE, which the lift never reads. The same game in another work or game folder did too, since the folders' paths (OOT_WORK,OOT_EXEFS, ...) were in the key. This is the dev-loop proposal's A2 (#2636), with hckrman101's review point that the paths kept two checkouts of one tree from sharing a lift.Change
nx2/make_game.py,lift_key: it hashes only the variableslift_reads_env()names:A64_*andSUYU_RECOMP_*(the emitter's own switches, which weren't in the key at all before), andRX_TARGET.LIFT_PATH_ENV:OOT_WORK,OOT_EXEFS,OOT_ROMFS,OOT_DUMP,A64_HOT_FUNCS), since what the lift reads through them is hashed by its contents already;COMPILE_ONLY_ENV);LIFT_ENV_NOT_OUTPUT: variables the lift's sources read that change nothing it writes (how many processes, where the compiler is), each with why.The key's form changes, so the first build after this translates once.
Measured
Windows 11, Ryzen 9 3900X: after that first lift, a build with
RX_VK_NO_PROGRAM_CACHE=1in the shell skipped the lift (15 s), wheremaintranslated again.In the game
Every build I ran in the game today carried this
make_game.py. The latest: Windows 11, RTX 3080 (NVIDIA 621.14), from a save, headless through the control bridge: in play in Kokiri Forest, 28-31 fps, nothing in the log about a lost device or a crash. The change decides only whether the lift runs; the C it writes is the same.Testing
tests/test_lift_cache.py, new cases:RX_RELEASE, anRX_VK_switch andRX_MARCHleave it unchanged, whileSUYU_RECOMP_STRICT,RX_TARGETand anA64_switch change it;LIFT_ENV_NOT_OUTPUTwith a reason, so a new one can't slip through.run_all.py, rebased on today'smain, on Windows: 53 pass;test_linux_updatefails the same way onmainhere.See #2636 (A2).
🤖 Generated with Claude Code