From 36ad523662fc5948cba31a261c7eaeed9e432632 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 22:19:09 +0000 Subject: [PATCH] validation: tip tooling no longer reads renamed source paths Fixes the regressions from the entry/compiler renames (2b3c2a7, d318911) that Astra reproduced at d318911: - run_refined_dfg.verify_source: a manifest file missing from the checkout is a 'Source mismatch' (was FileNotFoundError); the current-checkout (Jet scenario) capture hashes the manifest's harness files plus the checkout's own 'git ls-files src', not historical src paths. - time_window_dfg: candidate file list names kernels/blocked.cu. - test_projected_pairs: the a135252-only harness's runtime_source is the historical receipt value (historical_runtime_source) in the receipt fixture and the two mocked run_case.main tests; runtime_source itself stays tested against the a135252 package (historical_package). Harness files, pins, manifests and thresholds are unchanged. Co-Authored-By: Claude Opus 5.5 --- tests/validation/run_refined_dfg.py | 6 ++++-- tests/validation/taylor_green/test_projected_pairs.py | 11 ++++++++++- tests/validation/time_window_dfg.py | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/validation/run_refined_dfg.py b/tests/validation/run_refined_dfg.py index 0123e9e..b375906 100644 --- a/tests/validation/run_refined_dfg.py +++ b/tests/validation/run_refined_dfg.py @@ -298,7 +298,8 @@ def verify_source(source, collision="SRT", observation_mode="last_base_step", je sys.path.insert(0, str(HERE)) from source_provenance import checkout_provenance - paths = set(expected["sha256"]) + # Harness files from the manifest; production files as this checkout lists them. + paths = {name for name in expected["sha256"] if not name.startswith("src/")} if observe_cv: paths.add("tests/validation/run_jet_circle_cv.py") paths.update(subprocess.check_output( @@ -310,7 +311,8 @@ def verify_source(source, collision="SRT", observation_mode="last_base_step", je for name in sorted(paths)}, ) for name, digest in expected["sha256"].items(): - if hashlib.sha256((source / name).read_bytes()).hexdigest() != digest: + path = source / name + if not path.is_file() or hashlib.sha256(path.read_bytes()).hexdigest() != digest: raise RuntimeError("Source mismatch: " + name) return expected diff --git a/tests/validation/taylor_green/test_projected_pairs.py b/tests/validation/taylor_green/test_projected_pairs.py index 64a701d..c2c6138 100644 --- a/tests/validation/taylor_green/test_projected_pairs.py +++ b/tests/validation/taylor_green/test_projected_pairs.py @@ -55,6 +55,13 @@ def historical_package(): sys.modules.update(saved) +def historical_runtime_source(repo): + """runtime_source as run_case records it for an accepted a135252 checkout.""" + package = repo / "src/CelerisLab" + return dict(checkout=str(repo), module=str(package / "__init__.py"), + compiler=str(package / "cuda/compiler_v2.py"), kernel_root=str(package / "lbm/kernels")) + + RUNTIME = dict(device=dict(name="host mock", pci_bus_id="mock", capability=[7, 0], driver=12040, runtime=[12, 4, 0]), nvcc_path="/mock/nvcc", nvcc_version="mock nvcc", python="mock Python", numpy=np.__version__, pycuda="mock") @@ -91,7 +98,7 @@ def records(early=False): reference_harness=run_case.REFERENCE_HARNESS, actual_build_sidecars=[build_metadata(n * 2**level) for level in range(depth)], runtime_identity=deepcopy(RUNTIME), cuda_visible_devices="0", - runtime_source=run_case.runtime_source(REPO), completed=True, + runtime_source=historical_runtime_source(REPO), completed=True, workload=run_case.workload([k == ACTIVE for k in h.kinds], 16*n), rows=[dict(step=s, tstar=s*U/n, **{k: 0.0 for k in LIMITS}) for s in main_steps], early_pressure=dict(enabled=early, rows=[ @@ -373,6 +380,7 @@ class ProjectedPairsTests(unittest.TestCase): with patch.object(sys, "argv", pinned + ["--dry-run"]), \ patch.dict(sys.modules, cuda_modules), patch.dict("os.environ", CUDA_VISIBLE_DEVICES=""), \ patch.object(run_case, "verify_source", return_value=source()) as verify, \ + patch.object(run_case, "runtime_source", return_value=historical_runtime_source(REPO)), \ patch.object(run_case, "runtime_identity", side_effect=AssertionError("CUDA reached")), \ redirect_stdout(stdout): self.assertEqual(run_case.main(), 0) @@ -462,6 +470,7 @@ class ProjectedPairsTests(unittest.TestCase): with patch.dict(sys.modules, modules), patch.object(sys, "argv", argv), \ patch.dict("os.environ", CUDA_VISIBLE_DEVICES="mock"), \ patch.object(run_case, "verify_source", return_value=source()) as verify, \ + patch.object(run_case, "runtime_source", return_value=historical_runtime_source(REPO)), \ patch.object(run_case, "runtime_identity", return_value=deepcopy(RUNTIME)), \ patch.object(run_case, "build_capture", return_value=nullcontext()), \ patch.object(run_case, "metrics", side_effect=metric), redirect_stdout(io.StringIO()): diff --git a/tests/validation/time_window_dfg.py b/tests/validation/time_window_dfg.py index 063b27d..54404d1 100644 --- a/tests/validation/time_window_dfg.py +++ b/tests/validation/time_window_dfg.py @@ -38,7 +38,7 @@ VARIANTS = ("A", "W", "W1") # links). Engineering tolerance: 1e-9 of the interval's summed absolute per-step totals. INTERVAL_RTOL = 1e-9 CANDIDATE_FILES = ("src/CelerisLab/lbm/refinement_stepper.py", "src/CelerisLab/lbm/raw_exchange.py", - "src/CelerisLab/lbm/refinement_tables.py", "src/CelerisLab/lbm/kernels/blocks.cu") + "src/CelerisLab/lbm/refinement_tables.py", "src/CelerisLab/lbm/kernels/blocked.cu") def components(obs):