Skip to content

feat(dst): add RustFS Deterministic Simulation Testing framework and multi-seed runner - #4

Merged
loverustfs merged 1 commit into
mainfrom
feat/initial-dst-framework
Nov 27, 2026
Merged

loverustfs merged 1 commit into
mainfrom
feat/initial-dst-framework

Conversation

@loverustfs

Copy link
Copy Markdown
Contributor

Summary

Implements the official Deterministic Simulation Testing (DST) framework, unified runtime abstraction traits, virtual fault simulators, simulated RustFS erasure-coded storage & lock suite, and Joshua-style multi-seed CLI runner for RustFS.

Key Components

  • crates/rustfs-dst-runtime — Unified non-determinism abstraction traits:
    • Clock (RealClock / SimClock with per-node wall-clock skew and monotonic drift injection)
    • RngSource (RealRng / SimRng backed by ChaCha8Rng with SHA-256 domain-separated fork(label) and deterministic RFC 4122 UUID v4)
    • Network (SimNetwork supporting symmetric/asymmetric partitions, Swizzle-Clog link jitter, packet loss, node crashes, and post-apply reply drops) + real Tokio turmoil 0.7 virtual-TCP adapter (turmoil_net) + madsim compatibility guidance
    • DiskIo (RealDiskIo / SimDiskIo with explicit volatile page-cache vs durable fsync_file/fsync_dir split, power-loss crash_and_reboot, torn writes, deterministic bitrot, ENOSPC, and offline drives)
  • crates/rustfs-dst-faults — Fault & assertion infrastructure:
    • FoundationDB-style two-stage deterministic Buggify injector
    • CodeProbe coverage tracker (always, sometimes, reachable, unreachable) with automatic Antithesis-compatible JSONL output (ANTITHESIS_OUTPUT_DIR/sdk.jsonl)
    • RustFS ECStore commit CrashPoint registry mirroring rustfs/rustfs/crates/ecstore/src/crash_inject.rs
    • Deterministic SwizzleClogScheduler
  • crates/rustfs-dst-sim — Simulated RustFS cluster & 6-invariant oracle:
    • Mathematically exact GF(2^8) Cauchy Reed-Solomon codec across 4x4 (16 drives, EC:4, R=12, W=12), 3x2 (6 drives, EC:3, R=3, W=4), and 4x2 (8 drives, EC:4, R=4, W=5)
    • SimECStore implementing RustFS's two-phase xl.meta commit, write-quorum rollback, orphan generation reconciliation, If-Match/If-None-Match, multipart staging/commit/abort, bitrot detection, and online healing
    • QuorumLockClient / NodeLockService verifying monotonic-clock quorum leases under wall-clock skew
    • Real Tokio turmoil::Sim 4-node virtual-TCP quorum cluster simulation (turmoil_cluster)
    • 7 deterministic scenarios + SHA-256 execution trace hashing proving bit-exact replay
  • crates/rustfs-dst-cli (rustfs-dst) + Antithesis manifests + CI workflows (ci.yml, nightly-dst.yml).

Related Issues

Closes #1
Closes #2

Verification

  • cargo fmt --all -- --check: passed
  • cargo clippy --workspace --all-targets -- -D warnings: passed (0 warnings)
  • cargo test --workspace: 13/13 unit & integration tests passed
  • rustfs-dst verify-determinism: bit-identical SHA-256 trace hashes confirmed across all 7 scenarios on 4x4 and 3x2
  • rustfs-dst run --scenario all --seeds 25: 525/525 runs passed (175 each on 4x4, 3x2, and 4x2, 9,225 operations, 0 invariant violations)

@loverustfs
loverustfs merged commit 08b87e2 into main Nov 27, 2026
1 check passed
@loverustfs
loverustfs deleted the feat/initial-dst-framework branch November 27, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant