[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111119":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":9,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},111119,"mkw-recomp","adriadam10\u002Fmkw-recomp","adriadam10","Static recompilation of Mario Kart World (Nintendo Switch 2) to a native PC program",null,"C",1747,127,16,231,0,53,397,1451,244,104.27,"MIT License",false,"main",[],"2026-11-23 16:50:25","2026-11-23 20:31:05","\u003Cp align=\"center\">\u003Cimg src=\"docs\u002Flogo.svg\" width=\"128\" alt=\"mkw-recomp logo\">\u003C\u002Fp>\n\n# mkw-recomp\n\nA static recompilation of *Mario Kart World* (Nintendo Switch 2, versions 1.0.0 and 1.8.0) into a native PC program for Linux and\nWindows. It needs your own copy of the game, dumped from your own console: nothing of the game is in this repository\nor in its releases.\n\n**It is a recompilation, not an emulator.** The game's AArch64 code is translated to C ahead of time and compiled\nfor the PC's CPU (x86-64, or AArch64 on Linux); there is no CPU interpreter or JIT. The GPU is not emulated either:\nNVN2, the Switch 2 graphics API, is reimplemented on top of Vulkan at the API level, and the game's SM86 shaders are\ntranslated to SPIR-V ahead of time. Nintendo SDK functions (`nn::*`) are replaced by name with our own code.\n\n## Status\n\nEarly, and moving fast. On 12\u002F11\u002F2026:\n\n- It boots, plays the intro movies, goes through the menus and races, on Linux and on Windows (x86-64), and on Linux\n  on AArch64 (its own AppImage; tested on an Adreno 740 handheld).\n- The start screen sets the game up from your copy on your machine (generates and compiles the C, translates the\n  shaders, warms up the pipeline cache) and holds every setting: display, graphics quality, controls, hacks.\n- Races run at 60 fps on high-end GPUs and at 30 on mid-range ones; see [Performance](#performance).\n- Known problems: a few menus (mode, character and vehicle select) still need work, the kart's shadow misses a frame\n  now and then, some audio cuts during movies, and on some AMD drivers the GPU can hang. There is no online play.\n\n## Roadmap\n\nThe main open work, in order; the details are in [docs\u002Froadmap.md](docs\u002Froadmap.md).\n\n- **60 fps in races.** Today a race frame is a serial chain: the game finishes its frame (~3 ms\\*), then the Vulkan\n  back end records the game's big submit (~19 ms\\*), then the GPU runs it (~10 ms\\*), and only then does the next frame\n  start.\n  Recording is on the critical path, so the work is recording with less CPU: dynamic state only when it changes, draw\n  caches across frames, parallel recording, and a faster game thread.\n- **The picture as on the console**: the last shader translator bugs, the kart's shadow, push constants, zero Vulkan\n  validation errors.\n- **Every menu checked** against the console: mode, character and vehicle select are next.\n- **No GPU hangs** and less GPU memory, then loading without stutter and a Linux package for non-rolling distributions.\n- **1.8.0 on par with 1.0.0**: its ultrawide aspect, shadow map size and fixed seed ([#19](https:\u002F\u002Fgithub.com\u002Fadriadam10\u002Fmkw-recomp\u002Fissues\u002F19)).\n\n\\* Measured on 09\u002F11\u002F2026 on our test machine: Radeon 660M APU (Ryzen 5 7535HS), Linux, 720p internal resolution.\n\n## Performance\n\nMeasured frame times, each with its date, are in [docs\u002Fperformance.md](docs\u002Fperformance.md). To add your machine,\nopen a [performance report](https:\u002F\u002Fgithub.com\u002Fadriadam10\u002Fmkw-recomp\u002Fissues\u002Fnew?template=performance.yml): it goes\ninto the table with the date of the report. The times are the game's own frames: frame generation shows more frames\nbut does not shorten them. 16.7 ms is 60 fps; Frame rate on Automatic (the console's) drops to 30 fps when 60 is out of\nreach, and a frame over 33.3 ms runs the race slower than real time.\n\n| Date | GPU | Internal resolution | Race fps | Race frame time |\n|---|---|---|---|---|\n| 11\u002F11\u002F2026 | RX 7900 XTX (Windows) | 2160p | 60 | 16.7 ms |\n| 11\u002F11\u002F2026 | RX 9070 XT (Linux, RADV) | 720p to 2160p | 60 | 16.7 ms |\n| 10\u002F11\u002F2026 | RTX 3060 (Windows) | 1080p | ~48 | ~21 ms |\n| 11\u002F11\u002F2026 | RTX 3050 Laptop (Windows) | 720p | ~37 | 26.7 ms |\n| 09\u002F11\u002F2026 | Radeon 660M (Linux, RADV) | 720p | 30-32 | 31-33 ms |\n| 11\u002F11\u002F2026 | GTX 1650 SUPER (Windows) | 1080p | ~24 | ~41 ms |\n| 09\u002F11\u002F2026 | GTX 1050 Ti (Windows) | 1080p | 22-24 | 42-45 ms |\n\n## Playing\n\n![The start screen once the game is set up](docs\u002Fimages\u002Flauncher-main.png)\n\n![The Game files page, where the setup takes the player's dump](docs\u002Fimages\u002Flauncher-files.png)\n\n1. Dump Mario Kart World 1.0.0 or 1.8.0 from your Switch 2 (`exefs\u002F` and `romfs\u002F`, decrypted; 1.8.0 with the update\n   merged into the base game's RomFS), or the same dump packed as one `.nup` or `.nx` file.\n2. Download the launcher for your system from [Releases](https:\u002F\u002Fgithub.com\u002Fadriadam10\u002Fmkw-recomp\u002Freleases): on Linux\n   the `.AppImage` (`-aarch64` on ARM; it keeps the game it builds in `~\u002F.local\u002Fshare\u002Fmkw-recomp`; glibc 2.31 or newer: Debian 11,\n   Ubuntu 20.04, SteamOS and later), on Windows the `.zip`, unpacked into a folder. Either needs about 30 GB free.\n3. Run the AppImage (`chmod +x` first) or `mkw.exe`, open **Game files**, point it at your dump (**Choose folder** or\n   **Choose .nup or .nx file**) and press **Set up**.\n   The first setup takes a while (it compiles the whole game and downloads NVIDIA's `nvdisasm` and `ptxas`, 84 MB on\n   Linux and 126 MB on Windows, to describe the shader encoding on your machine); after that, **Play**.\n4. When a newer release is out, the start screen offers it (**Update to vX**): it downloads it, checks it, replaces\n   the program and sets up again only what changed. **Settings → Menu → Check for updates** turns the check off.\n\nRequirements: x86-64 CPU with AVX2 (or, on Linux, AArch64 with ARMv8.2: LSE, FP16, RCpc, DotProd,\nCRC32), a GPU with Vulkan 1.3 (`VK_EXT_mesh_shader` recommended; without it, task and mesh shaders run as compute),\n16 GB of RAM recommended.\n\n## Extra features\n\nBeyond the console, all optional and off (or at the console's value) by default:\n\n- **Display**: internal resolution above or below the console's, 21:9 and 32:9 (races show more at the sides), AMD FSR 1 scaling, HDR on HDR\n  screens, VSync, mailbox or immediate presentation.\n- **Frame generation**: frames made between the game's (a race at 30 fps shown at 60, or at 240 on a 240 Hz screen).\n  Smoother, not faster: the picture is up to one frame later, and fast motion and the minimap can smear.\n- **Graphics**: texture filtering and quality, detail distance and shadow quality above or below the console's.\n- **Sound**: 5.1 surround.\n- **Controls**: every key and button rebindable, mouse camera, Nintendo, Xbox or PlayStation button icons, motion\n  steering, vibration strength; local multiplayer with one controller each.\n- **Hacks**: turbo (hold or toggle F2), skip movies, unlock everything, the same randomness every time, straight to\n  time trial or free roam.\n- **Languages**: the menus in 19 languages; the game itself also in Catalan, Galician and Basque.\n- **Game files**: a dump as folders or as one `.nup` or `.nx` file, used where it is; updates from the start screen.\n- **Performance overlay** (FPS, or CPU, GPU and memory in full) and a one-click system info for bug reports.\n\n## Building from source\n\nLinux, with `uv`, `clang`, `lld`, `ninja`, SDL3, Opus, libvpx, zstd, xxHash, the Vulkan headers and VMA 3.4.0 (details in\n[tools\u002Fbuild\u002FREADME.md](tools\u002Fbuild\u002FREADME.md)). Put your dump in `game\u002F` (`game\u002Fexefs`, `game\u002Fromfs`) or set\n`MKW_GAME=\u003Cdir>`, then from the repo root:\n\n```sh\nuv run python recomp\u002Fgen.py --exefs game\u002Fexefs --out build\u002Fgenerated --jobs 8 --patches recomp\u002Fpatches-mkw.txt  # 1.8.0: patches-mkw-180.txt\nuv run tools\u002Fshaders\u002Fextract.py && uv run tools\u002Fshaders\u002Ftranslate.py\nuv run tools\u002Fbuild\u002Fbuild.py              # build\u002Fmkw; --target windows builds mkw.exe with llvm-mingw\nbuild\u002Fmkw\n```\n\nFrom a packed dump (`.nup`, `.nx`) and for Linux on AArch64: [tools\u002Fbuild\u002FREADME.md](tools\u002Fbuild\u002FREADME.md#a-packed-dump)\nand [its AArch64 section](tools\u002Fbuild\u002FREADME.md#linux-aarch64).\n\nTranslating the shaders needs the SM86 encoding specification, generated from NVIDIA's `nvdisasm` (not shipped):\nsee [tools\u002Fshaders\u002FREADME.md](tools\u002Fshaders\u002FREADME.md). Everything generated goes to `build\u002F`, never to git.\n\n| Folder | Contents |\n|---|---|\n| [recomp\u002F](recomp\u002FREADME.md) | The generator: AArch64 → C |\n| [runtime\u002F](runtime\u002FREADME.md) | What plays the console: kernel, memory, SDK replacements, NVN2 over Vulkan, audio, input, menus and launcher |\n| [sm86\u002F](sm86\u002FREADME.md) | The shader translator: SM86 SASS → GLSL → SPIR-V |\n| [i18n\u002F](i18n\u002FREADME.md) | The menu, start screen and setup texts in every language (gettext `.po`) |\n| [tools\u002F](tools\u002FREADME.md) | Analysis, setup, build, game runs and diagnostics |\n| [tests\u002F](tests\u002FREADME.md) | Tests without the game or a GPU, in the CI on Linux and Windows |\n| [docs\u002F](docs\u002FREADME.md) | Research, sources and performance |\n| `.github\u002F` | CI, issue and pull request templates |\n\nAt the root: `pyproject.toml` and `uv.lock` (the Python environment of the tools), `.gitignore`, `LICENSE`,\n`CONTRIBUTING.md`, `CHANGELOG.md` (each release's changes, its notes), `AGENTS.md` (a guide for coding agents),\n`.agents-clean` and `.agents-heavy` (what an agent's tooling cleans up and runs under a resource cap here).\n\n## Design decisions (30\u002F10\u002F2026)\n\n| Topic | Decision | Why |\n|---|---|---|\n| CPU | AArch64→C lifter based on [totk-pc-recomp](https:\u002F\u002Fgithub.com\u002Fvalentderah\u002Ftotk-pc-recomp)'s (MIT), extended to ARMv8.1-8.3: LSE atomics, CAS, LDAPR; PAC as identity, MTE tags as 0 | Same engine family as MKW, and it already scales to a large executable |\n| System | The SDK's `nn::*` functions replaced by name; signatures from the mangled names of `main`'s 1 289 imports | No console services to emulate |\n| Graphics | NVN2 over Vulkan: 529 of its 699 functions share their name with NVN1 (signatures known from totk-pc-recomp and nxnative); 170 are new | Recompilation, not GPU emulation |\n| Shaders | Our own SM86→SPIR-V translator, offline, with a decoder generated from the DocumentSASS \u002F nvsass-disassembler specification | Covers mesh\u002Ftask and what Maxwell lacks |\n| Optional Switch 2 features | HDR on by itself when the display is in HDR, as on the console (Settings > Screen > HDR: Automatic or Off); DLSS, ray tracing and touch behind options, off by default; off, their NVN2 functions exist but do nothing so the game keeps its normal path | Console hardware extras, not needed to play |\n| Defaults | The console's look and resolution; lower settings are options | The player chooses |\n\n## How it was made\n\nThis port was written with [Claude](https:\u002F\u002Fclaude.com\u002Fclaude-code) (Anthropic's coding agent) doing most of the\ntyping, under my direction, in about ten days of full-time work: 489 commits from 30\u002F10\u002F2026, every one of them\nreviewed, measured or tested before it went in. It was not one prompt and done. Behind it:\n\n- **Method more than prompts.** Every change of performance was measured with an A\u002FB inside the same run (two runs\n  of the same build differ by up to 12 ms per frame); every rendering fix was checked against the console's own\n  image; shader translator changes are tested off the GPU on every one of MKW's 11 561 programs before a game run;\n  frame captures replay the back end in seconds without the game. The rules that came out of mistakes are written\n  down and enforced by scripts, so the same mistake does not happen twice.\n- **What I had learnt before.** The recompiler and the runtime grew out of\n  [totk-pc-recomp](https:\u002F\u002Fgithub.com\u002Fvalentderah\u002Ftotk-pc-recomp) and its Linux port, and out of my earlier work on\n  other recomps (SavageWindRecomp, smo-recomp): the lifter, the launcher and the setup that builds the game on the\n  player's machine, the button icons, the shader control flow. As a maintainer of\n  [AnyPS5](https:\u002F\u002Fgithub.com\u002Fboykopovar\u002FAnyPS5) I learnt how to translate GPU shaders faithfully, run mesh shaders\n  as compute on GPUs that lack them, and keep a large project honest with checks and measurements.\n- **The community's research.** [eden-nx2](https:\u002F\u002Fgit.eden-emu.dev\u002FTakoroka\u002Feden-nx2)'s notes on Switch 2, NVIDIA's\n  SASS encoding as documented by DocumentSASS and nvsass-disassembler, Ryujinx and Mesa NAK for shader semantics, and\n  the other Switch 2 ports listed in the sources.\n\n## Licenses and credits\n\nThis project is under the [MIT License](LICENSE). Code taken from other projects keeps its own license, next to it\n(`LICENSE.*` files in [recomp\u002F](recomp\u002F), [runtime\u002F](runtime\u002F), [sm86\u002Fdecode\u002F](sm86\u002Fdecode\u002F) and\n[runtime\u002Fthird_party\u002F](runtime\u002Fthird_party\u002FREADME.md)): totk-pc-recomp, nvsass-disassembler, Dear ImGui, bc7enc,\nAMD FidelityFX FSR 1 and Roboto. Every source used, with its license and what was taken from it (code from MIT\nprojects only; from GPL projects, ideas only), is listed in [docs\u002Fresearch.md](docs\u002Fresearch.md#sources).\n\nMario Kart World is © Nintendo. This project is not affiliated with or endorsed by Nintendo, contains no game code\nor assets, and does not help to obtain them.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md). Bugs and performance reports go to\n[Issues](https:\u002F\u002Fgithub.com\u002Fadriadam10\u002Fmkw-recomp\u002Fissues), questions to\n[Discussions](https:\u002F\u002Fgithub.com\u002Fadriadam10\u002Fmkw-recomp\u002Fdiscussions).\n","mkw-recomp 是一个将《Mario Kart World》（Nintendo Switch 2）游戏静态重编译为原生 PC 程序的开源项目。它不依赖模拟器，而是将游戏的 AArch64 机器码提前翻译为 C 源码，并编译为 x86-64 或 Linux AArch64 可执行文件；GPU 层面通过 Vulkan 重新实现 NVN2 图形 API，并将 SM86 着色器离线转译为 SPIR-V。项目需用户自行提供游戏镜像，不包含任何 Nintendo 版权内容。适用于希望在 PC 上以接近原生性能运行 Switch 2 游戏的开发者与技术爱好者，尤其适合对静态重编译、跨平台图形 API 重实现及逆向工程感兴趣的场景。",2,"2026-11-24 04:40:11","CREATED_QUERY"]