WIP: feat(build): the lift key hashes only the environment that changes the lifted C #22
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!22
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/lift-key-env"
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?
Why
A switch left set in the shell made the next build translate the whole game again (about 5 minutes on Windows), even an
RX_VK_*renderer switch orRX_RELEASE, which the lift never reads; so did the same game in another work or game folder, since the folders' paths were in the lift key.What changed
lift_keyinnx2/make_game.pyhashes only the variableslift_reads_env()names, in place of everyA64_,OOT_andRX_variable:LIFT_ENV_PREFIXES(A64_*andSUYU_RECOMP_*, the emitter's own switches, which weren't in the key at all before) andLIFT_ENV_NAMES(RX_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; the compile's own variables (COMPILE_ONLY_ENV); andLIFT_ENV_NOT_OUTPUT, the variables the lift's sources read that change nothing it writes (how many processes, where the compiler is), each with why.check_lift_env()intests/test_lift_cache.py: the same game and inputs in other folders give the same key;RX_RELEASE, anRX_VK_switch andRX_MARCHleave it unchanged, whileSUYU_RECOMP_STRICT,RX_TARGETand anA64_switch change it; every variable the lift's sources read is in the key, a path, or inLIFT_ENV_NOT_OUTPUTwith a reason, so a new one can't slip through.Flags and settings
No new switch. The names below are ones the diff writes in quotes: the existing variables the lift key now leaves out or keeps, and the ones the test sets.
LONGSHOT_LIFT_JOBSLIFT_ENV_NOT_OUTPUT(it was not in the key before either)LONGSHOT_LIFT_NO_FORKLIFT_ENV_NOT_OUTPUT(not in the key before either)LONGSHOT_MINGWLIFT_ENV_NOT_OUTPUT(not in the key before either)RX_JOBSLIFT_ENV_NOT_OUTPUT)RX_VK_NAN_GUARDLIFT_ENV_NOT_OUTPUT)nx2/bake_ds's own runRX_VK_NO_DRAW_PARAMSLIFT_ENV_NOT_OUTPUT)nx2/bake_ds's own runRX_VK_NO_F16LIFT_ENV_NOT_OUTPUT)nx2/bake_ds's own runRX_VK_SHARED_48KLIFT_ENV_NOT_OUTPUT)nx2/bake_ds's own runRX_TARGETLIFT_ENV_NAMES); also set in the testRX_MARCHRX_RELEASERX_VK_NO_PROGRAM_CACHERX_VK_switch leaves the key unchangedMeasurements
Measured on the GitHub version (NotRexed/Hookshot#2874), not yet on Longshot: this PR stays WIP until it is.
Hardware: RTX 3080 (NVIDIA 621.14), Ryzen 9 3900X, 64 GB, Windows 11
Method: after the first lift with the new key, a build with
RX_VK_NO_PROGRAM_CACHE=1in the shell.RX_VK_NO_PROGRAM_CACHE=1in the shellIn the game: every build run in the game that day carried this
make_game.py. The latest, headless through the control bridge from a save, 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.Checks: every check that reads the changed files (54), through
run_all.py, rebased on that day's GitHubmain, on Windows: 53 pass;test_linux_updatefails the same way onmainthere.Testing
Tested: the runs under Measurements (on the GitHub version) and the game-free checks this description names. Checked but not measured: the in-game run above (no
mainrun beside it; the lifted C is the same).Not tested: Linux. Nothing here is platform-specific.
Needs other testers:
A64_,OOT_orRX_one changes the C) skips the lift, expecting "lift: skipped" in the build's lines (request to open)Screenshots
Nothing on screen.
Risk and rollback
A variable the lift does read but the key now leaves out would let a build reuse a translation made without it;
check_lift_env()fails when the lift's sources read a variable that is neither in the key, a path, nor inLIFT_ENV_NOT_OUTPUT. The first build after this translates the game once (the key's form changes). Reverting the commit is enough (one more translation after it).Reviewer notes
Carried over from NotRexed/Hookshot#2874 with the move to Longshot: the same change on Longshot's
main, with its rename applied. Its review and discussion are there.This is the dev-loop proposal's A2 (NotRexed/Hookshot#2636), with hckrman101's review point that the paths kept two checkouts of one tree from sharing a lift.
The checks and the in-game runs above were done on the GitHub version; this branch is the same change with the rename applied (the same files and line counts). Forgejo runs no checks, and they were not run again here. Only the checks that read the changed files were run, not the whole
run_all.py.#28 is stacked on this one.
Issues
See NotRexed/Hookshot#2636 (A2).
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.docs/tested-configurations.mdfor each measured run.MKWVK_API_VERSIONbumped (gpu/vk/vk_api.h'sMkwVkHostorMkwVkRendererchanged).mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
feat(build): the lift key hashes only the environment that changes the lifted Cto WIP: feat(build): the lift key hashes only the environment that changes the lifted CBack to WIP under #48's process: this was carried over before the new template. Its description will be brought to the template and measured on Longshot (main against this PR, at named commits) when it's wanted for review; ask here if you'd like it sooner.
Description brought to Longshot's PR template (#48). Still WIP: its numbers are from the GitHub version, and it isn't rebased on current main; it gets measured on Longshot (main against this PR, at named commits) before it is marked ready.
Description moved to the template's Testing section and whole checklist (#72): what was tested, what wasn't, and what needs other testers (their test requests to open while this is WIP).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.