From 23e241facdf37ea1acccf712ccec228166558fbb Mon Sep 17 00:00:00 2001 From: ivall Date: Sat, 21 Nov 2026 15:45:56 +0100 Subject: [PATCH] README: highlights and status grouped by area (code, services, graphics, media) --- README.md | 75 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d6a7e7b..53f9951 100644 --- a/README.md +++ b/README.md @@ -6,36 +6,71 @@ x64 code runs natively and XCL stands in for the console libraries the PC does n GPU code (RDNA2 machine code) is recompiled into PC shaders (HLSL → DXIL). **Project state:** the foundation is in place and tested against real data from a retail game -(its shader pack, texture archive, movies and the 16 console DLLs it ships). No game reaches its -first frame yet: draw submission and present use the console's own D3D12.X command format, which -can only be worked out from a game executable. Details, measurements and next steps: +(its shader pack, texture archive, movies and the 16 console DLLs it ships). What remains before a +game shows its first frame is the graphics submission path – draws and present use the console's +own D3D12.X command format, which can only be worked out from a game executable. Details, +measurements and next steps: [`HANDOFF.md`](HANDOFF.md); design: [`docs/specs/2026-11-20-xcl-design.md`](docs/specs/2026-11-20-xcl-design.md). +## Highlights + +- **100 % of a retail game's shaders translate** – all 24 064 RDNA2 programs of its shader pack + become HLSL; random samples compile to DXIL with 0 errors. +- **The game's own console DLLs run on the PC** – its Bink 2 video codec decodes the game's + movies, its ray-tracing BVH builder builds acceleration structures on a PC GPU, the AMD FSR 4 + console upscaler sets up and records its work, the GDK HTTP library initialises. +- **Console textures decode exactly** – the GFX10 tiling and mip layout reproduce 908 of 912 + textures of the game's texture archive byte for byte. +- **150 automated tests**, including GPU tests that compare translated shaders against expected + results instruction by instruction. + ## What works -| Area | State | Details | Verified by | +✅ done and verified · 🟡 works, with a gap listed under *What is missing* + +### Running the game's code + +| Feature | State | What it does | Verified by | |---|---|---|---| -| **PE loader** | ✅ | relocations, imports (by name / ordinal, delay-load), TLS callbacks, exception tables, game DLLs, data-driven import routing (HLE / Windows / stub) | unit tests; the 16 console DLLs of a retail game load and run `DllMain`, 0 unresolved imports | -| **kernelx** | ✅ | memory (title memory budget from MicrosoftGame.Config, physical pages), threads, the PC's processors, modules (`LoadLibrary` / `GetProcAddress` routed to HLE), OS / console info | unit + e2e tests | -| **File system** | ✅ | console paths (`GAME:`, `G:` …) → game folder; every write goes to an overlay, the game folder stays untouched | e2e: the test title's folder is unchanged byte for byte | -| **XGameRuntime** | ✅ | the GDK thunk protocol (`InitializeApiImpl*` / `QueryApiImpl`, as GDK titles call it): XCL's own offline XUser (one local user), XGameSave (saves in the XCL data folder), XPackage, XGame (title id), XSystem; XTaskQueue / XAsync / XThread / XNetworking / dialogs forwarded to the PC's XGameRuntime; by-name exports for direct imports | a retail GDK library (libHttpClient.GDK) initialises; XUser and XGameSave through the thunk vtables on PC task queues | -| **Input** | ✅ | GameInput → the system `GameInput.dll` | – | -| **Audio** | 🟡 | XAudio2 → system XAudio2.9; PCM / float voices | unit tests; XMA2 / Opus voices play silence for now | -| **Video** | 🟡 | the game's own Bink 2 console DLL decodes its movies on the CPU | e2e: a game movie decodes (720p, picture checked) | -| **D3D12.X device** | 🟡 | real D3D12 device; console vtable slots; console descriptor heaps (32-byte T#/V#, 16-byte S#); buffers placed in a GPU-visible heap at their console addresses; compute command lists recorded in the console format and replayed (descriptor tables, barriers, clears, copies) | the game's XboxBvhBuilder and FSR4 DLLs record and run their work through XCL | -| **Shader recompiler** | ✅ | RDNA2 → HLSL → DXIL; VS, PS, CS; mesh (NGG) and geometry shaders as compute + pass-through mesh pass; atomics, LDS, scratch, images, samplers (incl. static samplers built in code), ray-tracing BVH instructions emulated; structured control flow; DXC worker pool, disk cache | all 24 064 programs of a retail shader pack translate (91.5 % fully structured); random 1 % / 10 % samples compile with 0 DXC errors; per-instruction GPU tests against expected results | -| **Pipelines** | ✅ | PSOs from console shaders: VS+PS, CS, MS+PS, VS+GS+PS; ABI root signature with static samplers | GPU tests drawing retail VS/PS pairs (textured, descriptor change between draws) | -| **Textures** | 🟡 | GFX10 tiling (14 2D swizzle modes), mip chains with mip tail, slices; detiled into PC textures | the model matches the layout of 908 / 912 textures of a retail texture archive; GPU round trip bit exact; binding to the game's texture API needs the exe | -| **Ray tracing** | 🟡 | the game's XboxBvhBuilder builds BLAS / TLAS on the GPU through XCL; RDNA2 BVH node format | GPU tests: traversal = brute force; prebuilt (rehydrated) BVHs not yet | -| **Tools** | ✅ | `xcl inspect` (imports and what XCL has for them), `xcl run`, `xcl disasm` (RDNA2, console containers), `xcl shaders` (pack statistics, recompile / compile runs), `xcl rpf` (extract); `tools/ttpf-viewer` (texture archive viewer) | – | +| **PE loader** | ✅ | relocations, imports by name / ordinal / delay-load, TLS callbacks, exception tables, game DLLs, data-driven import routing (HLE / Windows / stub) | the game's 16 console DLLs load with 0 unresolved imports | +| **kernelx** | ✅ | title memory (budget from MicrosoftGame.Config, physical pages), threads on the PC's processors, modules, OS / console info | unit + end-to-end tests | +| **Memory** | ✅ | title graphics memory shared by CPU and GPU without copies, up to 16 GB (4 GiB windows) | GPU tests: loads, stores and atomics across windows | +| **File system** | ✅ | console paths (`GAME:` …) → the game folder; writes go to an overlay, the game folder is never modified | end-to-end: the test title's folder stays byte-identical | + +### System services + +| Feature | State | What it does | Verified by | +|---|---|---|---| +| **XGameRuntime** | ✅ | the GDK thunk protocol real titles use; offline XUser, XGameSave, XPackage, XGame (title id), XSystem; task queues, async, networking and dialogs through the PC's XGameRuntime | the game's libHttpClient initialises; users and saves through the real call path | +| **Input** | ✅ | GameInput → the system GameInput | – | +| **Audio** | 🟡 | XAudio2 → system XAudio2.9 (PCM / float voices) | unit tests; Opus / XMA2 voices are silent for now | + +### Graphics + +| Feature | State | What it does | Verified by | +|---|---|---|---| +| **Shader recompiler** | ✅ | RDNA2 → HLSL → DXIL: VS, PS, CS, mesh (NGG), GS; atomics, LDS, scratch, images, samplers incl. static ones, wave ops, ray-tracing instructions; structured control flow; parallel DXC, disk cache | 24 064 / 24 064 programs of the retail pack; 0 DXC errors on random samples; per-instruction GPU tests | +| **Pipelines** | ✅ | PSOs from console shaders: VS+PS, CS, MS+PS, VS+GS+PS; root signature with the shaders' static samplers | GPU tests drawing the game's own VS / PS pairs | +| **D3D12.X compute** | ✅ | console device slots, console descriptor heaps (T# / V# / S#), buffers at their console addresses, compute command lists recorded in the console format and replayed (tables, barriers, clears, copies) | the game's BVH builder and FSR 4 record and run through XCL | +| **D3D12.X graphics** | 🟡 | device, resources, heaps and pipelines are in place | draw submission and present need the game exe | +| **Textures** | ✅ | GFX10 tiling (all 14 2D swizzle modes), mip chains with mip tail, arrays and cubes → PC textures | 908 / 912 retail textures exact; GPU upload bit exact | +| **Ray tracing** | ✅ | BLAS / TLAS built on the GPU by the game's own XboxBvhBuilder; RDNA2 BVH node format; BVH intersection instructions emulated in shaders | GPU traversal = brute force reference; the game's builder output checked on the GPU | +| **Upscaling** | ✅ | the game's AMD FSR 4 console DLL creates its context and records its dispatches | end-to-end with the real DLL | + +### Media and tools + +| Feature | State | What it does | Verified by | +|---|---|---|---| +| **Video** | ✅ | the game's Bink 2 console DLL decodes its movies (720p / 1080p) | a game movie decodes frame by frame, picture checked | +| **Tools** | ✅ | `xcl inspect`, `xcl run`, `xcl disasm` (RDNA2, console shader containers), `xcl shaders` (pack statistics, recompile / compile runs), `xcl rpf`; `tools/ttpf-viewer` (texture archive viewer) | – | ## What is missing | Needs a game executable | Not done yet | Not planned | |---|---|---| -| D3D12.X draw records and `PresentX` / frame pacing | Opus / XMA2 audio decoding | Xbox Live, Store licensing (offline by design) | -| root arguments → shader registers for graphics | GPU memory above 4 GB (shaders address one 4 GB window) | decrypting XVC packages or any DRM | -| texture creation in title memory (binding the detiler) | non-blocking pipeline creation (first run compiles shaders synchronously) | console SDK headers / binaries in the repository | +| D3D12.X draw records and `PresentX` / frame pacing | – | Xbox Live, Store licensing (offline by design) | +| root arguments → shader registers for graphics | non-blocking pipeline creation (first run compiles shaders synchronously) | decrypting XVC packages or any DRM | +| texture creation in title memory (binding the detiler) | Opus / XMA2 audio decoding | console SDK headers / binaries in the repository | | the persistent-local-storage class and `XSystemGetDeviceType` slot of the thunk protocol | hull / domain / amplification shaders (none in the sample game), linear / 3D / MSAA tiled textures | | | Bink GPU decoding, rehydrating prebuilt BVHs | performance work (GPU buffers live in system memory) | |