Skip to content

Compare the guards by steps taken, not wall time - #307

Merged
sbryngelson merged 1 commit into
masterfrom
ci/guard-tests-count-steps
Oct 28, 2026
Merged

sbryngelson merged 1 commit into
masterfrom
ci/guard-tests-count-steps

Conversation

@sbryngelson

Copy link
Copy Markdown
Owner

The sonic-guard test failed on today's scheduled run (3.12 job, run 40683776219): assert 5.755954749000011 < 5.203594478999989. Nothing changed on master since the passing run on 10-27.

The test timed each simulate call end to end. Each config compiles its own program (the guard keys the compile cache), and the solves themselves take about 0.3 s either way (SolverStats.elapsed_s), so the assertion compared two JIT compiles on a shared runner.

This compares SolverStats.nfev (diffrax num_steps) from the raised SimulationError instead. Locally:

  • sonic guard: 30000 steps unguarded -> 307 guarded
  • collapse floor: 200000 steps unguarded -> 144 guarded

The collapse-floor test had the same wall-clock check. Its 200k-step grind kept the margin wide enough that it had not failed, but it gets the same change.

pytest -m 'slow or not slow' tests/test_validation_refusals.py: 60 passed. ruff check . and tools/pyright_baseline.py are clean.

The sonic-guard test failed on the 2026-10-28 scheduled run (3.12): 5.76 s guarded
against 5.20 s unguarded. Each config compiles its own program, and the solves themselves
take about 0.3 s either way, so the timing was a comparison of two JIT compiles. Steps
are deterministic and show the guard's effect directly: 307 against the 30,000 budget for
the sonic guard, 144 against 200,000 for the collapse floor, which had the same check.
@sbryngelson
sbryngelson merged commit c6cd5c3 into master Oct 28, 2026
3 checks passed
@sbryngelson
sbryngelson deleted the ci/guard-tests-count-steps branch October 28, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant