test: measurement-only refined DFG MRT timing harness

Wall-time A/B/C/E/E' variants over equal simulated duration, reusing
run_refined_dfg setup functions. Fresh state and identical warm-up per
repeat, 3 interleaved repeats, construction/JIT, warm-up and bitwise
population/NaN-mask parity checks outside timed regions. B, C and E' are
labelled timing-only (no valid force history). No numerical or
production change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-10-18 12:25:43 +00:00
co-authored by Claude Opus 5.5
parent 4d4b9ba00a
commit 15fb58e36f
3 changed files with 298 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# Refined DFG MRT timing harness (measurement only)
`tests/validation/time_refined_dfg.py` times the matched MRT refined/uniform DFG Re100 setup of
`run_refined_dfg.py` (same configuration, geometry and initial state functions). No numerical,
physics-gate or production change; no force or accuracy result is produced.
| Variant | Loop | Force history |
|---|---|---|
| A | refined `step(1)` + `read_raw_exchange` per base step (as the runner) | valid |
| B | refined `step(1)` only | timing-only |
| C | refined single `step(N)` | timing-only |
| E | uniform `sim.run(<=100)` + `read_force` (as the runner) | valid |
| E' | uniform single `sim.run(2N)` | timing-only |
- Equal simulated duration: N refined base steps vs 2N uniform D80 steps.
- Every repeat starts from the same fresh state (refined `initialize`, uniform `snapshot/restore`)
and the same warm-up; construction/JIT, warm-up, downloads and parity checks are untimed.
- `step()` synchronizes after each base interval and `Simulation.run()` before returning, so the
wall timer (`time.perf_counter`) brackets completed GPU work. No CUDA events are used.
- Final populations and NaN masks must be bitwise identical to the first A (refined) or E
(uniform) repeat; any difference aborts.
- Cases run sequentially (uniform, then refined) in one process with startup serialized;
variants are interleaved within each repeat. A-B and B-C are measured comparative
differences under GPU variability, not exact causal decompositions.
Usage (root selects one verified idle GPU):
PYTHONPATH=src python -m unittest tests/unit/test_time_refined_dfg.py
python tests/validation/time_refined_dfg.py --output <new> --plan
CUDA_VISIBLE_DEVICES=<gpu> python tests/validation/time_refined_dfg.py --output <new>
Defaults: 2000 base steps, 200 warm-up base steps, 3 repeats. Profiler capture and the
`observe_raw_exchange=False` variant are deferred until these measurements exist.