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
impl SequentialController
pub fn new() -> Self
Sourcepub fn default_boxed() -> Box<dyn DeterminismController>
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.
Sourcepub fn rollback_count_handle(&self) -> Arc<AtomicU64> ⓘ
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.
Sourcepub fn record_rollback(&self)
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
impl Default for SequentialController
Source§impl DeterminismController for SequentialController
impl DeterminismController for SequentialController
Source§fn kind(&self) -> &'static str
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).
fn partition( &self, ready: &[PendingActivation], region: Region, now: SchedTime, ) -> Vec<WorkItem>
Source§fn on_read(&self, _act: ActivationId, _cell: StateCellId, _version: u64)
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.