Expand description
§navian-dst
A domain-agnostic deterministic-simulation-testing (DST) substrate.
DST replays a system under a harness-controlled clock, RNG, network, and executor so that a failing run can be reproduced bit-for-bit and shrunk to its minimal trigger. This crate provides the reusable building blocks — nothing here knows anything about a particular application domain.
§Non-determinism traits
Four traits abstract the sources of non-determinism that would otherwise
prevent replay-based testing. Each has a zero-overhead production impl
(direct calls to std/tokio/rand) and a deterministic simulation impl:
Time— wall-clock and monotonic time, plus async sleepRandom— RNG and UUID generationNetwork— cluster-internal node-to-node communication (marker)Executor— task spawning andblock_on
The simulation impls are reproducible only under single-threaded drive.
SimulatedTime and SimulatedRandom fix the content of the clock and
byte stream, but not the order in which concurrent OS threads consume them.
Bit-for-bit replay therefore requires running the workload on the
deterministic SimScheduler (one task at a time), not on the multi-threaded
tokio runtime. SimulatedExecutor only counts spawns; it does not by
itself confer determinism.
§Harness building blocks
SimScheduler— a single-threaded deterministic async schedulerFaultSchedule— a seeded, reproducible timeline of injectedFaultsInvariantEngine— a generic, step-aware invariant checkerddmin— delta-debugging trace shrinker
Re-exports§
pub use executor::timeout;pub use executor::Executor;pub use executor::ProductionExecutor;pub use executor::SimulatedExecutor;pub use executor::TimedOut;pub use network::Delivery;pub use network::Network;pub use network::ProductionNetwork;pub use network::SimulatedNetwork;pub use random::ProductionRandom;pub use random::Random;pub use random::SimulatedRandom;pub use time::ProductionTime;pub use time::SimulatedTime;pub use time::Time;pub use invariant::Invariant;pub use invariant::InvariantEngine;pub use invariant::Violation;pub use schedule::Fault;pub use schedule::FaultSchedule;pub use shrink::ddmin;pub use sim_scheduler::sleep as sim_sleep;pub use sim_scheduler::yield_now as sim_yield_now;pub use sim_scheduler::SimScheduler;
Modules§
- executor
Executortrait — task spawning.- invariant
- A generic, step-aware invariant engine for DST runs.
- network
Networktrait — cluster-internal node-to-node communication.- random
Randomtrait — RNG and UUID generation.- schedule
- Seeded fault-injection schedules for DST runs.
- shrink
- Delta-debug shrinking for DST failure traces.
- sim_
scheduler - Deterministic single-thread scheduler — Phase B #1 keystone.
- time
Timetrait — wall-clock, monotonic time, and async sleep.