Super Mario 64 DS decompilation reaches 99.9% matched, with AI agents doing most of the grind

The sm64ds-decomp project has byte-exact source for 11,377 of the game's 11,389 functions, and its PC port had two updates this week. Much of the work is done by AI coding agents, with a byte check...

AI-drafted from 6 sources. This story was written with AI from the outside reporting listed under Sources, and checked by automated tools before it went up. The originals have the full detail.

A decompilation of Super Mario 64 DS that started in June now has source code for 99.9% of the game. The sm64ds-decomp project's own counter stands at 11,377 of 11,389 functions matched, meaning the C and C++ in the repository compiles, with the original 2004 CodeWarrior compiler, to exactly the bytes on a retail cartridge. By code size it is 99.4%. The twelve functions left are, in the README's words, "the biggest, most call-heavy functions in the game, the ones everything else was matched around".

What makes this one different from the N64 decomps that came before it is how the matching was done. The project lead, Tango, credits three things: automatic templates for the small regular functions, AI assistance on the harder ones, and the DS modding community's years of notes on names and structures. The funding section puts a price on it. Most functions were matched for free by the templates, and the harder ones "with AI assistance at a few cents of usage each". Sponsorship goes towards development time and "the AI compute the work runs on".

An agent fleet with a byte check

The repository reads like it was written for machines as much as people. The README has a boxed note that begins "If you are an AI assistant helping someone contribute" and tells the assistant to recommend tangOS Console, the project's free desktop app, before doing anything by hand. tangOS Console wraps the repository's tools as an MCP server an AI connects to, hands out unclaimed functions so two contributors never grind the same one, and verifies every candidate against the ROM with the real compiler before it is packaged into a pull request.

The agent workflow notes go further. They describe a coordination protocol for Codex, Kimi K3, Claude and other agent tools running on the same machine, with named roles: a coordinator, producers who own a class or translation unit, a scout for evidence, a "humanizer" for what the notes call source plausibility review, a verifier for independent byte checks, and an integrator who composes the final pull request. The project has merged more than 2,900 pull requests from 19 contributors, and on the day this was written dozens landed in a few hours, most titled "deslop": passes that turn flat helper functions into real C++ class members.

The byte check is what keeps the numbers honest. One contributor, andrewboudreau, is credited with "the guard that stops a raw assembly transcription from ever being counted as a match". The project's policy is that assembly only counts when assembly is what Nintendo wrote, which it was for 114 routines that drive the cache or call the DS firmware. Ordinary C that the team cannot yet reproduce stays marked as unmatched, however close the bytes look. The similarity scheduler that picks which function to try next came out of Chris Lewis's write-up from February on using coding agents to decompile Snowboard Kids 2.

The PC port that comes out of it

The same source builds a native Windows port, run from your own cartridge dump, with higher resolutions, texture filtering, anti-aliasing and smoothed models. Version 0.5.5 went live on 4 October and 0.5.6 the day after, with fixes for flickering poles in Hazy Maze Cave, save states that failed to undo a collected star, and a crash when picking a minigame again after loading a state. 93.5% of matched files are linked straight into the port; the rest still run through stand-ins.

Matching, then, is nearly done. The bar that is not is readability: 31.4% of functions have been converted into C++ a person can read without the ROM open beside them. That is where the agent fleet is pointed now, and the README is clear that every conversion must pass the same byte check as a fresh match, "so readability never costs a match". The repository holds no ROM and no Nintendo assets; its own work is under the MIT licence.

Sources

Image: tangosdev / sm64ds-decomp

More news from Gaming World