03/05#hmna-0003/052026Sole engineer
Homonoia: Raft, made visible
Raft consensus implemented from the paper and made visible in the browser.
- ticks fuzzed
- 3M
- leader changes
- 8,422
- safety violations
- 0
- tests
- 128
How it works, in 4 steps
- The leader stops being heard from.
- A follower’s election timeout fires, and it stands as a candidate.
- Three votes out of five settle the term.
- Replication resumes from whoever won it.
Notes
Homonoia is an implementation of the Raft consensus algorithm, written from the paper and made visible in the browser. Five simulated nodes on a network you can break — you set latency and drop rate, cut partitions, and kill or revive nodes, then watch leader elections and log replication behave correctly under whatever you do to them.
The consensus core is pure: state in, state out, no I/O and no timers. The same code runs the visualization and the fuzz harness, so what you see on screen is the thing that was verified rather than a diagram of it. The fuzz sweep runs 1,000 seeds of 3,000 ticks each and checks all five safety properties after every tick; across 8,422 leader changes, 89,253 committed entries and 1,993,145 messages (96,741 of them duplicated), it finds no violations.
Deleting a safety rule to check that the tests catch it produced the more interesting result. With Raft’s current-term commit restriction removed, 5,000 seeds and 15 million ticks of random fuzzing found nothing, while a hand-written Figure 8 scenario fails at tick 1529. Random schedules essentially never line up the four conditions that bug needs; you have to know it exists and construct it.
Built with
- TypeScript
- React
- Canvas
- Vite