pub enum RngSource {
System,
Seeded(SeededRng),
}Expand description
The run’s randomness source. Checkpoint ids and run ids are minted through it — the only entropy the executor consumes.
Variants§
System
Operating-system entropy (uuid::Uuid::new_v4). The default;
identical to pre-R0.5 behavior.
Seeded(SeededRng)
A deterministic ChaCha8 stream seeded from a u64. Two runs with the
same seed mint the same id sequence, so journals and checkpoints of a
re-driven run reproduce the original’s ids.
Implementations§
Source§impl RngSource
impl RngSource
Sourcepub fn seeded(seed: u64) -> Self
pub fn seeded(seed: u64) -> Self
A seeded RNG drawing from one ChaCha8 stream per handle clone.
Sourcepub fn uuid(&self) -> Uuid
pub fn uuid(&self) -> Uuid
Mint a UUID (v4 layout in both modes: variant/version bits are set explicitly for seeded draws, so downstream consumers cannot distinguish the source from the bits).
Sourcepub fn uuid_string(&self) -> String
pub fn uuid_string(&self) -> String
Convenience: RngSource::uuid as a string.
Sourcepub fn next_f64(&self) -> f64
pub fn next_f64(&self) -> f64
A uniform draw from [0, 1) with 53 bits of mantissa (R0.10 wave 2).
The runtime’s decision points consume entropy beyond id minting:
backoff jitter, the digital twin’s fault schedules and schedule
randomization, and stochastic shadow policies exploring by seeded
draw. Sourcing those draws through the same seam as ids keeps a
seeded run’s entire draw sequence reproducible — a twin run
reproduces exactly from its seed and fixture. The system mode derives
its draw from OS entropy via RngSource::uuid, the same source the
system mode already trusts for ids.