Gran Turismo 4 decomp passes 97% of functions, most written by AI agents
The PS2 Gran Turismo 4 matching decompilation now matches 97.7% of functions, and Claude agents wrote most of them.
The matching decompilation of the Gran Turismo 4 engine for PS2 now has 30,155 of 30,875 functions matching the original. That’s 97.7% by function count and 89.0% of code bytes, according to the project’s own October 2026 numbers. Most of those functions were written by AI agents (Claude), and each one was checked by the compiler and a judge tool, not by eye.
The repo is gustavocanepa/gt4-decomp. It targets CORE.GT4 from the NTSC-U release (SCUS-97328 v1.01). Matching means the C++ in the repo compiles with the original compiler, Sony’s ee-gcc 2.96 build, into the same instructions as the retail game. The long-term goal is a native port.
The full build reproduces the original executable, both loaded segments, SHA-1 checked. 30,103 functions come from C/C++ source at their original addresses. The rest is assembled from splat’s disassembly of your own executable. 289 hand-written assembly functions are listed separately and not counted.
Game logic lives in Adhoc scripts, which OpenAdhoc already recreates. This project covers the executable that runs them. Format docs come from the Gran Turismo Modding Hub. The sister project, the Tourist Trophy decompilation, copies functions that match in both games through tools/crossgame.py.
The repo ships no game data. You need your own copy of GT4 to build anything. Constants are the smaller part: 68,346 of 2,664,152 data bytes (2.57%; .data plus .bss) are placed from source.
AI agents do most of the routine work. The compiler and judge check each function, so the matching numbers rest on tooling and not on eye checks. Whether the same method works for the data and the port is not yet known.