Grand Theft Auto IV's engine, being rewritten in Rust one function at a time by AI agents, for 64-bit Windows, Windows on ARM and macOS. Contains no game code or assets.
FAQ (answers come from our records)
How do I install it?
We did not find an install command for this repository (our install coverage is only about 4%). Check its README or releases page.
Who is it for?
We filed it under these tags: 开源项目. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository monstercameron/LibertyFlux;first catalogued 2026-10-12;last seen 2026-10-12。There is no official certification or quality rating here — we record sources and dates only.
LibertyFlux
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Grand Theft Auto IV's engine, rewritten in Rust one function at a time, so the game can run as a
native 64-bit program on Windows, Windows on ARM and macOS.
**Project site: monstercameron.github.io/LibertyFlux**,
with the changelog and the
devlog.
> **Status: phase 3, rewriting.** The executable has been measured, the work queue and the checker
> are running, and agents are rewriting game functions in Rust. The badges above are generated from
> machine counts on every update. Every verified rewrite so far has been proven one function at a
> time against the original; none has yet run inside the game, which is the next gate.
Buy the game
LibertyFlux is not a way to get Grand Theft Auto IV for free, and it never will be. It contains none
of the game: no executable, no data, no assets. To use it you need a copy of the game that you paid
for.
- Buy it on Steam, from an authorised key seller, or
from a retailer.
- Do not use a pirated or cracked copy. This project does not support them, and issues about them
will be closed without an answer.
- This project will never distribute game files, keys, cracks or ways around the game's copy
protection. Contributions that do will be rejected.
The people who made the game should be paid for it.
Contents
- Buy the game
- Why
- Goals
- How it works
- What "verified" means, and what it does not
- What is in the repository, and what never is
- Roadmap
- Tracking progress
- Tools
- Repository layout
- Working on it
- Questions
- Projects this builds on
- Licence
- Legal
Why
The PC version of GTA IV is a 32-bit Direct3D 9 program from 2008. It submits draw calls on one
thread, ties parts of its physics and scripting to the frame rate, and misbehaves above 60 frames
per second. Community patches fix a great deal, but they cannot change what the program is.
A full rewrite can. Once every function has a Rust replacement, the engine can be built for 64-bit
processors, given a modern renderer, and taken to platforms the original never ran on.
Goals
| Platform | Graphics | Upscaling |
|---|---|---|
| Windows x64 | Vulkan, with Direct3D 12 optional | DLSS, FSR, XeSS |
| Windows on ARM | Vulkan | FSR |
| macOS on Apple silicon | MoltenVK, then native Metal | MetalFX |
The research behind this table, with links to each vendor's SDK and guides, is in
documentation/upscaling-and-frame-generation.md.
None of the following exists yet. These are the reasons for doing the work.
| What the rewrite makes possible | Detail | When |
|---|---|---|
| Hundreds of frames per second | The simulation runs at a fixed rate and the renderer draws as fast as the hardware allows, so physics and scripts behave the same at any speed | Phase 6 |
| Modern upscaling and frame generation | DLSS, FSR, XeSS and MetalFX behind one setting; the renderer is designed to produce the motion and depth data they need | Phase 7 |
| Path tracing | Bounced light, reflections and soft shadows | Stretch goal, after the new renderer |
| Native on three platforms | 64-bit Windows, Windows on ARM and macOS, with no emulation layer | Phases 5 and 6 |
| New gameplay and graphics | Any part of the engine can change: new mechanics, denser streets, longer draw distances, engine-level mods | Phase 7 |
| Nothing extra to install | No .NET, no launcher, no Visual C++ or DirectX runtime packages | Phase 5 |
| Old bugs become tests | The community's list of high-frame-rate bugs is the checklist the new simulation has to pass | Phase 6 |
How it works
AI agents do the rewriting. A machine check, not an agent's opinion, decides when a function is
finished.
1. **Measure.** Ghidra analyses the original program. Functions are counted, library code is set
aside, and class names are recovered from the type information the compiler left behind.
2. **Queue.** A script orders the functions from easiest to hardest and hands them out one at a
time. Agents never choose their own.
3. **Rewrite.** An agent studies the function's behaviour, with the nearest already-finished
functions as reference, and writes a Rust implementation.
4. **Compare.** The original function and the Rust version run side by side in a small 32-bit test
process, from the same inputs and starting memory. Their results, memory writes and outgoing calls
must agree.
5. **Swap in.** Accepted functions are loaded into the original game with an on/off switch each. If