Tombstone
Play Workspace
Oct 2014 – Dec 2014 · age 32
What it was
Server infrastructure meant to make asynchronous multiplayer games easy to build. It had three tiers. A browser page opened a websocket to a Java gateway on Netty; the gateway piped frames to a C++ server on libuv; the server held one JSON document per game channel, with a transaction log, snapshots and subscribers. Moves were a small transaction language of puts, moves, math, sorts, shuffles and tabletop dice rolls. Every frame was eight command letters, a length and a checksum written as lowercase base-26 letters, and a body, and the same encoder existed in C++, Java and JavaScript. The core library was complete and tested by 113 cases; the server stayed a prototype with memory bugs; the gateway served three toy games, including a field of bouncing bunnies.
Wins, for the age
- At thirty-two, Jeff made random and order-dependent transactions "stabilize" into plain puts and deletes before broadcast, so every client could replay a deterministic log without knowing the seed. That came two years before Colyseus (2016).
- Found on their own what Redis had found with snapshots plus an append-only file: the oldest document plus the log equals the latest, and a late subscriber gets the snapshot, then the tail.
- Wrote homemade leak-counting macros and asserted on them 107 times. In 2014 the tooling this mammal wanted was mostly tooling they had to write.
- Built one protocol three times in three languages, and the lockstep itself became a test.
What it taught
- Writing the protocol three times finds bugs a spec would hide: the JavaScript encoder divided without flooring, and only a side-by-side reading showed it.
- Ownership across a C library boundary needs one written rule. Buffers were allocated one way and freed another.
- Deleting an object inside a callback its caller is still iterating is a use-after-free, however tidy it looks.
- For one person, a C++ core, a Java gateway and a JavaScript client is two languages too many.
Genealogy
Ancestors: Async Serialization: length-prefixed frames pushed down a socket. Evolution eXPeriment: an early client-server game with a long-running server. Zen Net: a game server with games loaded as plugins. Znetfs: framed peer protocols built by hand. Descendants: Adama Core: a document plus deltas and deterministic replay. Career Facebook: pub/sub fan-out of live state, at scale. Lamancha II: per-game documents, logs and server-side randomness.
Epitaph
It framed every move in lowercase letters and settled every shuffle before telling anyone, then freed its players with the wrong allocator. The settling was the idea that lived.