Skip to main content

SequentialController

Struct SequentialController 

Source
pub struct SequentialController { /* private fields */ }
Expand description

The v1 degenerate sequential controller (SC-009/DT-007): a single global Mutex<SchedTime> for gvt and one monotonically increasing local_send_seq counter. Never spawns a thread (DT-006) and never records a conflict set — on_read/on_write are no-ops because a strictly sequential dispatcher has nothing to detect a conflict against; that absence of any rollback machinery is DT-007’s “no rollback ever needed” made concrete, not an oversight.

Implementations§

Source§

impl SequentialController

Source

pub fn new() -> Self

Source

pub fn default_boxed() -> Box<dyn DeterminismController>

The engine’s set_determinism_controller fallback (Task 18) calls this when no controller has been configured — SC-009’s “selected by default when no other controller is configured” half.

Source

pub fn rollback_count_handle(&self) -> Arc<AtomicU64> ⓘ

A clonable handle onto this controller’s rollback-event counter, readable after this controller has been moved into an Engine (see Self::rollback_count’s doc comment for why this indirection is necessary at all). Task 22’s dt033_conservative_v1_default_produces_ zero_rollback_events integration test (tests/region_order_fixture.rs) clones this before calling set_determinism_controller.

Source

pub fn record_rollback(&self)

DT-033/DT-001’s “zero rollback events” acceptance, made into a real counter rather than only prose. Nothing in this file’s own production code (partition/on_read/on_write/gvt/ drain_and_resolve above) calls this method anywhere — a strictly sequential, single-thread dispatcher with gvt() == now always has no conflict to roll back from by construction (DT-007), so this counter can only ever read 0 for this controller in this wave. That is not the same as the test being unable to fail: it is a real, wired-through counter (not a hardcoded 0 the test reads), so a future edit that mistakenly adds rollback-triggering logic to this controller (e.g. a well-meaning “fix” that starts calling this from on_write on a detected write-write conflict, forgetting DT-007’s whole point is that this controller must never need to) trips this counter and fails Task 22’s test — the same “currently-always-passes, genuinely-can-regress” shape as dt006_no_thread_spawn_or_rollback_ code_outside_determinism_module above.

Trait Implementations§

Source§

impl Default for SequentialController

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl DeterminismController for SequentialController

Source§

fn kind(&self) -> &'static str

Task 18’s Engine::controller_kind() testability tag (DT-007’s “selected by default when no other controller is configured” half, made observable from outside).

Source§

fn partition( &self, ready: &[PendingActivation], region: Region, now: SchedTime, ) -> Vec<WorkItem>

Source§

fn on_read(&self, _act: ActivationId, _cell: StateCellId, _version: u64)

act is the ActivationId of the WorkItem (partition()’s own output, WorkItem.activation.id) currently executing the read/write.
Source§

fn on_write( &self, _act: ActivationId, _cell: StateCellId, _prior: FourStateValue, _version: u64, )

Source§

fn gvt(&self) -> SchedTime

The commit horizon: nothing at/after this may be observed externally.
Source§

fn drain_and_resolve(&self, work: Vec<WorkItem>) -> ResolvedBatch

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, 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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