Distributed Systems April 2026 · 3 models tested to date (N=1) · 26 tasks

Distributed Systems / Raft:
Where Consensus Implementations Drift from Their Specifications

Consensus protocol implementations drift from their specifications as optimizations accumulate. This benchmark re-injects classic drift, missing term checks, bad vote tracking, inverted abort-safety, and asks models to recover the specification. Early N=1 runs show that implementation tasks are uniformly out of reach; only the Dafny-verified subset admits any signal.

Abstract

Raft[1], Paxos, PBFT, and 2PC have decades of formal specifications behind them, TLA+ specs, Dafny[2] proofs, model-checked invariants, yet their production implementations routinely ship bugs that violate those same invariants. The pattern is consistent: an optimization lands, the formal spec is not updated, and a subtle drift opens between what the paper proves and what the code does. This benchmark mechanizes that drift: one-line mutations against classic Raft, Paxos, and 2PC implementations, scored by hidden deterministic Go test suites with fault injection (network partitions, node crashes, adversarial schedulers).

The 26 tasks span four families of correctness failure the founder cares about: spec-to-implementation drift, safety under partition, liveness under adversarial scheduling, and log-replication invariants under crash recovery. Tasks range from easy 2PC crash-recovery fixes up to hard PBFT Byzantine-quorum implementations and 5-violation Raft safety patches. A subset of tasks require Dafny proofs of protocol invariants (log compaction safety, replicated KV linearizability, 2PC atomicity) rather than code fixes, exercising the same models on machine-checked verification.

This report covers early N=1 runs for three frontier models. The headline finding is stark: every protocol-implementation task scored 0.000 across all three models. Non-zero signal is confined to the Dafny verification subset. We include full traces on the hardest task (fix_raft_safety), a representative verification task (verify_log_compaction), and a breadth example outside Raft (twopc_crash).

Methodology and early data. This is a deliberately thin early-signal report: 3 models tested to date, N=1 per model, 26 tasks. Additional frontier models and N=3 reruns will be added as the environment stabilizes. Two of the three runs surfaced infrastructure notes (one local-scoring gap on Mistral, one rate-limit truncation on Kimi); both are called out per-task rather than silently dropped.

Summary Statistics

BenchmarkValue
Total tasks26
Task familiesRaft, Paxos, PBFT, 2PC, CRDT, chain replication, broadcast, gossip, locks, LSM, consistent hashing, Dafny verification
Models evaluated3 (N=1 each; additional models pending)
Total episodes on disk77 (26 + 26 + 25)
Overall best model mean0.115 (Gemini 3 Flash Preview)
Protocol-implementation tasks with any non-zero score0 of 22
Dafny-verification tasks with at least one non-zero score4 of 4
Tasks solved at 1.000 by any model4 (all Dafny: verify_log_compaction, verify_replicated_kv, verify_two_phase_commit, verify_distributed_lock)

Per-Model Overall Scores

Model Mean score Max score Tasks ≥ 0.5 Tasks at 0.000
Gemini 3 Flash Preview 0.115 1.000 3 23
Kimi K2.5 0.093 1.000 2 22
Mistral Large 3 0.019 0.500 1 25

Featured Task Scores by Model

Model fix_raft_safety verify_log_compaction twopc_crash
Gemini 3 Flash Preview 0.000 1.000 0.000
Kimi K2.5 0.000 1.000 0.000
Mistral Large 3 0.000 0.000 0.000
overall mean score across 26 tasks
Flash 3 Prev 0.115 Kimi K2.5 0.093 Mistral L3 0.019
fix_raft_safety: score per model (hard)
Flash 3 Prev 0.000 Kimi K2.5 0.000 Mistral L3 0.000
verify_log_compaction: score per model (Dafny)
Flash 3 Prev 1.000 Kimi K2.5 1.000 Mistral L3 0.000
twopc_crash: score per model (easy)
Flash 3 Prev 0.000 Kimi K2.5 0.000 Mistral L3 0.000

Scoring

Each task runs deterministically inside Docker (no network, no GPU). Scores are continuous in [0, 1]. Multi-gate scoring combines a compilation gate, a modification gate (agent-reverted files score 0), and a sigmoid over hidden-test pass rate. Verification tasks (Dafny) apply an additional formal-proof weighting: required lemma signatures must be present, banned keywords (assume false, etc.) are rejected, and the full proof must typecheck against Dafny's verifier. Exact weights, sigmoid centres, and anti-cheat tokens are not disclosed.

Task 1: fix_raft_safety

What the agent must solve

Recover a buggy Raft consensus module with five safety violations, each a missing check in a different function. The violations span the invariants that make Raft safe under adversarial partition: vote-once-per-term in RequestVote, candidate-log-at-least-as-up-to-date in StartElection, prev-log-index consistency in AppendEntries, stale-vote rejection in HandleVoteResponse, and leader-term-commit restriction in AdvanceCommitIndex. The hidden test suite injects network partitions, leader crashes, and re-election storms; a fix that plausibly compiles but violates any one of the five invariants fails the entire task (min_pass_rate = 0.4).

This is the canonical "spec drift" task: the original Raft paper specifies all five invariants. Production implementations lose them in optimization patches one at a time. An agent that truly understands Raft should recover them; an agent that pattern-matches on surface-level Go code will plausibly write all five and still fail the hidden integration tests.

Agent trace: Gemini 3 Flash Preview (score 0.000, 29 tool calls)

gemini-3-flash-preview / fix-raft-safety 29 tool calls · 158K tokens · 289s score: 0.000
1-2
Ran go test -run TestRaftSafety to see what fails. Listed the consensus directory.
consensus/raft_safety_test.go: no such file or directory
The hidden tests are not visible to the student workspace by design. The agent correctly inferred it must read the source alone.
3-5
Used sed to page through raft_safety.go, lines 110–140. Identified the HandleVoteResponse stale-vote region and the RequestVote block.
6-25
Wrote fixes for all 5 invariants (model's own summary):
1. RequestVote: gate on rs.VotedFor == -1 || == candidateID 2. StartElection: check candidate log is at least as up-to-date 3. AppendEntries: consistency check at prevIndex 4. HandleVoteResponse: reject stale-term responses 5. AdvanceCommitIndex: only commit entries from leader's current term
Each fix was edited in, then re-compiled.
26-29
Final go test -run TestRaftSafety.
gate failed at stage: below_min_pass_rate · pass_rate=0.0 · min_pass_rate=0.4
Despite the agent's plausible fix summary, the hidden integration tests, which inject partition + re-election + crash-recovery scenarios, saw zero passing cases. At least one of the five fixes was wrong or introduced a secondary bug.

The student_strategy field reads like a correct Raft patch in prose. The scoring gate disagrees. This is the dominant failure mode on protocol-implementation tasks: the model writes confident, specification-flavoured code that plausibly addresses the bug description, then fails the hidden adversarial tests. Without visible test feedback and without the ability to reason about all five invariants interacting under partition, the agent has no way to verify whether its fix actually holds.

Agent trace: Mistral Large 3 (score 0.000, 23 tool calls)

mistral-large-3 / fix-raft-safety 23 tool calls · 121K tokens · 138s score: 0.000
1-3
Same initial failure: go test -run TestRaftSafety returns no tests. Searched for test files with find /workdir/data -name "*test*.go".
4
Attempted to write its own raft_safety_test.go file (heredoc).
This pattern is flagged by the anti-cheat layer when the synthetic test file aims to shadow hidden scoring tests. The run continued but the self-written tests cannot influence the final score.
5-22
Ran its own self-authored test to "verify" the fix, iterated on the source file, eventually deleted the self-authored test.
bash: rm /workdir/data/consensus/raft_safety_test.go
23
Final gate check failed the same way: pass_rate=0.0, stage=below_min_pass_rate. The scoring-time hidden tests are injected from root-only storage after the agent submits and cannot be influenced by anything the agent writes into its workspace.

Agent trace: Kimi K2.5 (score 0.000, 7 tool calls, truncated)

Kimi's run on this task was cut short by an upstream provider rate-limit error after 7 tool calls and 128K tokens. It did not reach a submission state. We include the result for completeness but treat it as infra-truncated rather than a full model failure.

Tool Call Efficiency: fix_raft_safety

ModelScoreTool CallsTime (s)Tokens
Gemini 3 Flash Preview0.00029289157,558
Kimi K2.50.0007 (rate-limited)84127,989
Mistral Large 30.00023138121,105
The five-invariant structure is adversarial by design. Each violation is a one-line mutation in a different function. A partial fix (3 of 5) still fails with pass_rate=0.0 because the hidden tests exercise scenarios that require all five invariants to hold simultaneously. Unlike single-bug tasks, there is no partial-credit escape: the tests either all pass or almost all fail.

Task 2: verify_log_compaction

What the agent must solve

Write Dafny proofs of log-compaction safety for a replicated state machine: coordinated loop invariants and pre/postconditions over twelve required lemmas including AppendPreservesWellFormed, CompactPreservesCommittedReads, and AppendDoesNotAffectCommitted. The proof obligations mirror the Raft snapshot-and-compaction invariants from the TLA+ spec: the log may be truncated (compacted) at any committed prefix, but no committed read can change its answer as a result. The agent must identify the coordinated invariants across multiple functions and discharge the proof in Dafny's verifier.

Banned keywords (assume false, others) are rejected; the agent must actually prove the obligations. Exact ban list not disclosed.

Agent trace: Gemini 3 Flash Preview (score 1.000)

gemini-3-flash-preview / verify-log-compaction 16 tool calls · 136K tokens · 60s score: 1.000
1
Immediate dafny verify /workdir/data/consensus/log_compaction.dfy to identify which obligations are unproved in the stub.
2-3
Read the full log_compaction.dfy stub. Identified that the imperative methods needed functional companions to be usable in specifications and lemmas. Edited the file to introduce functional-style versions of Append, Commit, and Compact.
4-5
Re-read the edited file, then re-ran dafny verify. Discharged the full proof obligations including the WellFormed preservation lemmas under all three state-changing operations.
(no errors; all 12 lemmas verified)
6
Final re-verification to confirm stability. Score: 1.000.

Flash's strategy is the canonical Dafny pattern: lift imperative methods into functional form so they can appear inside lemma specifications, then prove preservation of the structural invariant (WellFormed) under each transition. 16 tool calls, one compile-verify loop, clean finish.

Agent trace: Kimi K2.5 (score 1.000)

Kimi also solved this task at 1.000 in 13 tool calls and 272K tokens, twice the token budget of Flash, same terminal score. The trace shows a longer exploration of Dafny tactics early on, then convergence on the same functional-encoding strategy.

Agent trace: Mistral Large 3 (score 0.000)

mistral-large-3 / verify-log-compaction 18 tool calls · 70K tokens · 147s score: 0.000
1-2
Ran dafny verify and dafny /compile:0. Initial output confirmed unproved obligations.
3-18
Iterated on invariants. Result at submission: hidden re-score gate returned an infrastructure error (Local scoring disabled (no container image)), which caused the final recorded score to be 0.000. This is a known infra artefact on one of the three runs: we treat Mistral's verify_log_compaction data point as non-authoritative. Re-run pending.

Tool Call Efficiency: verify_log_compaction

ModelScoreTool CallsTime (s)Tokens
Gemini 3 Flash Preview1.0001660135,612
Kimi K2.51.00013147272,004
Mistral Large 30.000*1814770,038

*Mistral result confounded by a local-scoring infra error; re-run pending.

Task 3: twopc_crash (breadth beyond Raft)

What the agent must solve

Recover two-phase commit with three interacting bugs: (a) vote-validation accepting malformed votes, (b) inverted decision logic that would commit on any single yes-vote instead of requiring unanimous, (c) abort-safety that loses durability across coordinator crash. All three must be fixed for the hidden test suite to pass. 2PC is included because it represents the other end of the consensus-correctness spectrum from Raft: Raft is leader-driven with majority quorums, 2PC requires unanimity and has a very different failure-mode surface (coordinator single-point-of-failure, cohort-participant indecision on crash).

Why it matters for the benchmark

If the environment only tested Raft, a model could in principle memorize the Raft specification and pattern-match. 2PC exercises a disjoint invariant set: unanimity on commit, safety of abort under crash-recovery, and the cohort-log-replay protocol. The founder's correctness-under-crash-recovery dimension lands here specifically.

Agent trace: Gemini 3 Flash Preview (score 0.000)

gemini-3-flash-preview / twopc-crash 11 tool calls · 51K tokens · 66s score: 0.000
1-2
Listed the consensus directory, read twopc.go. Identified the three suspected bug sites from the task's on-call ticket (RecordVote, TryDecide, Recover).
3-6
Edited twopc.go in place. Summary fix (model's own words): "ensure Commit decision only if ALL participants vote Commit; if any participant votes Abort, the decision is immediately set to Abort." Deleted a stale twopc_test.go that had been cached in the workspace.
7-11
Ran go build to verify compilation, then submitted.
gate failed at stage: below_min_pass_rate · pass_rate=0.0 · min_pass_rate=0.35
The fix compiled and addressed the decision-logic inversion, but either the vote-validation or crash-recovery bug (or both) was missed or mis-patched. Hidden tests rejected the submission entirely.

Other models

Mistral Large 3 also scored 0.000 (11 tool calls, 82s): similar pattern to Flash, plausible-looking fix, failed hidden tests. Kimi K2.5 scored 0.000 in 6 tool calls (102s); its run terminated early with a brief strategy that did not reference all three bug sites. Across all three models, the recurring failure is fixing the most prominent bug (decision logic) while missing one of the other two.

Tool Call Efficiency: twopc_crash

ModelScoreTool CallsTime (s)Tokens
Gemini 3 Flash Preview0.000116650,789
Kimi K2.50.0006102125,452
Mistral Large 30.000118248,599
2PC looks easy, it is not. The task is labeled easy in the manifest because each individual bug is a one-line fix. But the three bugs interact, and the scoring gate (min_pass_rate = 0.35) requires the majority of hidden tests to pass. A 1-of-3 or 2-of-3 partial fix scores zero.

Significance

For AI labs: this environment provides verifiable feedback on whether a model understands the formal specification of consensus protocols, not just their surface-level Go idioms. For distributed-systems researchers: every scoring run is deterministic and reproducible from the Containerfile. No GPU, no network. Next-round work expands from 3 models N=1 to at least 5 models and adds N=3 reruns on the Dafny subset to tighten the error bars on the tasks that currently show signal.

References

  1. Ongaro, D., Ousterhout, J., "In Search of an Understandable Consensus Algorithm," USENIX ATC, 2014. raft.github.io/raft.pdf
  2. Leino, K. R. M., "Accessible Software Verification with Dafny," IEEE Software 34(6), 94-97, 2017. doi:10.1109/MS.2017.4121212