[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107557":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":21,"topics":22,"createdAt":10,"pushedAt":31,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":35,"discoverSource":36},107557,"doomformer","mottopanikeiku\u002Fdoomformer","mottopanikeiku","Compile neural networks into DOOM maps, where voodoo dolls do the arithmetic","https:\u002F\u002Fmottopanikeiku.github.io\u002Fdoomformer\u002F",null,"Python",62,2,1,0,6,42.03,"MIT License",false,"main",true,[23,24,25,26,27,28,29,30],"compiler","doom","esoteric-computing","mnist","neural-networks","transformer","vizdoom","voodoo-dolls","2026-11-02 23:11:46","2026-11-15 14:35:48","\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\u002Freleases\u002Fdownload\u002Fv0.4.0\u002Fbanner_wide.png\" alt=\"DOOMFORMER: the marine fights a horde of demons under a hellish sky\" width=\"100%\">\n\u003C\u002Fp>\n\n# Doomformer\n\nDoomformer compiles integer neural networks into DOOM maps, where voodoo dolls do the arithmetic. A doll that crosses a line adds that line's weight to a light level or a floor height.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\u002Freleases\u002Fdownload\u002Fv0.1.0\u002Fdrawpad.gif\" alt=\"The marine draws a 7 on the floor. Voodoo dolls run the network and light a 7 on the display.\" width=\"720\">\n\u003C\u002Fp>\n\nThe marine draws a 7 on the floor and presses READ, and 1,355 voodoo dolls in the same map run an MNIST network and light the answer. I also ran the whole 10,000-digit test set through DOOM, split into four tile maps with Python passing values between them, and it got 97.2% right while every value the game computed matched the NumPy integer reference.\n\nThe films are on the [project page](https:\u002F\u002Fmottopanikeiku.github.io\u002Fdoomformer\u002F), the guides start at [docs\u002F](docs\u002FREADME.md), and there is a [Colab notebook](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fmottopanikeiku\u002Fdoomformer\u002Fblob\u002Fmain\u002Fexamples\u002Fdoomformer_colab.ipynb) if you'd rather not install anything.\n\n## Install\n\nPython 3.11+ on Linux or macOS, plus git, cmake, make and a C\u002FC++ compiler (the first run builds ACC, the level-script compiler).\n\n```sh\npip install git+https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\ndoomformer doctor\ndoomformer hello\n```\n\n`hello` compiles a small MLP into a map, runs five inputs through it and prints `5\u002F5 EXACT`, and it needs neither a game window nor a copy of DOOM because ViZDoom ships the free Freedoom assets.\n\n## Draw a digit\n\n```sh\ndoomformer draw --digit 7\n```\n\nThe marine holds FIRE to ink a 28×28 floor canvas and then presses READ. The whole network lives in that one map, and the winning digit's doll crosses the line that lights the display. Without `--digit`, `doomformer draw` lets you walk and draw yourself, which needs a display.\n\n| MNIST test run | Correct | Exact |\n|---|---:|---:|\n| First 100 digits, one map | 99 \u002F 100 | 100 \u002F 100 |\n| 1,000 sampled digits, one map | 966 \u002F 1,000 | 1,000 \u002F 1,000 |\n| All 10,000 digits, four tile maps | **9,716 \u002F 10,000** | **10,000 \u002F 10,000** |\n\nA digit counts as exact when all 248 values DOOM exposes for it equal the integer reference. The float version of the network scores 97.6%, so rounding it to integers costs under half a point, and the logs are in [models\u002Fmnist\u002FEVAL.md](models\u002Fmnist\u002FEVAL.md).\n\n`doomformer draw --build drawpad` writes the same map to `drawpad\u002Fdrawpad.wad`, or you can download [drawpad.wad](https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\u002Freleases\u002Fdownload\u002Fv0.7.2\u002Fdrawpad.wad) (85 MB). It plays in GZDoom with Freedoom and no Python (`gzdoom -iwad freedoom2.wad -file drawpad.wad`), so you can ink the canvas, press READ yourself and watch the display light up about eight seconds later.\n\n## Play the museum\n\nGrab [museum.wad](https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\u002Freleases\u002Fdownload\u002Fv0.7.1\u002Fmuseum.wad) and [Freedoom](https:\u002F\u002Ffreedoom.github.io\u002Fdownload.html), then:\n\n```sh\ngzdoom -iwad freedoom2.wad -file museum.wad\n```\n\nStep on seven floor pads to draw a digit and press READ, and a hand-written network of 136 voodoo dolls lights the answer. When you press MUTATE, one connection flips from +1 to −1 and the same 7 reads as 1 until RESTORE puts it back. The map runs without Python, and its self-test passes in GZDoom, LZDoom, UZDoom and ZDoom 2.8.1.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\u002Freleases\u002Fdownload\u002Fv0.7.1\u002Fmuseum_mutate.png\" alt=\"Before and after rewiring one connection: a doll that passed its gate now stops, changing the answer from 7 to 1.\" width=\"800\">\n\u003C\u002Fp>\n\n## How it works\n\nA voodoo doll is an extra player body in the map that conveyor belts push across lines that change the level, and the compiler arranges those lines and sectors into a network.\n\n| Network | Map |\n|---|---|\n| A value of 5 | 5 voodoo dolls |\n| A weight | A line on the floor; each doll that crosses it adds the weight |\n| A sum | A sector's light level or floor height |\n| An activation (ReLU) | A staircase of gates the dolls must climb |\n| Attention | Dolls squeezing under ceilings that another value lowered |\n| A lesion | A closed door |\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd width=\"50%\" valign=\"top\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\u002Freleases\u002Fdownload\u002Fv0.1.0\u002Fcrossbar.png\" alt=\"Voodoo dolls crossing weight lines\">\u003Cbr>A matrix multiply: each crossing adds a weight.\u003C\u002Ftd>\n\u003Ctd width=\"50%\" valign=\"top\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\u002Freleases\u002Fdownload\u002Fv0.1.0\u002Fride.png\" alt=\"Voodoo dolls under attention ceilings\">\u003Cbr>Attention: counting the dolls that fit under a ceiling multiplies two values.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\nACS level scripts write inputs, move gates, rewind dolls and copy results out, while Python reads the light levels and heights and raises an error when one differs from NumPy. The tests also break weights and timing on purpose to make sure that check notices.\n\nOn a shared 16-core arm64 Linux machine, one pass of a 12-16-6 toy network takes 726 ms in DOOM, from writing the inputs to reading the results back, against 11 µs in NumPy, but in exchange you can walk around inside it and shut doors on its neurons. The maps use ZDoom's UDMF format and ACS scripts and run in ViZDoom 1.3.2.\n\nDoom computers go back a while: [counter.wad](https:\u002F\u002Fwww.wad-archive.com\u002Fwad\u002F8d0de31d8b392fc2d7fd817e933b3cf43bca799a) counts with voodoo dolls, [conway.wad](https:\u002F\u002Fgithub.com\u002Fpwiecz\u002Fconway.wad) runs Game of Life, and [Danny Spencer's calculator](https:\u002F\u002Fgithub.com\u002Fnukep\u002Fdoom-calculator) adds. Doomformer compiles neural networks onto the same machinery, and the pages on [how it works](docs\u002FHOW_IT_WORKS.md), [verification](docs\u002Fverification.md) and [related work](docs\u002Frelated_work.md) go into the details.\n\n## His brain is the level\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fmottopanikeiku\u002Fdoomformer\u002Freleases\u002Fdownload\u002Fv0.1.0\u002Fhero.gif\" alt=\"The marine fights a demon while 1,345 voodoo dolls run his policy transformer in the same level\" width=\"720\">\n\u003C\u002Fp>\n\nThe level senses the nearest demon, and then 1,345 voodoo dolls run the marine's policy transformer, which picks an action, turns him and fires. Python only advances the clock and reads results, and all 50 decisions in the film match the integer reference of a policy that learned to copy a scripted aimbot.\n\n```sh\npython -m demos.brainlevel   # from a clone\n```\n\nThe demons pause while he thinks, because one decision takes 22 seconds of game time at `--opt 3`, and when they keep moving (the `--live` flag) they kill him before he can act.\n\nThe other films show a transformer naming a level, a marine playing that level, a perceptron learning inside one game and a fruit-fly circuit driving the marine. They are picked runs, so [docs\u002FDEMOS.md](docs\u002FDEMOS.md) names each film's seed and has the tables over all evaluated seeds.\n\n## Build your own\n\nThe dolls run both layers of this small network, which computes AND and OR, and Python checks every value.\n\n```python\nimport numpy as np\nimport doomformer as df\n\nnet = df.MLP(\n    weights=[np.array([[1, 1], [1, 1]]), np.array([[1, 0], [0, 1]])],\n    biases=[np.array([-1, 0]), np.array([0, 0])],\n    thresholds=[np.array([1]), np.array([1])],\n    signed_input=False,\n)\nwith df.compile(net) as brain:\n    for x in ([0, 0], [1, 0], [1, 1]):\n        print(x, \"->\", brain(np.array(x)).tolist())\n```\n\n`df.MLP.from_torch` imports a PyTorch network, and the compiler handles integer MLPs, spiking nets and transformers (softmax and RMSNorm included, no LayerNorm). The `world` and `actions` hooks wire outputs to doors, lights and thrusts, `brain.record(...)` films the dolls computing, and the [build guide](docs\u002FBUILD_YOUR_OWN.md) and [examples](examples) are the place to start.\n\nTo hack on it, run `pip install -e \".[test,train]\"` and then `pytest -q tests`. Most tests boot real headless DOOM games, so new compiler behavior needs a test that runs in DOOM too.\n\n## License\n\nCode and docs are [MIT](LICENSE), while data and assets keep their own licenses, including CC BY-NC 4.0 for the FlyWire circuits ([THIRD_PARTY.md](THIRD_PARTY.md)). DOOM is a trademark of id Software \u002F ZeniMax, and this project is not affiliated with them.\n","Doomformer 是一个将整数神经网络编译为 DOOM 游戏地图的编译器，利用游戏内机制（如 voodoo dolls 触发线触发器）执行算术运算。其核心功能包括：将 MNIST 分类等轻量级神经网络映射为可运行的 WAD 地图；支持输入手绘数字并实时推理；通过光级\u002F地板高度编码权重与激活值；完全基于整数运算，结果与 NumPy 参考实现逐值一致。项目采用 Python 实现，依赖 ViZDoom 模拟环境，无需真实 DOOM 授权即可验证。适用于计算理论教学、非常规计算演示、神经网络可视化及复古游戏编程实验等场景。","2026-11-24 04:32:15","CREATED_QUERY"]