Skip to content

Seed all pecos-neo test simulators and enforce determinism with a source scan - #455

Merged
ciaranra merged 1 commit into
devfrom
neo-deterministic-tests
Aug 8, 2026
Merged

Seed all pecos-neo test simulators and enforce determinism with a source scan#455
ciaranra merged 1 commit into
devfrom
neo-deterministic-tests

Conversation

@ciaranra

@ciaranra ciaranra commented Aug 7, 2026

Copy link
Copy Markdown
Member

Follow-up to #454, implementing the prevention decided after the test_multiple_shots flake: pecos-neo test code is now deterministic by construction, and a scan enforces it.

  • 230 simulator constructions in test code migrated to seeded constructors (218 SparseStab, 10 StateVec, 2 StateVecEngine), across tests/ and every #[cfg(test)] module. Runtime code and doc examples are untouched; no new APIs were needed.
  • New tests/determinism_discipline.rs: scans the crate's own sources (tests/ entirely, plus #[cfg(test)] regions in src/, including external mod tests; files) and fails on any entropy-seeded simulator constructor, with an empty allowlist and a message naming the file, line, and seeded alternative. Non-vacuity assertions prove the scan reads real code.
  • Mutation-verified twice (implementation and an independent re-check): reintroducing SparseStab::new( in either a tests/ file or a #[cfg(test)] module fails the scan naming the site.
  • Full crate suite green: 957 unit tests, all integration binaries, 206 doctests; clippy and fmt clean.

Context recorded in #332: the canonical RNG platform should eventually make whole-run determinism single-knob; this PR makes the test suite deterministic today without preempting that design.

@ciaranra
ciaranra merged commit e33f604 into dev Aug 8, 2026
19 checks passed
@ciaranra
ciaranra deleted the neo-deterministic-tests branch August 8, 2026 20:09
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