From 20f5e4eb284963551b7c31c54a5e8175fca1b4e2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 8 Nov 2026 14:43:15 +0100 Subject: [PATCH] Package test knows openbmh.dat; week_check reports the distance of late day snapshots Co-Authored-By: Claude Sonnet 5.5 --- tests/package_tests.py | 2 +- tests/week_check.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/package_tests.py b/tests/package_tests.py index 7a23331..15ff6fe 100644 --- a/tests/package_tests.py +++ b/tests/package_tests.py @@ -23,7 +23,7 @@ class PackageAllowlistTests(unittest.TestCase): root = Path(directory) # Empty authored placeholders test names/structure, not executable behavior. for name in ['OpenBMH', 'openbmh_cli', 'README.md', 'LICENSE', - 'THIRD_PARTY_NOTICES.md', 'ACKNOWLEDGEMENTS.md', 'CONTRIBUTING.md']: + 'THIRD_PARTY_NOTICES.md', 'ACKNOWLEDGEMENTS.md', 'CONTRIBUTING.md', 'openbmh.dat']: (root / name).write_text('synthetic') notes = root / 'docs/release/1.0/RELEASE_NOTES.md' notes.parent.mkdir(parents=True) diff --git a/tests/week_check.cpp b/tests/week_check.cpp index 0e95e70..91870dc 100644 --- a/tests/week_check.cpp +++ b/tests/week_check.cpp @@ -1057,10 +1057,11 @@ const Entry* desk = &pause; // (after an offer message box the next pause) GameRandom gp = bg; WatcomRandom wp = br; bool g_ahead = false, w_ahead = false; + long g_steps = 0, w_steps = 0; // draws the snapshot lies ahead of our state (reported below) for (long k = 0; k < 20000 && !g_ahead; k++, gp.range(0, 1)) - g_ahead = gp.seed() == int32_t(std::stoll(field(e.line, "game_seed"))); + g_ahead = gp.seed() == int32_t(std::stoll(field(e.line, "game_seed"))), g_steps = k; for (long k = 0; k < 20000 && !w_ahead; k++, wp.rand()) - w_ahead = wp.seed() == uint32_t(std::stoull(field(e.line, "rand_seed"))); + w_ahead = wp.seed() == uint32_t(std::stoull(field(e.line, "rand_seed"))), w_steps = k; if (!w_ahead) { // (a Watcom seed on no path of the stream: the snapshot caught a temporary generator // state, as with minute snapshots - not counted) @@ -1085,7 +1086,8 @@ const Entry* desk = &pause; // (after an offer message box the next pause) } } if (!g_ahead || !w_ahead) return false; - std::printf(" (late snapshot: taken inside the processing of day %u, not counted)\n", b.date); + std::printf(" (late snapshot: taken inside the processing of day %u, %ld game and %ld Watcom draws ahead of the " + "port's state, both on the port's streams; not counted)\n", b.date, g_steps, w_steps); return true; };