Repository navigation
Conversation
Every DepoTransform (charge fluctuation) and AddNoise node used the single tools.random instance. The two anode pipelines run concurrently under TbbFlow, so the order in which they draw from the shared generator depends on thread timing: with fixed seeds the simulated noise, and with it the wires, hits, and everything downstream, changed between identical detsim jobs. Each anode pipeline now has its own Random instance (rng-<anode>); the Drifter, upstream of the fan-out, keeps tools.random. This is the approach of WireCell/wire-cell-toolkit issue #242. The noise realisation changes with respect to the release. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Gives each anode's WireCell simulation pipeline its own random generator, so that detsim gives the same output when the same job is run twice.
The bug: every
DepoTransform(charge fluctuation) andAddNoisenode insim.jsonnetused the singletools.randominstance. The two anode pipelines run concurrently underTbbFlow, so the order in which they draw from the shared generator depends on thread timing. With fixed seeds, the simulated noise, and with it the wires, hits, and everything downstream, can change between identical jobs. This is the situation described in wire-cell-toolkit issue 242 ("Deterministic randoms"), which proposes the same cure.The change: one
Randominstance per anode (rng-<anode>), used by that anode'sDepoTransformandAddNoise. TheDrifter, upstream of the fan-out, keepstools.random. Onlysim.jsonnetchanges.Testing (sbndcode v10_26_00 on sbndbuild03, MC BNB + cosmics, fixed seeds, per-event checksums of the detsim products):
dnnspwires differ in 1 of 5 events. With one generator per anode they are identical in all 5, and the SimChannels are identical in both cases.gaussandwienerwires have a second, separate source of run-to-run differences in WireCell 0.37.1, fixed upstream in wire-cell-toolkit pull request 535. The tests above that involve those wires used a WireCell library with that PR applied.sim.jsonnetis identical in v10_26_00 and develop, so the tested file is the one in this PR. Not run on a develop build.Things to know:
[0, 1, 2, 3, 4, n + 1]for anoden) and do not follow the art seed service. Running the same g4 events with a different art seed gives identical wires, so every job starts WireCell's fluctuation and noise from the same state. That needs its own change.Context: found while preparing a fixed-seed comparison of the release against the menu of time, memory, and disk savings for the Gen3 MC production (slides "Gen3 MC Production: Where the Time and Disk Go", Nov 2026). The comparison needs the release to reproduce itself first.
🤖 Generated with Claude Code