[WIP] Seeded RNG - #309
Open
drobnyjt wants to merge 15 commits into
Open
Conversation
Collaborator
Author
drobnyjt
commented
Jul 28, 2026
Collaborator
Author
There was a problem hiding this comment.
This line in the github action lets you manually hit a "run workflow" button in the UI
…NG values; fixed simple_bca PRNG so that it gets a new rng with each particle.
…ers switched to thread-level seeds from prngs.
Collaborator
Author
… algorithm for residue-preserving floating point addition
…duced non-determinism for multiple species.
…thread-local rng for starting values.
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.


Thank you for your contribution to rustBCA!
Before submitting this PR, please make sure you have:
Fixes #308, #306, #305, #310
Description
This PR adds a seeded RNG (ChaCha8) to make RustBCA deterministic; as a first pass, the seed will be hardcoded - before merge, I'd like to have it be an optional input parameter.
This also rolls in the powf -> powi optimizations (there's a minor performance cost to determinism that is basically completely counteracted by these optimizations) and the Biersack-Varelas stopping power correction factor change.
I've also updated the README doctests to take advantage of the new determinism.
Remaining tasks:
Tests
Cargo test passes; using CI to make sure nothing's broken.