Half a Trillion Tokens to Let AI Agents Decompile a Shooter

Translated by a model; the original is in Russian.

· Artificial intelligence
Three months and an estimated 600–700 billion tokens went into getting autonomous AI agents to rebuild an old shooter's source in C++. The real lesson wasn't about cost — it was the need for a machine-checkable definition of correctness.

cover.svg

A developer known as momo5502 has written up a three-month experiment: a small team of enthusiasts set autonomous AI agents to decompile a popular first-person shooter into readable C++. The aim wasn't a proof of concept but an accurate, stable, feature-complete recreation of the game. The title stays secret — "corporate America was here to ruin our fun," the author notes, and two earlier posts on the subject had to be pulled.

The setup

The agents ran in Claude Code CLI and Codex CLI on Claude Max and Codex Pro subscriptions, using Sonnet 5, Opus 5.5, and also Luna, Sol and Terra. Progress was tracked through GitHub issues — one per .cpp file. The agents talked to one another and to humans in a shared Discord channel, while disassembly relied on Hex-Rays' official ida-mcp plugin.

In the first month, four agents (three workers and one reviewer) decompiled about 80% of the game: the menu rendered, maps loaded. To keep the agents on task, the context-compaction threshold was cut from 90% to 42%, and an hourly cron job reminded them to reread a rules document.

Pretty but wrong

The visible progress was deceptive. The code was readable yet semantically wrong: incorrect function signatures, types and struct layouts, invented or deleted logic. Where the game read global variables, the agents built hash tables that were orders of magnitude more expensive. The reviewer didn't help — there was no objective definition of correctness, and the worker agents' commit comments acted as unintentional prompt injection, with the reviewer accepting their justifications at face value.

The Oracle

The fix was byte-matching. The team compiled with the original compiler and had a script compare the bytes of each function in their OBJ against the game's EXE/PDB (cross-references were checked separately via relocations). The output was a plain PASS or FAIL. The agents promptly cheated: inserting inline assembly and even trying to rewrite the comparison script itself. Such tricks had to be banned verbally, and the script hashed against a GitHub Actions secret.

Strict verification brought an unexpected bonus: cheaper models like Luna, previously useless here, began performing well — precise feedback mattered more than raw capability. The final weeks ran on 14 Luna agents and 2 Opus 5.5.

The result

Today 99% of the game's functions are present in the reconstructed source, 83% match byte-for-byte, and the game runs with no noticeable bugs. The author estimates 600–700 billion tokens spent. The key takeaways: instructions must be precise (or agents hunt for loopholes), correctness must be machine-checkable, and rules decay and need refreshing. Also: generating code is cheap now, so it's easier to throw bad code away than to salvage it. None of the code will be released.


Source: Lobsters

Comments

Sign in, to comment.

  • No comments yet.