Recompilation vs emulation: what makes Leonida different

An emulator solves a problem of translation. A PlayStation 2 or a Nintendo 64 has a processor that speaks a language completely unlike a PC's, so an emulator has to read each foreign instruction and rewrite it while the game runs, and imitate every other chip in the console at the same time.

An Xbox Series console is not like that. Its processor is x86-64, the same instruction set a Windows desktop uses, and its graphics chip is AMD RDNA2, a relative of the RDNA2 graphics cards sold for PCs. The README sums it up: "The Xbox Series CPU is x86-64 like a PC, so the game's code is loaded and run natively, and the console's system software is reimplemented."

So Leonida does not translate the game's main code. It loads that code and lets it run. The work goes into the console-specific parts that a PC does not have.

An emulator Leonida
The game's processor code Interpreted or recompiled while the game runs Loaded and run natively
Console system software Imitated while the game runs Reimplemented as shims the game is linked to
Graphics programs Translated while the game runs Translated once, ahead of time, to SPIR-V
Translation of the game's processor code Yes, at run time None

The four pieces of the Leonida GTA 6 PC port

The README's "How it works" table breaks the project into parts. Four of them explain what Leonida is.

1. The version check. Before anything is built, every file in the game package is compared by name, size and SHA-256 hash with the one supported version, Xbox Series 1.0.2.1. The repository stores only those hashes. This check always runs first.

2. The shader pipeline. A modern console game ships its graphics work as shader programs, precompiled for one specific graphics chip. Leonida carves those programs out of the game's shader archive without its encrypted table of contents, unpacks them, disassembles them with LLVM and translates them to SPIR-V, the format that Vulkan drivers on a PC understand. The full set is 26,503 shaders, and all of them translate and pass validation.

One caveat depends on your graphics card. 23,841 of those shaders use 64-wide "wave" operations, which AMD hardware runs natively. NVIDIA and Intel hardware works with narrower waves, so Leonida emulates the wider behaviour there. The README calls that exact for compute and mesh shaders, and still approximate for some operations in other shader types.

3. The asset export. The game's models, textures and audio live in RPF archives. A tool named rpf9dump, built on an open-source decoder project called rpf9-explorer, finds the resources inside them and writes them out: models as OBJ files, textures as DDS images, audio banks as Ogg Opus or WAV. A scan of ten archives recovered 382,781 models.

4. The runtime. The runtime is a program called gta6rt. It maps the game's executable into memory the way Windows loads any program, then resolves every call the game makes to Xbox system software and points each one at a shim, a PC-side stand-in. Graphics calls go further: a layer converts Xbox D3D12 calls into Vulkan. Controllers work through a shim built on SDL3.

What a build involves

"The port isn't downloaded ready-made," the README says. "It's built on your PC from your own copy." This site does not give build instructions. The README is the only document to follow, and it changes from day to day. In outline, the build script make_game.py runs four stages:

  • Check, which always comes first.
  • Shaders, the longest step for the processor, which translates the 26,503 shaders across several worker processes.
  • Assets, the largest on disk. One assets export measured about 337 GB before its audio step and took about 2 hours 35 minutes.
  • Runtime, which builds the loader and the Vulkan layer.

A full build needs about 400 GB of free space. A smaller run that leaves out the asset tools needs about 30 GB. The project also ships a PC checker that compares your processor, graphics card and memory with two reference profiles: one equivalent to an Xbox Series X, and one it describes as a "1080p Low" community estimate.

Who writes the Leonida code

The repository is organised for contribution by AI coding agents as much as by people. It ships an AGENTS.md file headed "Guide for coding agents". Its rules require each task to be claimed in a public "Coordinating who works on what" issue before a pull request is opened. Three hard rules recur in its documents: no game data, ever; no keys, decryption or protection workarounds; and nothing online, meaning no Xbox Live or Rockstar services.

Why "static recompilation" is the name

In compiler language, "static" means done ahead of time rather than while a program runs, and "recompilation" means taking code that was already compiled and translating it again for a different target. Leonida fits the first half exactly: its shaders are translated once, before the game ever starts. Strictly speaking, the game's own processor code is not recompiled at all, because nothing needs to be. It is already native.