Skip to main content

vortex_core/
lib.rs

1//! `vortex-core` — Core types and deterministic scheduler for the Vortex simulation engine.
2//!
3//! This crate provides the foundational building blocks:
4//! - [`NodeId`] — unique identifier for a simulated node
5//! - [`SimEvent`] / [`SimEventKind`] — schedulable events in the simulation
6//! - [`SimScheduler`] — single-threaded deterministic event loop
7//! - [`DetRng`] — seeded deterministic random number generator
8//! - [`VortexSeed`] / [`SeedTree`] — 128-bit hierarchical seed derivation
9//! - [`SimContext`] / [`SimEventLog`] — simulation context and structured event log
10//! - [`FaultConfig`] — declarative fault injection DSL
11//! - Trait definitions for the I/O boundary ([`VortexNetwork`], [`VortexStorage`], [`VortexClock`])
12
13pub mod context;
14pub mod fault_config;
15pub mod plugin;
16mod rng;
17mod scheduler;
18pub mod seed;
19mod traits;
20
21pub use context::{
22    DivergenceKind, LogDivergence, SeqNo, SimContext, SimEventLog, SimLogEntry, Subsystem,
23};
24pub use fault_config::{
25    AllocFaultConfig, ClockFaultConfig, ConfigError, FaultConfig, FsError, FsFaultConfig,
26    FsFaultRule, FsOp, NetworkFault, NetworkFaultConfig, NetworkFaultRule, ProcessFault,
27    ProcessFaultConfig, ProcessFaultRule, SchedulingStrategy, ThreadSchedulingConfig,
28};
29pub use rng::DetRng;
30pub use scheduler::{SimEvent, SimEventKind, SimScheduler};
31pub use seed::{SeedTree, VortexSeed};
32pub use traits::*;
33
34/// Unique identifier for a simulated node.
35pub type NodeId = u64;