From 34b30c434fc311cc42506649ce259af5fcbde23f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Oct 2026 18:33:48 +0000 Subject: [PATCH] test: restore into the same body scene; V3 mock asserts current=False The checkpoint loader requires matching body count and geometry, so the round-trip test rebuilds the three-circle scene before loading instead of an empty simulation (loader unchanged). run_case.main now calls verify_source(..., current=False); the two dry-run/run mock assertions follow. Co-Authored-By: Claude Opus 5.5 --- tests/integration/test_checkpoint_bodies_gpu.py | 6 +++--- tests/validation/taylor_green/test_projected_pairs.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/test_checkpoint_bodies_gpu.py b/tests/integration/test_checkpoint_bodies_gpu.py index 103ec48..9d67e24 100644 --- a/tests/integration/test_checkpoint_bodies_gpu.py +++ b/tests/integration/test_checkpoint_bodies_gpu.py @@ -1,6 +1,6 @@ """Checkpoint save -> load round trip for a scene with passive bodies. Requires GPU. -A fresh Simulation restored from the checkpoint must hold the same populations, +A fresh Simulation with the same scene, restored from the checkpoint must hold the same populations, flags, body count and step count, and must stay bitwise identical to the original after both continue for the same number of steps. Checkpoints with Jets are refused (documented limitation) and are not covered here. @@ -36,8 +36,8 @@ class CheckpointBodiesGPU(unittest.TestCase): restored = None try: saved = sim.save_checkpoint(path) - restored = make_sim() - restored.initialize() + # The loader requires the same body count and geometry: rebuild the scene. + restored = scene() restored.load_checkpoint(saved) self.assertEqual(restored.bodies.count, len(CIRCLES)) diff --git a/tests/validation/taylor_green/test_projected_pairs.py b/tests/validation/taylor_green/test_projected_pairs.py index d1acbe9..d944133 100644 --- a/tests/validation/taylor_green/test_projected_pairs.py +++ b/tests/validation/taylor_green/test_projected_pairs.py @@ -361,7 +361,7 @@ class ProjectedPairsTests(unittest.TestCase): patch.object(run_case, "runtime_identity", side_effect=AssertionError("CUDA reached")), \ redirect_stdout(stdout): self.assertEqual(run_case.main(), 0) - verify.assert_called_once_with(REPO, MOCK_REVISION) + verify.assert_called_once_with(REPO, MOCK_REVISION, current=False) self.assertTrue(json.loads(stdout.getvalue())["dry_run"]) self.assertFalse(output.exists()) @@ -454,7 +454,7 @@ class ProjectedPairsTests(unittest.TestCase): else: self.assertEqual(run_case.main(), 0) receipt = json.loads(output.read_text()) - verify.assert_called_once_with(REPO, MOCK_REVISION) + verify.assert_called_once_with(REPO, MOCK_REVISION, current=False) self.assertEqual(selectors, ["projected_linear" if early else "constant"] if depth == 2 else []) self.assertEqual(receipt["source"], source()) self.assertEqual(receipt["runtime_identity"], RUNTIME)