← The Collapser · Problem pages
Desync debugging for lockstep games
What causes a lockstep desync — and why is it so hard to find?
A lockstep desync means one peer's simulation diverged from the others' — and lockstep gives you no state to inspect, only the divergence. The causes are a short list: nondeterministic iteration, platform float differences, a draw taken from a shared stream in different order, or state mutated outside the tick. Finding which one is the debugging problem.
Why lockstep hides its own evidence
Lockstep's bargain — every peer simulates identically, only actions cross the wire — is why Factorio's developers have documented desync as their named enemy since Friday Facts #76: their wiki's Desynchronization page states the requirement flatly, that all players need to simulate every single tick identically, and a later Friday Facts is titled, in full, "Bug, Bug, Desync." The structural problem is that divergence compounds: a one-draw difference at tick 400 is invisible until it surfaces as a different battle at tick 40,000, and the architecture that makes lockstep cheap — no state transfer — means there is no state to diff at the moment it matters. The bug reports that result are the segment's folklore: a shipped automation game's own public board carries the open card "Fix non-deterministic ducts — duct merging behavior is undefined, leading to full ducts of a resource line causing desyncs," and a strategy studio's modding documentation teaches its modders, as public doctrine, to use one shared seeded context and never the platform's random class in simulation code. Everyone in this segment is fighting the same five channels listed in same seed, different result — with worse lighting.
The debugging surface is a record, not a replay file
The The Collapser's shape attacks the evidence problem rather than the symptom. If the simulation's inputs are a committed record — founding facts plus an append-only log — and every draw is addressed (record hash + domain + subject), then any run can be re-derived offline, exactly, on a developer's machine, as many times as the bisection needs. Each derivation carries a manifest and a hash; two runs that disagree can be compared derivation by derivation, and the first differing hash is where the simulations parted — the cause's neighbourhood, not the symptom's. The proof ledger is that comparison surface, kept as a routine: verify any claim, audit a sample, replay a whole history. A mismatch burns the claim's key and says so, so the debugging instrument cannot quietly become a second source of false confidence.
For multiplayer records specifically, the engine's answer to "whose fact counts" is an institution, not a function: a single append authority where the first committed claim stands and a refused claim is itself recorded, naming the claim that beat it. Contested history becomes a ledger question with a checkable answer.
The honest limit
This is a derivation layer, not a netcode stack. It does not ship lockstep transport, NAT traversal, or input-delay machinery — a live multiplayer game still needs its own networking, and the multi-writer authority tier is production work behind the engine's pilot gate, not part of the prototype. What the layer changes is the debugging: from "a player reported a desync in a two-hour session nobody can reproduce" to a record, a bisection, and a first differing draw.