Stand-ins: check once per unpack, on --update too, skippable frames (follow-up to #1308) #1373
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!1373
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/stand-ins-once-per-unpack"
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?
Follow-up to #1308. The commit for its review nits landed on the branch after #1308 was merged, so it is here on its own:
.hookshot_romfs_checkedstores the.hookshot_romfsstamp the check ran under, so a rebuild over the same.nupno longer walks the ~102k romfs files again (about 34 s with a cold cache). A fresh unpack deletes the note first, and the note goes throughcheck_cache_pathslike the other generated paths.--update: the check runs there too, but only on a romfs the builder unpacked itself (the.hookshot_romfsstamp must exist)..zsfile that starts with a zstd skippable frame (0x184D2A50to0x184D2A5F) now counts as whole (nup.zstd_start).test_make_game_cache(test_same_source_reuses_the_cacheandtest_update_replaces_clearable_scratch_exefs): a reused unpack may add only that note, holding the same stamp.Tested:
nx2/test_nup_stand_in.py(new cases for skippable frames and for checking once per stamp) and the fulltests/run_all.pyon Linux: 186 passed, 19 skipped for missing tools.🤖 Generated with Claude Code
This landed in the v2.0.12 branch (merged there for testing; it reaches
mainwith that release), so closing. Thanks!Reopened: closing this was a mistake on my side. It was tested in the v2.0.12 branch, and it will be merged into main here, so it shows as merged. Sorry for the noise.
Looks good. I read it against main and the description matches the code.
.hookshot_romfsstamp, and a fresh unpack removes it before extracting, so a new .nup is always checked again. The note goes throughcheck_cache_pathslike the other generated paths. A crash mid-check leaves no note, so it just runs again.--update: the call sits aftercheck_modules, and the stamp guard means a romfs the builder didn't unpack is left alone.outandromfsare both in scope there.zstd_startis right (low byte 0x50-0x5F, then2a 4d 18), and it is used in bothdamaged_game_filesandstand_in_for, so a skippable-first file is neither flagged nor offered as a stand-in source wrongly.nx2/test_*.py/tests/test_*.pyglob in run_all.py, so nothing to register. Thetest_make_game_cachechanges pin the note to the stamp, which is what you want.Nits, no need to act:
test_nup_stand_in.pyswapssys.modules["nup"]for a stub and never restores it, which is fine now as it is the last thing in the file but would bite if someone adds a real-nup case below it. CI: everything has passed except the Windows jobs (Vulkan back end, Python source checks windows-2022), which were still pending when I looked.