Concurrent Event Simulation Engine
Four interlocking subsystems form the load-bearing structure of the engine. Every component is hot-swappable, instrumented, and built for sustained 24/7 throughput on commodity steel.
Lock-free concurrent event loop built on work-stealing schedulers. Each thread maintains a local deque, stealing from peers when idle. Zero-contention fast path for 99.7% of dispatches.
MPSC channels with bounded backpressure. Messages flow through a tiered priority system — critical events bypass the queue entirely via a dedicated fast lane with sub-microsecond delivery.
Deterministic finite automaton governs simulation lifecycle. States are immutable snapshots — rollback to any prior tick in O(1) via persistent data structures.
Spatial partitioning via adaptive octree subdivision. Hot regions split automatically; cold regions merge. Partition boundaries are transparent to simulation entities.
Persistent immutable snapshots written to disk via copy-on-write segments. Replay any tick from cold storage. Supports time-travel debugging across distributed clusters.
Hierarchical fault containment. Failed actors restart in isolation; cascading failures stop at the nearest supervisor boundary. Inspired by Erlang/OTP, refined for 1M+ actor topologies.
Measured on a single 64-core node, 256GB RAM, NVMe scratch volume. Numbers below are sustained averages over a 24-hour soak test — not synthetic peaks.
Three primitives govern the engine in production: how it lands, how it reports, how it survives. No agents, no sidecars, no hidden complexity — one binary does the job.
Single binary. No runtime dependencies. Ship to bare metal, containers, or edge nodes. Configuration via environment or TOML.
Built-in metrics exporter. Prometheus-compatible. Real-time thread pool visualization, event queue depth, and partition heat maps.
Automatic fault isolation. Failed actors restart in-place without disrupting neighbors. Supervision trees handle cascading failures.
Drop the engine into your existing rack. Configuration is a single TOML file. Embedding is a single dependency. The runtime gets out of your way.
[engine]
threads = 1024
tick_rate = "60hz"
partition_strategy = "adaptive-octree"
[network]
protocol = "quic"
max_connections = 50_000
backpressure = "bounded"
[telemetry]
exporter = "prometheus"
endpoint = "0.0.0.0:9090"
sample_rate = 0.01
[supervision]
restart_policy = "exponential-backoff"
max_restarts = 16
isolation = "actor"
use concurrengine::prelude::*;
#[actor]
struct GameEntity {
position: Vec3,
velocity: Vec3,
}
impl Handler<Tick> for GameEntity {
fn handle(&mut self, _msg: Tick, ctx: &mut Context) {
self.position += self.velocity * ctx.delta();
ctx.emit(PositionChanged(self.position));
}
}
fn main() {
Engine::builder()
.threads(1024)
.tick_rate(Hz(60))
.build()
.spawn::<GameEntity>(1_000_000)
.run();
}
Live readouts from the production reference cluster. All subsystems are green except scheduled fault-recovery drills, which run hourly on standby cores.