- C++ 95.9%
- Python 3.2%
- CMake 0.7%
- Batchfile 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| docs | ||
| src | ||
| tools | ||
| .gitattributes | ||
| .gitignore | ||
| AGENTS.md | ||
| cmake | ||
| CMakeLists.txt | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| SECURITY.md | ||
| THIRD_PARTY.md | ||
scarlett-layer
An experimental Windows / Direct3D 12 compatibility layer for running unpacked, unencrypted Xbox Series X|S (Scarlett / GDK) x64 executables on a Windows PC.
Status: experimental (
v0.72.0-pre). 78/78 Tier 1 synthetic checks pass in CI (RTX 5070 + WARP), and unpacked Terraria (Xbox GDK) now boots, renders menus & backgrounds cleanly with audio, and exits cleanly locally. Input and gameplay progression are next.
Live Progress
Overall Estimated Readiness:
███████░░░░░░░51% — 78/78 Tier 1 CTests (42 cpu,36 gpu) | 16 shim DLLs (166exports) | 17 sourced / 5ASSUMEDspecs
Auto-generated bytools/generate_status.pyand verified in CI. Percentages reflect demonstrated runtime/test coverage, not marketing estimates.
| Subsystem | Progress | State | Demonstrated Scope & Remaining Gaps |
|---|---|---|---|
| Loader, IAT Hooks & VFS | ████████░░ 80% |
Active | PE64/delay-load/ordinal rewrite, APC hook, real 12 KiB XVD geometry, VFS containment; needs human audit & fuzzing |
| D3D12.X Graphics & PresentX | ██████░░░░ 55% |
Active | Flip-Discard PresentX, CBV bounce ring, shadow texture upload, Terraria menus rendering cleanly; needs broader D3D12.X ABI & DXR |
Texture Swizzle & Memory (xg_xs, xmem) |
█████░░░░░ 50% |
Active | GDK XGTextureAddressComputer, GCN 1D_THIN 8x8 Morton detiler (2,193/2,193 Terraria textures), 64KB_S/BCn; needs 2D_THIN/RDNA2 macro-tiling |
| RDNA2 Shader Lifter | █████░░░░░ 50% |
Active | 28-case oracle suite passing; 255-ELF gfx1030 sweep: 100% decode, 49.4% strict / 96.1% compat DXBC compile |
GDK Runtime (xgameruntime) |
████░░░░░░ 45% |
Active | GDK 261000 COM broker, XTaskQueue, XUser, local XGameSave; missing Xbox Live / multiplayer services |
Audio (xaudio2_9, AcpHal) |
████░░░░░░ 45% |
Active | XAudio2 playback, IMA-ADPCM decode, AcpHal shape contexts & ApuAlloc (Terraria menu audio works); missing software XMA2 |
Input (gameinput) |
███░░░░░░░ 30% |
Partial | XInput pad 0 & keyboard-to-gamepad fallback; needs GameInput v2 reading history & retail gameplay wiring |
Networking (libHttpClient, XCurl) |
███░░░░░░░ 30% |
Partial | Offline/mock HTTP & cURL shims; missing live TLS/socket parity |
DirectStorage (dstorage_xs) |
██░░░░░░░░ 25% |
Partial | Async queues & synthetic SCLZ streaming; missing Zlib / GDeflate / BCPack retail codecs |
Bring-Up & Compatibility Snapshot
| Target | Platform | Tier | Status | Notes |
|---|---|---|---|---|
SimpleTriangleDesktop.exe (GDK 261000) |
PC Desktop GDK | Local | Playable | Boots, renders, exits cleanly (code=0, 0 auto-stubs) |
Terraria (unpacked Xbox GDK, Unity 2021.3) |
Xbox One / GDK | Local | Menus | Boots, renders menus & backgrounds cleanly (1D_THIN detiler), plays audio, clean exit; input & gameplay next |
| Automated CI Xbox-targeted binaries | Gaming.Xbox.Scarlett.x64 |
Tier 2 CI | 0 | No redistributable Xbox-targeted binary in CI yet |
What it does
loader.exe starts a target executable suspended, rewrites its imports (including delay-load and ordinal imports), and injects scarlett_hook.dll before the entry point runs. The hook DLL intercepts LoadLibrary*, GetModuleHandle*, GetProcAddress, and FreeLibrary, redirecting console-specific calls to native Windows shims instead of a missing console runtime. The title's directory and the host's System32 are never modified.
Virtual drives G:\, T:\, and S:\ are mounted for the title.
Antivirus / EDR note: Launching a target process suspended, injecting a hook DLL via pre-entrypoint APC, and patching its IAT uses the same OS mechanisms flagged by antivirus and EDR tools. False positives are expected; loader source (
src/loader/) is kept readable and unobfuscated for direct inspection.
What it does not do
- It does not decrypt or run encrypted retail XVD/XVC packages. Encrypted images are rejected unconditionally.
- It implements no DRM circumvention and does not handle leaked game builds, firmware dumps, or console keys. It targets unpacked, unencrypted x64 PE32+ binaries only.
- It is not affiliated with or endorsed by Microsoft or Xbox. All trademarks belong to their owners.
Architecture
Unpacked title (MicrosoftGame.Config | unencrypted XVD | title .exe)
-> loader.exe + scarlett_hook.dll suspended launch, import rewrite, APC injection, IAT hooks
|-- d3d12_xs.dll graphics: device/queue/command-list wrappers, PresentX, async compute, PSO cache, RDNA2 shader lifter
|-- dstorage_xs.dll asset streaming: VFS -> async queues -> SCLZ decode -> GPU upload with fences
|-- xmem / xg_xs 64 KiB physical pools, 2D_THIN / 64KB_S / BC1-BC7 swizzle
|-- xgameruntime.dll GDK 261000 COM service broker + XTaskQueue, XUser, XGameSave
|-- gameinput.dll XInput, keyboard-to-gamepad fallback
|-- xaudio2_9 / AcpHal XAudio2 bridge, IMA-ADPCM voice decoding
|-- libHttpClient / XCurl HTTP and cURL shims
`-- kernelx / pixevt Series X memory budget and CPU topology, PIX markers
-> native Windows x64 + DirectX 12 GPU
Shared runtime flags live in common/config.hpp.
Components
| Component | Binaries | Current Scope |
|---|---|---|
| Loader | loader.exe, scarlett_hook.dll |
Suspended launch, PE import / delay-load / ordinal rewriting, loader-API hooks, MicrosoftGame.Config parser, unencrypted XVD mount/inspect, virtual drives |
| Desktop Launcher | scarlett_studio.exe |
Local launcher, PE shim-coverage inspector, and test runner (GUI work frozen during Sprints 70-72) |
| Graphics | d3d12_xs.dll |
Modeled D3D12.X device/queue/command-list wrappers, DXGI and headless PresentX, frame pacing, async compute with cross-queue fences, disk PSO cache, partial RDNA2 (GFX10.3) shader decoder/lifter, DXBC Xbox-chunk stripper |
| Streaming | dstorage_xs.dll |
Path translation, worker-threaded async queues, synthetic SCLZ decompression, status-array telemetry, direct-to-VRAM buffer/texture/mip-chain streaming |
| Memory and swizzle | xmem.dll, xg_xs.dll |
Pool tracking, 64 KiB physical allocations, 16-byte min alignment, GDK XGTextureAddressComputer, GCN 1D_THIN 8x8 Morton detiling, 64KB_S / BC1-BC7 swizzle |
| GDK runtime | xgameruntime.dll |
GDK 261000 COM service broker (InitializeApiImplEx2 / QueryApiImpl) + flat X* exports for XTaskQueue, XUser, XGameSave |
| Input | gameinput.dll |
XInput pad 0, keyboard-to-gamepad fallback, synthetic test override |
| Audio and network | xaudio2_9.dll, AcpHal.dll, libHttpClient.dll, libHttpClient.GDK.dll, XCurl.dll |
XAudio2 playback with IMA-ADPCM decode, HTTP / cURL shims |
| OS and profiler | kernelx.dll, pixevt.dll, XFrontPanelDisplay.dll |
13.5 GiB title memory budget, 7-core / 14-thread topology report, PIX event markers, front-panel display stub |
Current status
What is demonstrated today
- Tier 1 (Self-Authored Synthetic Suite): 78/78 passing (
42 cpu,36 gpu) on both the author's NVIDIA RTX 5070 and Microsoft WARP (SCARLETT_USE_WARP=1), with 0 MSVC/W4 /permissive-warnings and 0 D3D12 debug-layer errors. Bothcpuandgpusuites run on GitHub Actions Windows CI via WARP. (Includes 1 opt-in local read-only corpus audit test.) - Real D3D12 GPU readback inside Tier 1 tests: textured RDNA2 draw, compute dispatch, 3D depth rendering, cross-queue fence sync, import/ordinal rewriting, synthetic
SCLZstreaming, and a synthetic boot-to-frame-to-save test (ScarlettTitleBringUpE2E). - Local Desktop GDK sample boot: Unmodified Microsoft Public GDK
261000SimpleTriangleDesktop.exe(PC Desktop target, not an Xbox console target) boots, renders, and exits cleanly (code=0) throughloader.exe --bootwith 0 auto-stub hits onshims/libHttpClient.dllandshims/xgameruntime.dll.
What is not demonstrated yet
- Tier 2 (Automated CI Xbox-Targeted Binaries): 0 CI tests. Locally, unpacked Terraria (Xbox GDK) reaches rendered menus with audio, but gameplay/input/save progression is still in progress and no redistributable Xbox-targeted binary runs in CI yet.
- Real console data formats & COM ABIs:
SCLZcompression,SCXSshader containers, and severalID3D12*X/IXG*/IDStorage*XCOM interfaces are project-defined (ASSUMED) rather than matched to real Xbox Series binaries — seedocs/SPEC_SOURCES.md. - Corpus-scale RDNA2 shader lifting: Only a small subset of GFX10.3 instructions is exercised today; an independent-oracle differential suite and large-corpus translate/compile sweep are scheduled for Sprint 71.
- Multi-vendor GPU validation & independent loader audit: Hardware GPU testing has only been run on one NVIDIA RTX 5070 (plus Microsoft WARP), and
src/loader/pe_patcher.cpp/src/loader/scarlett_hook.cppstill await an independent human Windows-internals review (TODO(jade)).
See docs/ROADMAP.md for the Sprints 70-73 execution plan focused on real Xbox Series targets.
Requirements
- Windows 10 or 11, x64
- A DirectX 12 GPU (or
SCARLETT_USE_WARP=1for software D3D12 testing) - Visual Studio 2022+ (MSVC, C++23), CMake 3.25+, Ninja, Python 3
Build and test
git clone https://github.com/jadeowaowa/scarlett-layer.git
cd scarlett-layer
$env:SCARLETT_STRICT_D3D12 = "1"
.\tools\verify.bat --verbose
Runtime flags
| Variable | Effect |
|---|---|
SCARLETT_STRICT_D3D12=1 |
Abort on any D3D12 debug-layer validation error (debug builds) |
SCARLETT_USE_WARP=1 |
Route D3D12 to Microsoft WARP software rasterizer |
SCARLETT_HEADLESS=1 |
Route PresentX to an offscreen backbuffer ring, with no window or swapchain |
SCARLETT_SHIM_DIR |
Directory the loader searches for shim DLLs |
Running a subset of tests
The test runner is split into five suites: tests_d3d12_core, tests_d3d12_shaders_present, tests_storage_swizzle, tests_runtime_io, and tests_loader_e2e.
.\build\bin\titles\scarlett_tests\scarlett_tests.exe --list
.\build\bin\titles\scarlett_tests\scarlett_tests.exe --filter PresentX
.\build\bin\titles\scarlett_tests\scarlett_tests.exe --exact --filter VfsPathEscapeAndLongPaths
ctest --test-dir build -L cpu --output-on-failure
Documentation
docs/STATUS.md: auto-generated shim export, test-tier, and spec-source matrix (tools/generate_status.py)docs/ROADMAP.md: Sprints 71-73 timeline focused on real Xbox Series targetsdocs/SPEC_SOURCES.md: sourced vs.ASSUMEDspecs and verification boundariesTHIRD_PARTY.md: public specification provenance and attribution ledgerdocs/PROGRESS.md: sprint-by-sprint engineering logdocs/ARCHITECTURE_PAPER.md: archived Sprint 21 architecture snapshotCONTRIBUTING.md&SECURITY.md: contribution rules and security policydocs/wiki/: generated wiki
Development notes
Source code in this repository was generated with AI assistance (see AGENTS.md), directed and reviewed by the repository owner. Treat the test suite and direct source inspection as the primary safeguards before relying on any subsystem.
Legal
This project is an independent implementation from public documentation and observed behavior and is not affiliated with or endorsed by Microsoft or Xbox. The author has not intentionally included Microsoft proprietary source code, console firmware, or keys, and the project rejects encrypted retail content by design. Because the code was AI-assisted, formal clean-room certification is not claimed (see THIRD_PARTY.md). If you believe something here infringes your rights, please open an issue.
License
Licensed under the Apache License 2.0.