#testing-harness #crdt #deterministic-simulation #bones #seed #convergence #idempotent #reconciliation #triage #clock-drift

bin+lib bones-sim

Deterministic simulation harness for testing CRDT correctness in bones

19 releases (5 breaking)

Uses new Rust 2024

0.24.6 May 7, 2026
0.24.5 May 6, 2026
0.24.0 Apr 12, 2026
0.23.3 Mar 29, 2026
0.18.1 Feb 28, 2026

#162 in Simulation


Used in bones-cli

MIT/Apache

1.5MB
32K SLoC

bones-sim

Deterministic simulation harness for testing CRDT correctness in bones under adversarial network conditions.

What this crate provides

The sim models multiple agents emitting events over a configurable fault-injected network. After the network drains, a reconciliation phase models real sync (pairwise gossip + set union). An oracle then checks five invariants:

  • Convergence — all agents end up with identical state
  • Commutativity — event application order doesn't matter
  • Idempotence — re-applying events is a no-op
  • Causal consistency — no gaps in per-source sequences
  • Triage stability — derived scores agree across replicas

Fault modes: message drops, reordering, duplication, network partitions, clock drift.

Every seed is deterministic: same seed → same trace → same result. When a seed fails, you get a full execution trace showing exactly which message was dropped or reordered and how it cascaded.

Usage

This crate is used by the bn dev sim subcommand in bones-cli:

# run 100 seeds with default fault rates
bn dev sim run --seeds 100

# replay a failing seed
bn dev sim replay --seed 42

See the bones repository for the full project.

Dependencies

~33–48MB
~683K SLoC