pub struct TwinRunConfig {
pub seed: u64,
pub clock: LogicalClockParams,
pub faults: FaultSchedule,
pub acting: Arc<dyn TwinPolicy>,
pub shadow: Option<Arc<dyn TwinPolicy>>,
pub timeout_ladder: Vec<u64>,
pub concurrency_ladder: Vec<u32>,
pub workers: Vec<String>,
pub max_attempts: u32,
pub interleaving: Interleaving,
}Expand description
The parameters of one twin run: determinism seams, the fault schedule, the acting policy, an optional shadow, the decision ladders, and the worker pool.
Two runs over the same Twin with equal configs produce byte-identical
journals — the twin’s whole claim, proven in the test suite across
repeated runs and across process invocations (the checked-in golden).
Fields§
§seed: u64The run’s seed: RNG draws, interleaving permutations, and stochastic policy draws all derive from it.
clock: LogicalClockParamsThe logical clock the run’s journal timestamps from.
faults: FaultScheduleThe fault schedule the scheduler reads. Empty means the recorded world, unfaulted.
acting: Arc<dyn TwinPolicy>The policy whose actions execute. The floor by default.
shadow: Option<Arc<dyn TwinPolicy>>A candidate scoring the same features without acting (mechanism 4).
timeout_ladder: Vec<u64>The timeout family’s legal rungs, ascending. The top rung models
“no bound in force”; keep it at MAX_RETRY_DELAY_MS for
comparability with Wave 1.
concurrency_ladder: Vec<u32>The concurrency family’s legal rungs, ascending; u32::MAX is
uncapped.
workers: Vec<String>The worker pool placement ranks. Equivalence is a precondition: the pool declares the workers interchangeable for this workload.
max_attempts: u32The retry attempt budget (the floor’s own is 3).
interleaving: InterleavingCanonical or seeded ordering of each super-step’s task set.
Implementations§
Source§impl TwinRunConfig
impl TwinRunConfig
Sourcepub fn new(seed: u64) -> Self
pub fn new(seed: u64) -> Self
A baseline configuration: the floor acting, no shadow, no faults, canonical order, default ladders, one worker, the floor’s attempt budget.
Sourcepub fn with_faults(self, faults: FaultSchedule) -> Self
pub fn with_faults(self, faults: FaultSchedule) -> Self
Builder-style: attach a fault schedule.
Sourcepub fn with_acting(self, policy: Arc<dyn TwinPolicy>) -> Self
pub fn with_acting(self, policy: Arc<dyn TwinPolicy>) -> Self
Builder-style: act with policy instead of the floor.
Sourcepub fn with_shadow(self, candidate: Arc<dyn TwinPolicy>) -> Self
pub fn with_shadow(self, candidate: Arc<dyn TwinPolicy>) -> Self
Builder-style: shadow the acting policy with candidate.
Sourcepub fn with_workers(
self,
workers: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_workers( self, workers: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Builder-style: declare the worker pool.
Sourcepub fn with_max_attempts(self, max_attempts: u32) -> Self
pub fn with_max_attempts(self, max_attempts: u32) -> Self
Builder-style: override the retry attempt budget.
Sourcepub fn with_seeded_interleaving(self) -> Self
pub fn with_seeded_interleaving(self) -> Self
Builder-style: order each super-step’s task set by seeded draw.