Skip to content
github-actions[bot] edited this page Dec 2, 2026 · 2 revisions

Faultline

Deterministic simulation testing (DST) for .NET, inspired by Rust's MadSim and FoundationDB's simulation engine.

Faultline executes concurrent and distributed C# async/await code inside a single-threaded, seed-driven discrete-event simulator, giving you instant virtual time, seeded random task interleaving, multi-host clusters in one process, and bit-for-bit bug replay from a single ulong seed.

Why Faultline?

  • Zero production footprint — Production assemblies never reference Faultline; IL rewriting runs only on test builds.
  • Bit-for-bit deterministic replay — Every SimDeadlockException and SimTimeoutException carries the exact reproduction Seed.
  • Instant virtual time — Multi-minute Task.Delays, timeouts, and timers execute in microseconds.
  • Multi-host simulation — Spin up multiple virtual hosts with independent clock offsets, forked PRNGs, and Crash() / Restart() lifecycles.

Documentation

  • Getting Started — Run your first deterministic simulation.
  • IL Rewriter — How Faultline.Rewriter transparently intercepts BCL calls via AsmResolver.DotNet.
  • Architecture — Discrete-event loop, SimTaskScheduler, SimSynchronizationContext, and AsyncLocal<SimHost>.

Clone this wiki locally