Idea

Checking distributed systems by exhaustive simulation

Two servers read a shared counter, both add 1, both write back, and one increment is lost, but only when both reads land before either write. A test run sees one order of events, and a reviewer tracing the orders by hand can miss the bad one.

yichus dist tries every delivery order and declared fault up to a bound, and each property comes back holds, violated with the schedule that broke it, or inconclusive when the bound cut the search short. The system is a Bosatsu model whose handlers return their next state and messages as data.

See a lost update caught →See the reviewer benchmark →

Task 002 worked example: prevent a lost update with compare-and-swap

The checker’s schedule for a server that reads and writes back blindly:

1. deliver app1 -> db [Get]           db(v=0,ver=0)  app1(waiting)  app2(waiting)
2. deliver app2 -> db [Get]           db(v=0,ver=0)  app1(waiting)  app2(waiting)
3. deliver db -> app1 [GotValue(0,0)] db(v=0,ver=0)  app1(done)     app2(waiting)
4. deliver db -> app2 [GotValue(0,0)] db(v=0,ver=0)  app1(done)     app2(done)
5. deliver app1 -> db [Put(1)]        db(v=1,ver=1)  app1(done)     app2(done)
6. deliver app2 -> db [Put(1)]        db(v=1,ver=2)  app1(done)     app2(done)
   quiescent; both_counted requires v == 2, found v == 1: violated

The compare-and-swap version holds over all 106 schedules, and the search is complete.

Benchmark: reviewer accuracy with and without the checker

Fresh reviewers judged three defective servers that read as correct:

ReviewerWithout the checker (reading only)With the checker
Default-tier reviewer3/3 caught, correct schedules derived by handnot run; reading already suffices at this size
Haiku-tier reviewer2/3; certified one defective variant as correct, high confidence3/3 caught, root causes taken from the checker's schedules

Each cell is one trial, so this shows the case exists, not a rate. The task 010 run artifact records a second case, an attacker reflecting a server’s own nonce.

Ask your agent about anything here; it has the detail.

Where this fits