Skip the translation step on rebuilds when nothing it reads has changed #378

Closed
smidley wants to merge 2 commits from lift-skip into main
smidley commented 2026-11-07 22:58:29 +00:00 (Migrated from github.com)

This skips the translation step on a rebuild when nothing the translator reads has changed, and reuses the last build's output instead. It's the other half of #21. make_game.py already skips the .nup read when the file hasn't changed, but it still runs lift.py and split_hot.py on every build.

On my PC (Core Ultra 5 245K, RTX 5070) the translation took 117 s of every rebuild. With this change, a rebuild with nothing changed finished in 9 seconds: it skipped the .nup read and the translation and recompiled nothing.

The key covers what the translation reads:

  • the game's exefs modules
  • lift.py, split_hot.py and every module in the tree they import (modulefinder on kit.py's path)
  • a64emit's C++ source
  • the imp_ and HLE() names in host/ that standalone.py hooks
  • the shipped hot list and chunk map, the A64_* settings, and the Python and capstone versions

make_game.py writes the key after lift and split_hot both finish, so it never reuses a translation that got cut short. If a translator file doesn't compile there's no key, and the lift runs like it does today.

I added tests/test_lift_key.py to the source regressions workflow, and tests/test_make_game_cache.py still passes. I tested it on Windows with a full build and then a rebuild with nothing changed, but haven't tried Linux yet.

🤖 Generated with Claude Code

This skips the translation step on a rebuild when nothing the translator reads has changed, and reuses the last build's output instead. It's the other half of #21. make_game.py already skips the .nup read when the file hasn't changed, but it still runs lift.py and split_hot.py on every build. On my PC (Core Ultra 5 245K, RTX 5070) the translation took 117 s of every rebuild. With this change, a rebuild with nothing changed finished in 9 seconds: it skipped the .nup read and the translation and recompiled nothing. The key covers what the translation reads: - the game's exefs modules - lift.py, split_hot.py and every module in the tree they import (modulefinder on kit.py's path) - a64emit's C++ source - the `imp_` and `HLE()` names in host/ that standalone.py hooks - the shipped hot list and chunk map, the `A64_*` settings, and the Python and capstone versions make_game.py writes the key after lift and split_hot both finish, so it never reuses a translation that got cut short. If a translator file doesn't compile there's no key, and the lift runs like it does today. I added tests/test_lift_key.py to the source regressions workflow, and tests/test_make_game_cache.py still passes. I tested it on Windows with a full build and then a rebuild with nothing changed, but haven't tried Linux yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NotRexed commented 2026-11-08 23:21:25 +00:00 (Migrated from github.com)

Thank you, and sorry this sat so long! main now skips the lift on a rebuild when nothing it reads has changed (6d1a807: nx2/make_game.py's .lift_key covers the game's modules, the translator, host/'s HLE names and the settings), which is the same idea as this PR, so I'm closing it as superseded. If you see a case main's key misses that yours covered, a small PR on top of it would be welcome.

Thank you, and sorry this sat so long! main now skips the lift on a rebuild when nothing it reads has changed (6d1a807: nx2/make_game.py's .lift_key covers the game's modules, the translator, host/'s HLE names and the settings), which is the same idea as this PR, so I'm closing it as superseded. If you see a case main's key misses that yours covered, a small PR on top of it would be welcome.
Commenting is not possible because the repository is archived.
No description provided.