You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/test_demo1_backend_parity.py — rename to tests/test_backend_parity.py, parameterize on scenario
scripts/cross_backend_regression.py — driver that runs N backends; already pluggable via --binary NAME=PATH
src/metal_diff/dump_metal_trajectory.py — Metal trajectory dumper writing OpenCL-compatible format
Approach: Refactor — promote the existing demo1-specific harness into a scenario registry. Per-demo configs (THRESHOLDS, parsers, baselines) live in tests/parity_scenarios/{demo1,demo2,worm_alone,worm_swim}.py. Add --scenario and --substrate CLI flags. Keep the L2 engine and threshold logic that already exists.
Files to Modify:
tests/test_backend_parity.py (rename from test_demo1_backend_parity.py)
tests/parity_scenarios/{demo1,demo2,worm_alone,worm_swim}.py (new — per-demo configs)
tests/baseline/*_opencl.json (new — committed reference metrics)
Acceptance Criteria:
Runs --scenario demo1 --substrate metal-native and reproduces the existing demo1 parity check
Sponsor Summary Hint: The parity engine exists. This issue generalizes the existing demo1-specific harness so demo2/worm_alone/worm_swim each get a parity gate, without rewriting the L2/sampling/threshold core.
tests/test_demo1_backend_parity.py(256 lines) is already a fully-functional parity harness — parses position buffers with.times.txtsidecar handling, computes per-particle L2 + cube-center/extent drifts + init/mean/final L2, has explicitTHRESHOLDSdict and 5 pass/fail gates, JSON + human-readable output. The proposed new filescripts/backend_parity_test.pywould duplicate ~80% of this. Milestone: Logically validation infrastructure, but co-ships with v0.0.9 (Phase 0 Modernization) because the per-demo parity issues [DD001] Run the demo1 (cube drop) parity test automatically in CI on every PR #234/[DD001] Add a parity check for demo2 (membrane permeability) — depends on #236 #235/[DD001] Add a parity check for worm_alone (passive worm body) — depends on #236 #236/[DD001] Turn on muscle drive in the worm_swim test and add a parity check (depends on #236, #241) #239 all depend on the generalized harness — splitting these across milestones would force v0.0.9 to ship without working CI gates.tests/test_demo1_backend_parity.py— rename totests/test_backend_parity.py, parameterize on scenarioscripts/cross_backend_regression.py— driver that runs N backends; already pluggable via--binary NAME=PATHsrc/metal_diff/dump_metal_trajectory.py— Metal trajectory dumper writing OpenCL-compatible formattests/parity_scenarios/{demo1,demo2,worm_alone,worm_swim}.py. Add--scenarioand--substrateCLI flags. Keep the L2 engine and threshold logic that already exists.tests/test_backend_parity.py(rename from test_demo1_backend_parity.py)tests/parity_scenarios/{demo1,demo2,worm_alone,worm_swim}.py(new — per-demo configs)tests/baseline/*_opencl.json(new — committed reference metrics)--scenario demo1 --substrate metal-nativeand reproduces the existing demo1 parity check--substrate cuda-nativereturns "not implemented yet" error messagecross_backend_regression.pycontinues to workThis issue is part of milestone v0.0.9 — Phase 0 Modernization, derived from DD001 Body Physics Engine Architecture. Related issues in this milestone are filed in the same batch.