Clean-room Xbox Series X|S (GDK) compatibility layer for Apple Silicon Macs and Windows. Combines a PE32+ loader, console runtime libraries (xgameruntime, d3d12_xs, dstorage, GameInput, XMem, XAudio2/XMA), an RDNA2-to-DXIL shader recompiler, and a native Apple Metal backend (MACBOX_GPU=metal).
User-supplied, unencrypted executables only. This repository contains no game files, keys, screenshots, title-specific patches, or DRM bypasses.
Requires an Apple Silicon Mac on macOS 15+ with Rosetta 2 (softwareupdate --install-rosetta), Xcode Command Line Tools, Homebrew, and Apple's Game Porting Toolkit (provides D3DMetal.framework and libmetalirconverter.dylib).
GPTK_DMG=/path/to/Game_Porting_Toolkit.dmg ./setup.shInstalls Rust (x86_64-pc-windows-gnullvm), builds patched x86_64 CrossOver Wine, extracts D3DMetal.framework / libmetalirconverter.dylib (auto-detected from ~/Downloads if GPTK_DMG is omitted), compiles the native Metal bridge (target/metal), and builds gdk-run.exe.
Always launch through tools/macos/run.sh rather than invoking gdk-run.exe directly. run.sh sets the full verified Apple Silicon configuration (MACBOX_GPU=metal, WINEMSYNC=1, Series S profile, MetalFX temporal upscaling, wave64-to-SIMD32 compute compatibility switches, write-watch tracking, and tuned DirectStorage workers) and converts POSIX paths to Wine Z:\ paths. Running gdk-run.exe manually without those switches often causes visual artifacts, missing UI overlays, or poor frame pacing.
tools/macos/run.sh run --execute /path/to/your/title/executable.exeKeep title packages, caches, and save data outside this repository (the runtime rejects paths inside the source tree). The first launch compiles shaders and populates the on-disk DXIL and Metal binary archive caches, so frame times settle once the cache is warm.
Useful overrides (prefix the command above):
# Store caches and saves in custom directories
MACBOX_CACHE_DIR=/path/to/cache \
MACBOX_DATA_DIR=/path/to/saves \
MACBOX_METAL_CACHE=/path/to/metal-cache \
tools/macos/run.sh run --execute /path/to/your/title/executable.exe
# Common tuning / debug switches
MACBOX_METAL_FPS_OVERLAY=0 # hide the FPS overlay
MACBOX_WINDOW_MAX=1280x720 # cap window size
MACBOX_FIDELITYFX_METALFX=spatial # temporal (default), spatial, or bilinear
MACBOX_LOG=info MACBOX_METAL_STATS=1 # print per-frame GPU/CPU/memory statsAdd --console series-x after the executable path to report Series X instead of the default Series S profile (Series S is recommended for lower memory and GPU load). See docs/macos.md for the full list of switches and keyboard/controller mappings.
cargo test --workspace # host unit tests
cargo xtask policy # clean-room asset and compliance checks
tools/macos/test-metal.sh # 83 synthetic Metal GPU tests under Wine67beea2— Isolated MetalFX temporal/spatial encoding in dedicated retained command buffers with synchronous initialization, input usage checks, and transientMTLCompilerServiceXPC retries (66/66Metal tests).f816a81— DefaultedMACBOX_FAULT_TRACKINGoff below macOS 27 intools/macos/run.shand fixeddocs/macos.mdenv documentation.6ec2754— Refreshedtools/macos/patches/wineserver-view-tree.patchagainst CrossOver 26.3.0 so./setup.shapplies cleanly.9aae538— Alignedtools/macos/run.shdefaults (WINEMSYNC=1,MACBOX_DSTORAGE_WORKERS=6,MACBOX_SCREEN_PASS_WAIT=15,MACBOX_PRESENT_COMPOSITE=1).60c3ac4— Cut streaming write-watch, texture upload, descriptor-heap sync, and segment-resolution CPU overhead (MACBOX_HOT_OPEN=4Metal default, frame-windowedtake_manystreaks,PAGE_SCRATCHdirect-reservation hashing,WRAPS-backed descriptor sync,REMOVED_RING/GROW_RINGvalidation,MACBOX_METAL_STATS=1CPU breakdown;65/65Metal tests).6a23247— DefaultedMACBOX_UAV_SIZE_LEVEL0andMACBOX_CODE_TABLE_LOADSon native Metal.
7a267fd— Cut moving memory footprint, lock contention, and compile stalls (console-RAM-bounded texture eviction, lock-light wrapping, coalesced physical spans,WrapCacheGuard, live compute/graphics pipeline wait budgets;64/64Metal tests).f1bae74— Added native MetalFX temporal upscaling (MTLFXTemporalScaler),RGB9E5packing, linear aspect-preserving presentation, and exact client-ratio window sizing.bf16169— Enabled pipeline-ordered concurrent Metal compute (MACBOX_METAL_SERIAL_COMPUTE=pipeline) andMACBOX_METAL_FAST_IR=1(60/60Metal tests).25076a8— Sized Metal texture eviction to host working set and reduced write-watch contention.42d0a52— Translated AMDclzeroclear loops on non-CLZERO / Rosetta hosts.3dbfac8— Enabled generic shader clarity and compute defaults intools/macos/run.sh.4a83a22/ca7d552— Added GitHub Actions CI (policy, host tests, Windows non-GPU tests, Clippy correctness).414e2db— Bundled BCPack format constant tables by default.1c39214— Streamlined the native Metal macOS launcher, setup script, and docs (59/59Metal tests).f59bbea— Initial clean-room MacBox GDK repository with native Metal backend (58/58Metal tests).
- Cut remaining CPU time spent scanning and mirroring large shader-visible descriptor heaps during heavy multi-zone streaming.
- Cap long-session Metal texture/heap/staging allocations so extended runs stay flat on unified memory.
- Expand exact wave64-to-SIMD32 cross-half LDS/UAV ordering (
MACBOX_HALVES_ORDER,MACBOX_HALVES_LDS_ORDER,MACBOX_HALVES_ACROSS) with minimal barrier cost. - Reduce per-frame
gpu_msthrough tighter encoder batching, IR lowering cleanup, and redundant barrier elimination. - Grow synthetic test coverage in
tests/fixtures/hle-probeandtools/macos/test-metal.sh.
- docs/macos.md — macOS Metal backend, environment switches, and controls
- docs/architecture.md — crate layout and runtime data flow
- docs/replay.md — single-frame GPU capture and offline replay
- docs/asset-policy.md — clean-room and static policy rules
- CONTRIBUTING.md / DEVELOPING.md — workflow and PR guidelines
Bug reports and PRs are welcome on GitHub. Include your Apple Silicon model, commit hash, exact command, and relevant MACBOX_LOG=info / MACBOX_METAL_STATS=1 output — keep everything clean-room (no proprietary binaries, assets, screenshots, or hashes).
Declared GPL-3.0-or-later; see LICENSE and docs/provenance.md.