ADR 0009: Reproducible random number streams
- Status: Accepted (2026-11-10)
- Date: 2026-11-10
- Deciders: Vincent Mader
- Related: E6 to E16; ADR 0012
Context
Estimator studies need many independent replicas, parallel execution, and identical results in the CLI and the browser. The thesis used the global np.random state without seeds.
Decision
Use a seedable, platform-independent generator from the rand ecosystem (a counter-based or PCG/ChaCha generator, chosen in M1 by speed and wasm support). Each random stream is derived deterministically from (run seed, replica, time step, purpose) so results do not depend on thread scheduling or on the number of draws in other streams. The seed and derivation scheme are recorded in the run manifest.
Alternatives considered
- One global RNG: results depend on execution order and thread count.
- OS entropy: not reproducible.
Consequences
- Replicas run in parallel with identical results to serial runs.
- Common random numbers across estimator variants become possible (variance reduction in comparisons).