Repository navigation
Seed per-track RNG from the unique Geant4 event ID - #2580
Merged
sethrj merged 3 commits intoOct 25, 2026
Merged
Conversation
Take a 64-bit event ID in initialize_rng_state so that a unique event number (e.g. from Geant4) can be mixed into per-track seeds. SplitMix64 already xors 64-bit values into its state, so initializers are unchanged for all event IDs that fit in 32 bits. Assisted-by: Claude Code (Claude Opus 5.5)
With CELERITAS_RESEED=track, primaries are seeded from the seed, their event ID, and their primary ID. Offloaded Geant4 primaries always have the local event ID 0 (the slot used for counting tracks), and their primary IDs restart at zero each event, so the k-th offloaded primary of every event, on every thread, got the same random stream. Add a UniqueEventId to Primary, set it from the Geant4 event ID in LocalTransporter, and seed from it, falling back to the local event ID when it is unset. Behavior change: Geant4 offload results change with CELERITAS_RESEED=track. celer-sim and trackslot reseeding are unchanged. Assisted-by: Claude Code (Claude Opus 5.5)
esseivaju
marked this pull request as ready for review
October 23, 2026 18:21
esseivaju
requested review from
davidsgr and
sethrj
and removed request for
sethrj
October 23, 2026 18:22
Test summary 6 468 files 10 669 suites 19m 23s ⏱️ Results for commit 5134a25. ♻️ This comment has been updated with latest results. |
sethrj
reviewed
Oct 24, 2026
Add a todo from review: seeding from event IDs read from input files is based on flawed assumptions. Event and stream IDs, and seeding from the unique event ID and Geant4 track ID, should be revisited along with the supported threading/tasking models. Assisted-by: Claude Code (Claude Opus 5.5)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2580 +/- ##
===========================================
+ Coverage 86.98% 86.99% +0.01%
===========================================
Files 1420 1421 +1
Lines 46043 46100 +57
Branches 14028 14061 +33
===========================================
+ Hits 40050 40106 +56
Misses 4681 4681
- Partials 1312 1313 +1
🚀 New features to boost your workflow:
|
sethrj
approved these changes
Oct 25, 2026
Merged
via the queue into
celeritas-project:develop
with commit Oct 25, 2026
6ee8d00
45 checks passed
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.
With
CELERITAS_RESEED=track, each primary's RNG is seeded from (seed, event ID, primary ID). Geant4 offload always sets the local event ID to 0, and primary IDs restart at 0 each event. So the k-th offloaded primary of every event, on every thread, got the same random stream, and its secondaries branched the same way. This adds to #2124.Primarygains aUniqueEventId unique_event_id, whichLocalTransportersets from the Geant4 event ID.EventIdwhen it's unset, so celer-sim and existing tests are unchanged.initialize_rng_statetakes a 64-bit event ID. States are unchanged for IDs below 2^32.InitializeRngStateTest.wide_event_idandTrackInitHostTest.unique_event_rng.Behavior change: Geant4 offload results change with
RESEED=track.trackslotand celer-sim results are unchanged.Note: with
RESEED=track,global/Stepperandglobal/StepperGeantfail before and after this PR. Their expected values assume trackslot seeding, and some primaries lack aprimary_id. CI doesn't build this mode.AI-assisted: implemented with Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code