Obstruction-free consensus
Processes try to agree on a value using only shared registers. Pick a scenario and step through every read and write. Read the algorithm
Model asynchronous · atomic read/write registers · any number of crash failures
Shaded bands mark rounds, and the dashed vertical line marks the latest step. Click or tap a dot to inspect it. The line above the timeline then describes that step, its pseudocode line lights up, and for a read an arrow points back to the write it returned. Click it again, or click an empty spot, to go back to the latest step.
Shared registers
Custom runs
Custom setup
Schedule: export, import, replay
The algorithm
D and H are turned off. The greyed lines are skipped, so each round is only a call to the commit-adopt object.
Tags like p0 mark each process's next instruction. A faded p0 on line 8 means that process is inside Algorithm 2.
• Validity: w was proposed by some process.
• Coherence: if some process returns (commit, w), every process returns w (commit or adopt).
• Convergence: if all processes propose the same v, all return (commit, v).
• Obstruction-freedom: a process running alone returns (commit, v).
Reading the diagram
Each process has its own row, with time running left to right. A dot is one atomic register operation, placed at the step where the scheduler (or your Step button) chose that process. A red ✕ marks a crash. The process takes no more steps, but the values it already wrote stay in the registers.
Sketch of correctness
Agreement. Within a round, two processes cannot both be flagged ✓ with different values. Each writes A before reading it, so whichever writes second sees the conflict. When a process commits v, every other process finishing that round either sees its ✓ or already holds v, so all of them move on with v and later rounds can only commit v. D and H only pass along values that processes already hold, and a crash just stops a process, so neither changes this.
Validity. A process only ever proposes its own input or a value it read from another process, so the decided value was always someone's input.
Termination. A process that runs alone eventually reaches a round nobody else has written to. It sees no conflict there and commits. While processes keep interleaving, nothing forces a decision (see Livelock).