Honor ran_seed in deterministic runs#452
Merged
Merged
Conversation
d8c9352 to
915798b
Compare
bd9fa01 to
9c26d08
Compare
b8ccb2d to
89bf5a6
Compare
9c26d08 to
6af10a4
Compare
krystophny
added a commit
that referenced
this pull request
Jul 12, 2026
Re-lands #452 on `main`. That pull request was squash-merged into its stacked base `fix/ci-slow-test-gates` (#454), so `main` never received the fix. This branch cherry-picks the squash commit `d8506f9` onto current `main` (`3cfba79`); it applied without conflicts. Deterministic runs ignored `ran_seed` and always produced the default stream, so distinct seeds could not generate independent particle sets. `params.f90` now forwards the configured seed, `test_deterministic_seed.f90` checks that distinct seeds change the stream while the default seed reproduces the previous one, and the orbit-output example input records the seed it uses. ## Verification ### Test fails on main `src/params.f90` reverted to `origin/main`, test kept: ``` $ fo test test_deterministic_seed test_deterministic_seed FAIL 0.11s Summary: 0 passed, 1 failed, 0 skipped ( 0.11s) ``` ### Test passes after fix ``` $ fo test test_deterministic_seed test_deterministic_seed PASS 0.12s Summary: 1 passed, 0 failed, 0 skipped ( 0.12s) ``` `fo build` and `fo lint` pass on the branch (no new warnings; 0 unused imports).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #464
Risk tier
Correctness contract
Intended behavior change
ran_seedcontrols the Fortran random stream whendeterministic=.true.. Equal seeds reproduce the stream; different seeds change it.Behavior that must not change
Orbit equations, integrators, field evaluation, loss criteria, parallel dispatch, and deterministic replay for an explicitly fixed seed are unchanged.
Coordinate / unit conventions
No coordinate, unit, boundary, or symmetry convention changes.
Numerical invariants
Only sampled initial conditions may change. The historical NetCDF fixture now explicitly requests seed 42. The chartmap pipeline keeps its existing calculations, assertions, and plots.
Tests added
fopipelineGolden-record impact
Failure modes considered
Same-seed non-reproducibility, ignored distinct seeds, invalid orbit fixture sample, and plot-enabled chartmap runtime exceeding its former 60 s timeout.
Manual validation
The NetCDF fixture passes with its historical seed 42. The plot-enabled chartmap pipeline passes in 59.71 s with a 120 s timeout.
Verification
Test fails on main
Test passes after fix