From 215c423d84a95fce1f269ab1d59857303f2c2dc6 Mon Sep 17 00:00:00 2001 From: chrg6 Date: Sun, 8 Nov 2026 09:25:25 -0500 Subject: [PATCH] Write make_game.py's reset state at once when the game files changed. A new input reset the steps in memory only; the next save came after the first step finished, while the exefs step rewrites /exefs in place. A run stopped there left the old state.json saying the old game's steps were done, and --rebuild then trusted the half-replaced files. Co-Authored-By: Claude Opus 5.5 --- tools/make_game.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/make_game.py b/tools/make_game.py index cebc5202..277c369a 100644 --- a/tools/make_game.py +++ b/tools/make_game.py @@ -1103,7 +1103,8 @@ def main(): except ImportError: fail(f'the Python package {mod} is missing: pip install numpy lz4 zstandard zbic') cache.mkdir(parents=True, exist_ok=True) - if state.get('version') != STATE_VERSION or state.get('input') != src.identity: + reset = state.get('version') != STATE_VERSION or state.get('input') != src.identity + if reset: state = {'version': STATE_VERSION, 'input': src.identity, 'steps': {}} state['kit'] = kit_version() keep_awake() @@ -1122,6 +1123,11 @@ def main(): tmp.write_text(json.dumps(state, indent=1), encoding='utf-8') os.replace(tmp, state_path) + if reset: + # on disk at once: the exefs step rewrites /exefs in place, and a run cut short there would leave the + # old state.json saying the old game's steps are done, which --rebuild trusts + save() + def run(name): t = time.time() runs[name]()