Skip to content
YbucaillePublic

About

Windows host APIs reimplemented natively on Linux, so Xbox Series games run without Wine or Proton. Rust, base-agnostic, function by function.

Topics

Resources

Contributing

Stars

11 stars

Watchers

1 watching

Forks

Repository files navigation

nativ64

CI License: MIT OR Apache-2.0 Good first issues

Xbox Series games on Linux, natively: no Wine, no Proton, function by function.

Legal, read first. nativ64 ships no game files, no console system files and nothing extracted from them, and never will. You must own a legitimate copy of any title you run and dump it yourself. The project does not name any specific game or publisher, in the repository or in issues and pull requests, and asks contributors to do the same. See Official repository, forks and legal and Legal and contributions.

Compatibility layers and recompilers already run Xbox Series code on a Windows PC. Underneath, they all lean on the same thing: hundreds of Windows APIs borrowed from the host (kernel32, ntdll, the C runtime, threads, files, sockets...). nativ64 rewrites those APIs natively on Linux, as a standalone library that any of these projects can load through a thin adapter.

On Windows? See Xbox2Windows, which recompiles titles for Windows. nativ64 targets Linux only.

The library is not tied to one game: the functions it implements are the same for every title. Priorities come from the import map, which reads a game's import tables and shows what is done and what is left. Titles are added to the map one at a time, and functions shared by many games come first.

Stability first

Other projects aim to get a title on screen as fast as possible, borrowing whatever the host Windows (or Wine) already provides. nativ64 takes the slower road on purpose: a stable, native Linux runtime that does not inherit behaviour from a layer it does not control.

  • Written and tested one function at a time. Each function has its own tests, error cases included (null pointers, too-small buffers, overflows, timeouts, contention), and CI runs formatting, lints and tests on every push.
  • Exact Windows behaviour, Linux primitives. Structure layouts and calling conventions match Windows bit for bit; underneath, it is plain Linux (futexes, syscalls), with no translation layer in between.
  • Once done, done. A finished function is not revisited when the title changes or the base above it moves on, and every base that adopts the library gets it for free.

How it fits

 compatibility layer (the "base": any of them)
        │  the title calls CreateFileW, VirtualAlloc, AcquireSRWLockExclusive...
   ┌────▼─────┐
   │ adapter   │  small, the only part tied to one base
   └────┬─────┘
 nativ64: the Windows APIs, reimplemented on Linux (Rust, Windows x64 calling convention)
        │
      Linux (syscalls, futexes, Vulkan, PipeWire...)
  • Base-agnostic. The library knows nothing about the base above it. Switching base means writing a new adapter, not redoing the work.
  • Usable from Rust and C/C++. Functions are exported with the Windows x64 calling convention and looked up by module!function, from Rust or through a C entry point.
  • Testable without the game. Each function is checked against documented Windows behaviour on its own.
  • Measured. The import map reads the title's import tables and shows, cell by cell, what is done and what is left, in one tab per base and one for this library.

Status

nativ64 pipeline status

Figures and how to regenerate the card: docs/status.md.

Early, and not playable yet. Measured on an RTX 2070: a test title boots and reaches its first 3D frames, which do not render correctly yet; long runs are not stable, and speed is a blocker. See the run status.

  • Boots natively. A native PE loader (nativ64-run, docs/loader.md) maps the executable and its package DLLs, resolves imports, sets up the TEB/PEB, TLS and guest threads, and handles structured exceptions (docs/seh.md).
  • Windows and Xbox API layer. The nativ64 library implements host APIs (C runtime, synchronization, handles, threads, heap, time and modules), alongside console service stubs. 476 of 697 host functions (68.3%) is the historical ddbb2f7 import-map snapshot; refresh the map for current coverage.
  • GPU layer. nativ64-gpu implements the console's Direct3D 12 interface as recorded commands replayed on Vulkan 1.3 (own backend, no vkd3d), with a Wayland swapchain (docs/gpu.md).
  • Own shader translator. RDNA2 (GFX10) programs become SPIR-V, including compute, mesh, pixel and vertex stages. At 647bbed (subgroup 32), 12,365 of 19,066 programs translate and pass spirv-val: 1,228 of 2,718 compute, 5,877 of 6,681 mesh, 4,143 of 8,517 pixel and 1,117 of 1,150 vertex (details). Passing spirv-val is not proof of correct rendering.
  • Memory budget. At 1080p, the goal is under 10 GB RAM and 4 GB VRAM; runs are capped at 10 GB of RAM.

Next: correct 3D rendering, run stability, then speed and memory use.

Historical import-map coverage cards

These cards are historical snapshots, not current coverage of main: nativ64 at ddbb2f7, and a Linux comparison with another compatibility layer. Refreshing them needs the title's executable and package DLLs, which are not in this repository (refresh commands).

Historical nativ64 coverage at ddbb2f7

Historical Linux-native coverage of another compatibility layer

Requirements

  • Linux x86-64 and a recent stable Rust toolchain; Python 3 (no dependencies) for the tools.
  • To run a title: a GPU and driver with Vulkan 1.3, VK_EXT_external_memory_host and the features the backend checks at start (shaderInt64, depthClamp, independentBlend, buffer device address, timeline semaphores, descriptor indexing with non-uniform indexing, dynamic rendering, synchronization2, demote to helper invocation, subgroup operations in compute and fragment shaders...). The exact list is in crates/nativ64-gpu/src/backend/vk/ (device.rs and subgroup.rs); a device that lacks one is refused with the name of the first missing feature. A Wayland compositor gives a real window; without one, rendering is headless.
  • The tests need no game and no GPU: CI runs them on Mesa's CPU driver (lavapipe).

Getting started

git clone https://github.com/Ybucaille/nativ64.git
cd nativ64
cargo test                     # no game files needed

Running a title needs your own legally obtained, dumped copy of its files. Nothing here helps you obtain one.

cargo run --release -p nativ64-loader --bin nativ64-run -- \
    --data /path/to/package/dir /path/to/your/dumped/executable

nativ64-run --check <exe> only maps the image and binds its imports. Other binaries: nativ64-vkdemo (Vulkan swapchain demo), nativ64-shader (shader translator command line), nativ64-status (library coverage). The environment variables that select the GPU (NATIV64_GPU), the window (NATIV64_WINDOW), validation layers (NATIV64_VK_VALIDATION) and the frame, draw and shader dumps for debugging are documented in docs/gpu.md, docs/shaders.md and docs/loader.md. Debug dumps can contain game data: never attach them to an issue or pull request.

To draw the import map you need your own copy of a game's files and, for the base tabs, a checkout of the base next to this repository. See docs/import-map.md.

Architecture

Crate Role Documentation
crates/nativ64 Host Windows APIs on Linux (extern "win64", libc as only dependency) docs/library.md, docs/audio.md
crates/nativ64-loader Native PE loader, TEB/PEB, TLS, threads, faults and SEH docs/loader.md, docs/seh.md
crates/nativ64-gpu Console Direct3D 12 on Vulkan, texture layouts, RDNA2 shader translator docs/gpu.md, docs/shaders.md, docs/textures.md

Community

Discord: https://discord.gg/CtX9AArtA2 (talk about the project in the community channels; to work on the code, read CONTRIBUTING.md and ask for developer access in #dev-access). Bugs and feature requests go to GitHub issues.

Contributing

The map is the to-do list: pick a grey cell, say so on its issue, implement the function in nativ64 with its tests, open a pull request. CONTRIBUTING.md explains how, and docs/library.md covers the ABI rules (calling convention, 32-bit LONG, UTF-16 strings, SetLastError).

Good first contributions: C runtime string and math functions, timing and system-info calls, synchronization primitives on futexes. Read the legal rules below before your first pull request.

Repository layout

Path What
tools/ Import map scripts and page template
docs/ Documentation
game/ Your local game files (not versioned)
reports/ Generated pages (not versioned: derived from game files)

The crates are listed under Architecture.

Related projects

Other projects run Xbox Series (GDK) titles on a PC. They target Windows and translate the console's graphics to the host's Direct3D 12; nativ64 targets Linux, with its own host APIs and a Vulkan path, and is meant to sit under any of them.

Project Host Approach License
XCL Windows Compatibility layer in the spirit of Wine/Proton: own console libraries, RDNA2 shaders recompiled through HLSL to DXIL GPL-2.0
nativ64 Linux Windows host APIs rewritten natively, a PE loader, Xbox Direct3D 12 on Vulkan (in progress) MIT OR Apache-2.0

nativ64 contains no code from these projects; they are read as references for how the console's interfaces behave.

Official repository, forks and legal

This repository and the project Discord are the only official channels. Forks are not reviewed or endorsed by the project and do not speak for it.

The project contains no game files, keys, decrypted executables or game names, and accepts none. Users must own the title and supply their own legally obtained copy. Contributions follow CONTRIBUTING.md: DCO sign-off, pure native implementations, and no code copied from GPL or LGPL projects.

Legal and contributions

  • This project contains no game files, no console system files and nothing extracted from them, and never will. You supply your own legally obtained copy, which you dump yourself.
  • It is not affiliated with Microsoft, any game publisher or any compatibility-layer project.
  • No game or publisher names, and no executable names, anywhere in the repository, issues, pull requests or commit messages. Say "the title".
  • Never commit game files, dumps, extracted shader blobs, textures, audio, logs, screenshots or crash reports containing game data or game strings. That includes attachments to issues and pull requests.
  • Clean room. No code copied from proprietary SDKs or leaked sources, and none from GPL or LGPL projects (this project is MIT OR Apache-2.0). Other projects, Wine's tests and public documentation are read for facts only; the code is written from those facts.
  • Pure native only. No Wine, Proton, DXVK, vkd3d or vkd3d-proton, dxil-spirv, or any shim or dependency built over them. Reference projects are read for facts only.
  • Memory discipline. RAM and VRAM frugality from the start: every cache has a bound or a retirement, no CPU copy is kept once uploaded, staging memory is freed or reused, and GPU imports and images are released when the title frees their memory. A pull request that touches memory paths says how memory was measured.
  • Maintainers check every pull request for these points. Content that breaks them is not merged: you will be asked to remove it and to squash it out of the history first, and a pull request that keeps it is closed.

License

Dual-licensed under MIT or Apache-2.0, at your option, so any base can use the library, whatever its own license.

About

Windows host APIs reimplemented natively on Linux, so Xbox Series games run without Wine or Proton. Rust, base-agnostic, function by function.

Topics

Resources

Contributing

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages