Skip to main content

TwinRunConfig

Struct TwinRunConfig 

Source
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: u64

The run’s seed: RNG draws, interleaving permutations, and stochastic policy draws all derive from it.

§clock: LogicalClockParams

The logical clock the run’s journal timestamps from.

§faults: FaultSchedule

The 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: u32

The retry attempt budget (the floor’s own is 3).

§interleaving: Interleaving

Canonical or seeded ordering of each super-step’s task set.

Implementations§

Source§

impl TwinRunConfig

Source

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.

Source

pub fn with_faults(self, faults: FaultSchedule) -> Self

Builder-style: attach a fault schedule.

Source

pub fn with_acting(self, policy: Arc<dyn TwinPolicy>) -> Self

Builder-style: act with policy instead of the floor.

Source

pub fn with_shadow(self, candidate: Arc<dyn TwinPolicy>) -> Self

Builder-style: shadow the acting policy with candidate.

Source

pub fn with_workers( self, workers: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Builder-style: declare the worker pool.

Source

pub fn with_max_attempts(self, max_attempts: u32) -> Self

Builder-style: override the retry attempt budget.

Source

pub fn with_seeded_interleaving(self) -> Self

Builder-style: order each super-step’s task set by seeded draw.

Trait Implementations§

Source§

impl Debug for TwinRunConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more