Read-only copy of github.com/jadeowaowa/scarlett-layer · Experimental Windows x64 / D3D12 compatibility layer for unpacked, unencrypted Xbox Series X|S (GDK) executables
  • C++ 95.9%
  • Python 3.2%
  • CMake 0.7%
  • Batchfile 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-23 19:30:33 -05:00
.github/workflows feat(xvd,loader,ci): migrate real 12 KiB XVD geometry, harden PE/GameConfig parsers, add status drift check 2026-11-22 03:04:39 -05:00
docs fix(d3d12_xs): 4KiB inline command-list pad, shadow descriptor heaps, UAV/RTV guards, and default topology fallback 2026-11-23 19:07:36 -05:00
src fix(tests): align ILocalGameInputReading and ILocalGIRead vtables with GDK v0 IGameInputReading 2026-11-23 19:30:33 -05:00
tools docs: add dynamic README progress dashboard and update Sprint 72 status & wiki 2026-11-23 02:22:45 -05:00
.gitattributes Sprint 66: Fix VFS escape, XVD bounds/flags, non-ASCII/FreeLibrary hooks, portable build, 67 CTests & CI 2026-11-21 20:20:00 -05:00
.gitignore Sprint 64: JIT x64 W^X auto-stub thunks, symbol coverage CLI, and XAudio2CreateWithVersionInfo (61/61 CTests) 2026-11-21 10:15:21 -05:00
AGENTS.md Sprint 71: RDNA2 independent-oracle suite (28 cases) & 255-ELF gfx1030 corpus sweep 2026-11-22 07:52:32 -05:00
cmake Sprint 1: working loader, stub logger, and xgameruntime shim 2026-11-19 22:37:12 -05:00
CMakeLists.txt Sprint 72 checkpoint: retail Scarlett bring-up (SCLZ zlib, packed-mip tiling, descriptor-table guard, frame=120) 2026-11-23 17:55:43 -05:00
CONTRIBUTING.md Sprint 71: RDNA2 independent-oracle suite (28 cases) & 255-ELF gfx1030 corpus sweep 2026-11-22 07:52:32 -05:00
LICENSE Add Apache-2.0 LICENSE, sync roadmap/docs/wiki, and verify 72/72 tests 2026-11-21 23:33:04 -05:00
README.md Sync README.md Live Progress block with Sprint 72 status 2026-11-23 17:56:58 -05:00
SECURITY.md Sprint 66: Fix VFS escape, XVD bounds/flags, non-ASCII/FreeLibrary hooks, portable build, 67 CTests & CI 2026-11-21 20:20:00 -05:00
THIRD_PARTY.md docs: reconcile all repo docs to Sprint 69 truth, add THIRD_PARTY.md, and set Sprints 70-73 Xbox timeline 2026-11-22 02:37:37 -05:00

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.

License Platform CI Tier 1 Synthetic Checks Retail Bring-Up Status

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 (166 exports) | 17 sourced / 5 ASSUMED specs
Auto-generated by tools/generate_status.py and 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. Both cpu and gpu suites 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 SCLZ streaming, and a synthetic boot-to-frame-to-save test (ScarlettTitleBringUpE2E).
  • Local Desktop GDK sample boot: Unmodified Microsoft Public GDK 261000 SimpleTriangleDesktop.exe (PC Desktop target, not an Xbox console target) boots, renders, and exits cleanly (code=0) through loader.exe --boot with 0 auto-stub hits on shims/libHttpClient.dll and shims/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: SCLZ compression, SCXS shader containers, and several ID3D12*X / IXG* / IDStorage*X COM interfaces are project-defined (ASSUMED) rather than matched to real Xbox Series binaries — see docs/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.cpp still 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=1 for 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

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.

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.