DoomFormer: A 1993 Game Engine Computes Integer Neural Networks With Zero-Tolerance Exactness
A new open-source project has turned the DOOM physics engine into a verifiable integer computing substrate. DoomFormer compiles integer neural networks into ZDoom-format maps, where voodoo dolls (the duplicate player sprites the engine spawns for extra player-1 start points) execute each multiply-add by moving through corridors. Sector light levels and floor heights hold intermediate sums. Python reads every exposed value back from the running game and compares it against an independent NumPy integer implementation at zero tolerance: one value off by one ends the run.
The system is slow. At its default schedule, a single MNIST digit takes 163 seconds of real-time DOOM to classify. With the optimised schedule enabled, that drops to 8 seconds, still orders of magnitude slower than a CPU. The overhead is inherent: the engine was designed to render and collide, not to compute. What it offers instead is a verifiable proof that the arithmetic happened exactly as specified.
What runs inside DOOM
The primary demonstration is an MNIST classifier: 784 inputs, a 64-unit hidden layer, 45 pairwise score comparisons, and 10 output counters. The digit whose doll crosses the finish gate first lights a seven-segment display built from DOOM sectors. The integer network scores 97.16% accuracy on the full 10,000-image MNIST test set, against 97.58% for the float model it was quantised from.
On the first 100 test digits it classifies 99 correctly. Every classification is confirmed exact: the values DOOM computed match the NumPy integer reference for all 248 exposed intermediate values.
DoomFormer has also run inside DOOM:
- Transformers: a one-layer model trained on 136 official DOOM level names, and a two-layer model using 56,390 voodoo dolls across 106 maps, trained on 11,341 user-contributed level names
- A question-answering model: a two-layer transformer trained on 189 DOOM trivia facts, answering at about 11 minutes per response
- A SUBLEQ machine: a Turing-complete instruction set computer, including a self-modifying program
- On-device learning: a perceptron that updates its own weights inside the running level as DOOM’s dolls compute the gradient, learning to classify handwritten digits without ever leaving the game
- A fly-agent: a ship controller that reads sensor spikes from the level and fires thrust lines, with dolls picking every action
Verification
The exactness claim is backed by a full verification pipeline. Before each readout page, Python poisons the readout slots and requires the dolls to overwrite them before any values are read back. A fuzzer has run 13,000 random networks against the NumPy reference, comparing 1,987,632 intermediate values with zero mismatches.
A static extractor reads weight values back out of a compiled map without starting the game and compares them to the original network. A mutation harness makes single-line edits to compiled maps and checks detection: of 1,004 tested sites, 297 are correctly killed, covering all weight and sign classes.
The test suite verifies against ViZDoom, GZDoom, LZDoom, UZDoom, and Zandronum. GitHub CI runs 60 random networks on every push.
How the engine computes
The mapping from network to map is direct. A value corresponds to a group of dolls. A weight corresponds to a line special. An activation corresponds to a staircase. An attention mechanism corresponds to a corridor of ceiling height comparisons. Ablating a unit closes a door.
The compiler works around sharp engine edges: a sector mover refuses a second request while the first is still moving, so overlapping moves are sequenced. A teleport line cancels earlier line crossings in the same game tic, so circuits that would hit one are routed away. All maps stay within 32,000 units of the BSP origin to avoid sector-misfiling bugs present in ZDoom 2.8.1.
The 1993 id Software executable is not supported. DoomFormer requires ZDoom’s UDMF format and ACS scripting level, which means ViZDoom or a compatible port.
Related work
Computers inside DOOM maps existed before DoomFormer. A 4-bit counter built from voodoo dolls and conveyor belts dates to 2006. A Game of Life implementation runs in Boom-format maps. What DoomFormer adds is a compiler from integer networks to maps, a measured catalogue of engine behaviours that break numerical exactness, and the tolerance-0 verification against an independent reference. It is closest to translation validation as a method: proving each compile correct, not proving the compiler correct in general.
The project has no practical inference application. Its contribution is the demonstration that a game physics engine, with its deterministic voodoo doll movement and integer sector properties, can serve as a checkable arithmetic substrate for neural networks.