Usage (docs/user/USAGE.md)
AnyBox converts a decrypted GDK title, a folder holding the main .exe, its DLLs and MicrosoftGame.config, into a program that runs on Windows. It does not decrypt or unpack protected packages.
anybox-relinker --libs build/libs --module-dir . --registry <package>\game.exe <out>\game.exe
| Option | Meaning |
|---|---|
--libs <dir> |
copy the AnyBox DLLs the output needs (from build/libs) beside it |
--module-dir <dir> |
also convert every .dll under <dir> (relative to the package); repeat for each folder of title DLLs; . converts those beside the executable |
--registry |
write <file>.registry.json with every import and where it is routed |
--console / --gui |
choose the Windows subsystem (console images become GUI by default) |
--allow-unknown |
keep imports from DLLs nothing provides instead of failing |
--list-imports |
print the imports and their routes, write nothing |
--print-map |
print the DLL routing table |
Then copy the rest of the package (data folders and MicrosoftGame.config) into <out>. The relinker prints the expected layout.
python tools/launch_title.py <package> <out> --build-dir build
checks that the executable named in MicrosoftGame.config is a decrypted PE32+ x64 image, converts it with --module-dir for every folder holding DLLs, hard-links (or copies) the rest of the package into <out> except .xvd containers, starts the program with ANYBOX_LOG_FILE=<out>\anybox.log, and prints the run report summary. --exe <path> picks the executable when the config lists several, --console uses the console subsystem, and --no-run stops after converting.
python tools/import_audit.py <package>
lists every import that is a stub, absent or unrouted, and exits with 1 if the title cannot start yet.
Start <out>\game.exe. When the title stops, anybox-report.json beside it says why:
stop.kind |
Exit code | Meaning |
|---|---|---|
none |
the title's | the process exited normally |
not-implemented |
0xAB01 |
the title called a stub; library and function name it |
unsupported |
0xAB02 |
an implemented function met a case whose behaviour is unknown; message says which |
crash |
the exception code | an unhandled exception; exception gives the module and offset |
python tools/run_report_summary.py anybox-report.json checks the report and prints one line to paste into the title's Game bring-up thread.
| Variable | Effect |
|---|---|
ANYBOX_REPORT=<path> |
write the run report there instead of beside the executable |
ANYBOX_NO_REPORT=1 |
write no run report |
ANYBOX_LOG_FILE=<path> |
append AnyBox's log lines to this file as well as stderr |
ANYBOX_TRACE=<library>[,<library>...] |
log every call into the listed AnyBox libraries (xmem, d3d12_x, ...; all for every library) with its arguments and result; case and spaces are ignored. Libraries that trace so far: xmem, d3d12_x |
ANYBOX_SHADER_STORE=<folder> |
load the shader store from this folder instead of shaders beside the executable (GAME_TESTING) |
Build (docs/dev/BUILD.md)
- CMake 3.20 or newer and Ninja.
- A C++20 compiler.
- Full build (Windows): MinGW-w64 GCC 13 or newer (tested with WinLibs GCC 15.2 UCRT, POSIX threads, SEH) or MSVC 2022. MSVC needs a Windows SDK that provides
gameinput.libandxaudio2.lib(checked with 10.0.26100). - Relinker only (any OS): GCC, Clang or MSVC.
- Full build (Windows): MinGW-w64 GCC 13 or newer (tested with WinLibs GCC 15.2 UCRT, POSIX threads, SEH) or MSVC 2022. MSVC needs a Windows SDK that provides
- Python 3.10 or newer for the tool tests and the end-to-end tests (optional; without it those tests are not registered).
pip install jsonschemaenables the schema check of run reports.
The libraries need the submodules under 3rdparty/ (Vulkan-Headers). Clone with git clone --recursive, or run git submodule update --init in an existing clone.
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build
ctest --test-dir build --output-on-failure
Outputs:
build/anybox-relinker.exebuild/anybox-module-probe.exe, used bytools/module_check.pybuild/anybox-gpu-report.exe, used bytools/gpu_report.pybuild/anybox-pipeline-probe.exe, which createsd3d12_x's Vulkan device and compiles compute pipelines (layout,selftest,validation,compile,bindless,window)build/libs/ab_*.dll, includingab_runtime.dllbuild/libs/anybox-libs.map, the DLL routing table
With -DANYBOX_GAME_PACKAGE and -DANYBOX_SHADER_TRANSLATOR, the build gets shaders and shader_pipelines targets that build a title's shader set from your own package into build/shaders, and tests labelled shaders that check it. See Building shaders with the project.
The probes run a few test shaders, compiled ahead of time so the build needs no shader compiler. Each core/libs/probe/shaders/<name>.<stage> (.comp, .vert or .frag) sits next to its compiled <name>.inc; after editing one, regenerate it with the Vulkan SDK's glslc:
glslc --target-env=vulkan1.3 -O -mfmt=num core/libs/probe/shaders/<name>.<stage> -o core/libs/probe/shaders/<name>.inc
Builds and tests the converter without the Windows libraries, on Linux, macOS or Windows:
cmake -S . -B build -G Ninja -DANYBOX_RELINKER_ONLY=ON -DBUILD_TESTING=ON
cmake --build build
ctest --test-dir build --output-on-failure
The routing table and the library list are read at configure time. Re-run the cmake -S . -B build step after you add a folder under core/libs/xdll or edit an Imports.txt or Ordinals.txt. CONFIGURE_DEPENDS makes the build re-run it automatically in most generators.
Architecture (docs/dev/ARCHITECTURE.md)
How a GDK executable becomes a Windows program. Nothing is emulated: the converted executable runs as a normal process and calls native implementations of the system libraries.
flowchart LR
subgraph input["GDK title (decrypted)"]
exe["game.exe (PE32+, console subsystem)"]
dlls["bundled *.dll"]
cfg["MicrosoftGame.config"]
end
subgraph relinker["relinker (core/relinker)"]
direction TB
parse["PeImage: parse headers,<br/>imports, delay imports"]
route["LibraryMap: route each DLL<br/>bundled / library / host / unknown"]
write["Conversion: rename routed DLLs,<br/>unbind, drop certificate,<br/>console → Windows subsystem, checksum"]
parse --> route --> write
end
subgraph libs["build (core/libs)"]
rt["ab_runtime.dll:<br/>stops, run report, title metadata"]
x["ab_<library>.dll<br/>implemented / forwarded / stub"]
x --> rt
end
subgraph out["Windows program"]
app["game.exe"]
mods["converted bundled DLLs"]
ab["ab_*.dll"]
end
exe --> parse
dlls --> parse
write --> app
write --> mods
x --> ab
app -- "Windows loader binds imports by name" --> ab
- GDK titles are x86-64 PE32+ images, the format the Windows loader already reads. There is no instruction translation and no ABI thunking: Windows x64 has one calling convention, and console and PC code both use it.
- What differs is the environment: the subsystem field (14, the console subsystem), the console-only system DLLs the title imports (XGameRuntime, D3D12.X, kernelx and others), and the hardware behind them.
Conversion::Convert, called from main.cpp:
- Parse.
PeImagereads the headers, sections, import and delay-import descriptors (by name and by ordinal) and exports. Only AMD64 PE32+ native images are accepted. - Route.
LibraryMapresolves each imported DLL, first match wins:- bundled: a DLL the title ships, from the input's folder or a
--module-dir. Its name is kept, and it is converted too. - library: a pattern in some
core/libs/xdll/<name>/Imports.txt. The import is renamed toab_<name>.dll. - host: a pattern in
HostDlls.txt: the desktop OS provides it unchanged (API sets, the CRT,kernel32). - unknown: conversion fails and names the DLL, unless
--allow-unknown. An import by ordinal from a library must be pinned in that library'sOrdinals.txt, or conversion fails and names it. CMake generates the table from these files at configure time (cmake/LibraryMap.cmake), so adding a library needs no relinker change.
- bundled: a DLL the title ships, from the input's folder or a
- Rewrite. New DLL names go in an appended
.abximpsection, and each descriptor's name RVA is pointed at them. Descriptors, thunks and the IAT stay where they are, so code that calls through the IAT is unaffected. Bound imports are unbound (the IAT is restored from the lookup table). The Authenticode certificate is dropped, because the image no longer matches it. The subsystem becomes Windows GUI (or console with--console), and the checksum is recomputed. - Report.
--registrywrites<output>.registry.jsonwith every import and its route;tools/import_audit.pyreads PE files directly for the same view against the library sources.
- Each folder in
core/libs/xdllbuildsab_<name>.dllthroughanybox_add_xdll(core/libs/CMakeLists.txt). - An export is one of:
- implemented: an
ABX_APIdefinition (extern "C" __declspec(dllexport)); - forwarded: a
Name=hostdll.Nameline inForwards.def, which the Windows loader resolves to the host DLL; - stub: an
ABX_APIdefinition whose body callsAbxNotImplemented(__func__).
- implemented: an
ab_runtime.dllis shared by every library:AbxNotImplemented/AbxUnsupportedlog the library and function, write the run report and end the process with exit code0xAB01/0xAB02. A title cannot catch these.- An unhandled exception filter writes the report for crashes (code, address, module and offset).
- At normal process exit the report is written with
stop.kind = "none". AbxTitleId(),AbxTitleName()andAbxTitleDeviceFamily()readMicrosoftGame.configbeside the executable.AbxTrace(format, ...)logs throughAbxLogon the library's channel whenANYBOX_TRACElists that library (orall); each call site asksAbxTraceEnabledonce, so a trace that is off costs one branch.- Each library registers itself at load (
Registration.cpp), so the report lists the libraries the title loaded. - The relinker only changes import tables, so a DLL a title loads by name at run time would bypass it: GDK modules load
xgameruntime.dllwithLoadLibraryExWand System32-only search, which on a PC with Gaming Services finds the desktop runtime.LoaderRedirect.cpppoints theLoadLibrary*andGetModuleHandle*import slots of title-side modules (not AnyBox'sab_*libraries, not Windows modules) at functions that send any name AnyBox serves to its library besideab_runtime.dll, using the same routes as the relinker; modules loaded later are patched from the loader's DLL notification. Each redirected name is logged once with its caller.
- Libraries link their C and C++ runtime statically, with MinGW and with MSVC (
CMAKE_MSVC_RUNTIME_LIBRARY), so the output folder needs no compiler DLLs, and AnyBox never loads the console builds ofmsvcp140.dllandvcruntime140.dllthat titles ship beside their executable.
Console shaders carry native GPU code and no DXIL, so d3d12_x cannot hand them to a desktop driver. The design is on #4: the title's D3D12.X device goes to Vulkan, and its shaders are SPIR-V modules translated ahead of time by a separate tool. d3d12_x uses two back ends:
-
Host
d3d12.dll(RootSignature.cpp):D3D12SerializeRootSignatureandD3D12SerializeVersionedRootSignature(with the console-only flag bits cleared) and the two deserializer creators are forwarded to it, since they need no GPU. -
Vulkan (
vulkan/,pso/,store/): everything the device does.D3D12XboxCreateDevice,D3D12CreateDeviceandD3D12GetDebugInterfacestill stop the title until its calls show the device's shape, so nothing reaches the pieces below yet. -
Shader store (
store/ShaderStore.cpp): modules keyed by the SHA-256 of each DXBC container, loaded fromANYBOX_SHADER_STOREorshadersbeside the executable.tools/build_shaders.pyand theshaderstarget build it from a package (GAME_TESTING). -
Device (
vulkan/VulkanDevice.cpp): a Vulkan 1.3 device with exactly the features the store's modules name;VulkanBackend.cppreports what each GPU offers (anybox-gpu-report,tools/gpu_report.py). -
Layout (
vulkan/TitleLayout.cpp): every pipeline uses one layout, set 0 with twenty bindless bindings and 144 bytes of push constants, the interface the translated modules declare (tools/spirv_layout.pychecks a store against it). -
Pipelines (
vulkan/PipelineCompiler.cpp): compute pipelines from stored modules, a pipeline cache reused only on the same GPU and driver, and large modules compiled one at a time. -
Pipeline state (
pso/PipelineState.cpp,vulkan/PipelineLibrary.cpp): a compute pipeline state description is resolved to its stored module through the hash of its shader container, and the library creates each pipeline once, cache first. It asks the driver for the pipeline without compiling (VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT); only when that fails does it compile, and a module over the run-time compile limit is refused instead. Some modules need more memory to compile than a PC can commit, so the offlineshader_pipelinesrun fills the cache that the title then only loads. The title's own cached pipeline blobs are ignored, because they hold console GPU code. -
Graphics state (
pso/GraphicsState.cpp,vulkan/GraphicsPipeline.cpp): a graphics pipeline state description's blend, rasterizer, depth-stencil, sample, topology class and target formats become Vulkan state, and pipelines use dynamic rendering. Viewports, scissors, blend constants, stencil reference, the exact topology, primitive restart and vertex buffer strides are dynamic, because D3D12 sets them while recording.GraphicsPipelineRequest(pso/PipelineState.cpp) resolves a graphics description's vertex, geometry and pixel shaders through the store and hands the whole pipeline to the library, cache first like compute. -
Root signatures (
pso/RootSignatureLayout.cpp): a root signature blob is deserialized through the hostd3d12.dlland laid out as parameters with their 32-bit word cost, tables and ranges, and static samplers as Vulkan samplers; the mapping of those words to the shaders' user registers is still open. -
Vertex input (
pso/VertexInput.cpp): a translated vertex shader reads each input at the location of its D3D input register, so the input layout is matched to the vertex shader's inputs by semantic name and index, which the store keeps ininputs.txt. -
Resource states (
commands/ResourceState.cpp): D3D12 resource states become Vulkan stages, access masks and image layouts, so a transition, UAV or aliasing barrier becomes avkCmdPipelineBarrier2dependency (the device enablessynchronization2). -
Objects (
objects/): COM objects implementing the public D3D12 interfaces on Vulkan, with reference counting, private data and names (ObjectBase.hpp).ID3D12Fence1is a timeline semaphore;ID3D12CommandQueuesignals and waits on the one Vulkan queue and holds a wait on the CPU until its value is promised, so a wait recorded before its signal cannot deadlock.ID3D12CommandAllocatoris a Vulkan command pool andID3D12GraphicsCommandListrecords into one of its command buffers through the command recorder, tracking the states its barriers set so copies use the right layouts;ExecuteCommandListsqueues the closed lists' buffers in order with the queue's signals and waits, andCloseends each list with a barrier that makes GPU writes visible to the CPU, as a D3D12 readback after a fence expects.ID3D12DescriptorHeap(DescriptorHeap.cpp) puts shader-visible heaps in the buffer window, so a GPU descriptor handle is the address the shaders read descriptor words from, and keeps a CPU-side record of the Vulkan view or sampler behind each slot;DescriptorWriter.cppwrites buffer descriptors, creates render target, depth-stencil and texture views (cached per resource) and samplers, and copies descriptors. The handle increments are the console's and stay unset until a title gives them (DescriptorSizes.cpp).ID3D12RootSignature(RootSignature.cpp) holds the deserialized layout andID3D12PipelineState(PipelineObject.cpp) a pipeline from the library; a command list binds pipeline states and keeps each bind point's root arguments as root words at the layout's offsets. Draws and dispatches wait for the mapping from those words to the translated shaders' push constants.ID3D12Resource(Resource.cpp) puts committed buffers in the buffer window (first-fit,vulkan/BufferArena.cpp), so their GPU addresses are what the shaders add the heap base to, and textures in their own device memory, zeroed and moved to their initial state at creation. Built with MinGW, methods that return a structure use the explicit return pointer the console's MSVC ABI expects. -
Command recording (
commands/CommandRecorder.cpp,commands/CopyLayout.cpp): clears, buffer and texture copies through placed footprints, texture copies, resolves, render passes, viewports (with a negative height, so D3D12's winding applies), scissors, topology, vertex and index buffers, push constants, draws, dispatches and indirect draws and dispatches (commands/IndirectCommands.cpp, with count buffers) recorded on a Vulkan command buffer, with layouts from the D3D12 states. -
Textures (
resources/TextureDesc.cpp): a texture's resource description becomes a Vulkan image description, with typeless and block-compressed formats, depth families, mip chains, multisampling and cube compatibility. -
Views and samplers (
resources/ViewDesc.cpp): shader resource, unordered access, render target and depth-stencil view descriptions become Vulkan image views (format family, depth or stencil aspect, swizzle, mip and array range), and sampler descriptions become Vulkan samplers. -
Buffer descriptors (
resources/BufferDescriptor.cpp): constant buffer and buffer shader resource and unordered access views become the four-word buffer descriptors the translated shaders decode (base address, stride, records, component selects, format and bounds mode). -
Memory access in a translated shader takes one of two paths:
- images and samplers: the shader looks its T# or S# up in the descriptor hash table at binding 2 (
vulkan/DescriptorTable.cpp) and gets a bindless index into set 0 (vulkan/BindlessSet.cpp), with fallbacks at index 0; - buffers and scalar loads: the shader adds the heap base to the console address it read, so a title's buffers and descriptor tables have to sit in one buffer-device-address range, below 4 GB for descriptor tables (
vulkan/TitleBufferWindow.cpp).
- images and samplers: the shader looks its T# or S# up in the descriptor hash table at binding 2 (
-
anybox-pipeline-probedrives each piece on the GPU (selftest,validation,bindless,window,compile); thepso_probetest program drives pipeline state descriptions through the store and the library.
Not built yet, because they follow from a title's own calls: D3D12XboxCreateDevice and the device's methods (so nothing calls the pipeline state paths yet), command queues and lists, resources and descriptor heaps, mesh pipelines, presentation, and which allocations go to the buffer window. Each open point is in debt/d3d12_x.md.
anybox-report.json, schema docs/run-report.schema.json, fixtures in docs/run-report-fixtures. A value the runtime cannot know is null, never a guess.
relinker_testsbuild synthetic console PE images in memory (SyntheticPe.cpp) and check routing, unbinding, certificate removal, delay imports, header room and checksums.e2e.pytakes a real title built against a stand-in consolexgameruntime.dll, marks it with the console subsystem, relinks it, runs it on the AnyBox libraries, and checks its output and run report for a working task queue run, composite queues sharing ports, task queue monitors and waiters (including a monitor unregistering itself and a termination waited from the queue's own dispatched callback), XAsync calls (run, wait, provider ops, results, cancellation, a terminated queue and a null block), XGameSave containers and blobs written, read, enumerated and deleted in a per-title folder, XGameSaveFiles handing that folder to the title with a quota shared with XGameSave and a mismatch error when a title mixes the two, a stub stop, an unsupported stop, a crash and the reported device type.
Game testing (docs/dev/GAME_TESTING.md)
Every run is useful, including one that stops at once: the run report names the next function to implement. This page asks for the same information from every run, so reports can be compared.
- Build
main(or the pull request you are testing) in a clean tree:cmake --build build. - Audit the title first:
python tools/import_audit.py <package> --json audit.json. Keep the summary line for the report. - Convert with
--registryand every folder of title DLLs as--module-dir(USAGE). - Check that the converted DLLs load:
python tools/module_check.py <out> --build-dir build. Each DLL with a.registry.jsonbeside it (every DLL except AnyBox'sab_*.dllwhen none has one) is loaded byanybox-module-probe.exein its own process, which runs itsDllMain. A DLL that fails names the Win32 error and, whenDllMainraised one, the exception code with module and offset; one that calls a stub names the AnyBox function. It needs no executable, so it also works on a package whose executable is missing. - Check the GPU against the title's shader store (Shader store):
python tools/gpu_report.py --build-dir build --store <out>\shaders. It lists each Vulkan device and every feature, push constant size, subgroup operation per stage or 64-wide subgroup the store's modules need and the device lacks. Without--storeit lists the devices only. - Run one title at a time.
set ANYBOX_LOG_FILE=%CD%\anybox.log
out\game.exe
echo exit=%ERRORLEVEL%
Post to the title's Game bring-up discussion (one thread per title ID; search first):
- the line from
python tools/run_report_summary.py out\anybox-report.json; - the import audit summary line;
- the AnyBox commit and any pull requests merged on top;
- OS, CPU, GPU and driver;
- what was on screen and how far it got.
Attach anybox-report.json and the log. Never attach game files, executables, keys or anything you do not have the right to share.
| Check | Where | Meaning |
|---|---|---|
| Exit code | shell | 0xAB01 (43777) stub, 0xAB02 (43778) unsupported, 0xC0000005 access violation, 0xC0000135 a DLL is missing beside the executable |
| Stop | anybox-report.json stop |
the library and function, or the crash module and offset |
| Caller | anybox-report.json stop.caller, log line called from |
where in the title the stop was reached: the first frame outside AnyBox and Windows, as module+offset (null when the title is not on the stack, for example on an AnyBox worker thread) |
| Frames | anybox-report.json stop.frames, log lines #00, #01, ... |
up to 32 frames of the stopping or crashing thread |
| Run-time loads | log lines loader: LoadLibraryExW(xgameruntime.dll) from game.exe+0x... loads ab_xgameruntime.dll |
a module loaded a DLL AnyBox serves by name at run time, and got AnyBox's library instead of whatever the search would have found |
| Libraries | anybox-report.json libraries |
which AnyBox DLLs the title loaded |
| Log | stderr or ANYBOX_LOG_FILE |
[anybox] not implemented: lib!func (file:line) |
| Loader errors | message box at start-up | "The procedure entry point X could not be located in Y": a forwarded or host export the desktop lacks; report it as a library gap |
A stop names the AnyBox function and, under caller, the place in the title that reached it, such as called from game.exe+0x31013. The relinker leaves the title's sections where they were, so that offset is the same RVA in the original executable: in Ghidra or IDA, go to the image base plus the offset (0x140000000 + 0x31013 for the usual base). Frames are return addresses, so the offset is the instruction just after the call; the call is the instruction before it. A crash lists its frames the same way, starting at the faulting instruction.
To look at the title's state at the stop, run it under a debugger (x64dbg, WinDbg or Visual Studio). With a debugger attached, a stop breaks into it before the process exits, with the title's call on the stack; set ANYBOX_BREAK=0 to turn that off. When something else starts the title, set ANYBOX_WAIT_DEBUGGER=<seconds>: AnyBox logs its process ID, waits up to that long for a debugger to attach, and breaks before the title's entry point runs. The debugger also receives its own attach break, so continue past both.
| Variable | Effect |
|---|---|
ANYBOX_LOG_FILE=<path> |
append the log to a file as well as stderr |
ANYBOX_TRACE=<library>[,<library>...] or all |
log each traced call of those libraries |
ANYBOX_REPORT=<path> |
write the run report there instead of beside the executable |
ANYBOX_NO_REPORT=1 |
write no run report |
ANYBOX_BREAK=0 |
do not break into an attached debugger at a stop |
ANYBOX_WAIT_DEBUGGER=<seconds> |
wait for a debugger at start-up, then break before the title starts |
ANYBOX_CONFIG=<path> |
read settings from that file instead of anybox.cfg beside the executable |
ANYBOX_SET=<key>=<value>[;...] |
set or override settings for one run |
Some values AnyBox needs depend on the console build a title was made for and are not known until someone finds them in that title; until then the feature that needs one stops with a message naming the missing value. Such values are settings, so trying one needs no rebuild. Put them in anybox.cfg beside the executable, one key = value per line, with a # comment saying where each came from:
# <title> <version>: GetDescriptorHandleIncrementSize result, seen at game.exe+0x1a2b30
d3d12_x.descriptor_size.shader_resource = 32
Each value a library reads is logged with its source (setting ... = 32 (from anybox.cfg:2)), and malformed or repeated lines are logged too. ANYBOX_SET overrides the file for one run. A setting describes one title's build: report what you found in the title's bring-up thread, and a value only becomes a default in AnyBox once it is confirmed and its source recorded.
| Key | Meaning |
|---|---|
d3d12_x.descriptor_size.shader_resource |
descriptor handle increment of CBV, SRV and UAV heaps, in bytes |
d3d12_x.descriptor_size.sampler |
descriptor handle increment of sampler heaps |
d3d12_x.descriptor_size.render_target |
descriptor handle increment of render target heaps |
d3d12_x.descriptor_size.depth_stencil |
descriptor handle increment of depth-stencil heaps |
d3d12_x.vulkan_device |
part of the name of the GPU to use, case-insensitive, when several are installed (python tools/gpu_report.py lists them); without it the best native GPU is used, and a layered driver such as Dozen only when nothing else can run the title |
When a title stops in a stub, the next question is what it passes to that function. tools/ghidra/ImportCallArgs.java lists every call a title's executable or DLL makes into one imported DLL, and the instructions that set RCX, RDX, R8 and R9 before each call. Run it headless on the original (unconverted) file, with Ghidra 11 or later:
analyzeHeadless <project dir> anybox -import <package>\Bink2Scarlett.dll -scriptPath tools\ghidra -postScript ImportCallArgs.java xmem.dll calls.txt -overwrite
The output names each call site, its function and the argument setup, for example RDX <- MOV EDX,0x5e50000 for the attributes passed to XMemAlloc. Use it to find which inputs a title exercises and to check a signature against real callers. Values seen in one title describe that title only: implement the function for every input, and put the call sites in the pull request, not in the repository.
GDK modules do not import the runtime's functions: they load xgameruntime.dll at run time and call method tables that QueryApiImpl returns, so the run report names an interface and slot instead of a function. tools/api_impl_scan.py lists, for one executable or DLL, every thunk the module contains (the GUID pair it passes to QueryApiImpl and the method slot it calls), and for the thunks the module's own code calls, how many call sites they have and which argument registers and stack slots each passes:
python tools/api_impl_scan.py <package>\game.exe --json game-apis.json
It needs GNU objdump on PATH (MinGW's works) or given with --objdump. A slot is only mapped in ApiImpl.cpp when call sites show what it is: argument shape, how the result is used, and an open-source caller or documented order that names it. Unmapped slots stop and name themselves, so a run and this listing together say which slot to measure next.
The D3D12.X design (#4) depends on what console shaders contain. tools/shader_scan.py finds every DXBC container in a package, loose or embedded in another file, and counts them by kind (dxil, dxbc, mixed, rootsig, other) and by part tag:
python tools/shader_scan.py <decrypted package folder> --json shaders.json
Part tags that are not standard DXBC parts point at console-specific data. Each container with a DXIL part also gets a program class, read from the bitcode slot of the DXIL program header:
program |
Meaning |
|---|---|
bitcode |
LLVM bitcode, so the shader is DXIL a desktop driver could take |
native |
the slot holds NOBC and the part carries an XBCH block: no DXIL, the GPU program is precompiled for the console |
stub |
NOBC without an XBCH block |
unknown |
the header does not parse |
In an RPF9 archive (file magic 9FPR) the scan also reads entries stored as raw deflate, which the table of contents is not needed for: <name> 00 <u8> <u32 stored> <u32> <u32 stored> <u32 size> followed by stored bytes that inflate to a size-byte container. Those containers have stored: deflate and their name, and their offset is the entry header's. Shaders in other compressed archives are not found. Post the summary line in the issue; the JSON holds names, offsets and part tags only, never shader bytes.
A title's native shaders cannot be handed to a desktop driver, so AnyBox looks each one up in a shader store: SPIR-V modules translated ahead of time by a separate tool, keyed by the SHA-256 of the whole DXBC container (the container's own HASH part is not unique enough: different containers share it). AnyBox does not contain a translator. Build the store from a translated shader set laid out as a folder of carved .dxbc containers with an index.json list (name, file) and a folder of <name>.spv modules with an index.json map from name to details that include stage:
python tools/shader_store.py build <carved folder> <translated folder> <out>\shaders
python tools/shader_store.py lookup <out>\shaders <container.dxbc>
build writes modules.txt (one <sha256> <stage> <subgroup> <path> line per module, tab-separated; the subgroup size a pipeline must require is 32, 64 or 0 for any; paths are relative to the store), inputs.txt (one <sha256> <location> <semantic> <index> <type> <mask> line per vertex input of a vertex shader: the input register the translated module reads at that location, the semantic the input layout names it by, and its component type) and modules.json (the translator's details per module). Byte-identical containers share a module; a hash whose copies translate to different modules or stages is left out and counted. d3d12_x loads modules.txt from ANYBOX_SHADER_STORE, or from shaders beside the executable. The store is built from your own copy and stays on your machine: never commit it or attach it to an issue.
The shader set can be built and tested like the rest of the project, from your own package and into the build folder, so nothing of it is ever committed. Point CMake at the package and at a checkout of the external translator (a folder holding make_game.py, which takes --game, --work, --stages shaders and --wave64-emulate and leaves the carved containers in <work>/shaders/dxbc and the modules in <work>/shaders/spirv, the layout shader_store.py build reads):
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON ^
-DANYBOX_GAME_PACKAGE=<package folder> -DANYBOX_SHADER_TRANSLATOR=<translator checkout>
cmake --build build
cmake --build build --target shaders
ctest --test-dir build -L shaders --output-on-failure
| Setting | Meaning |
|---|---|
ANYBOX_GAME_PACKAGE, ANYBOX_SHADER_TRANSLATOR |
Both or neither. Without them none of this is configured, and the normal build and tests are unchanged. |
ANYBOX_PIPELINE_CHECK |
The pipeline checker executable. Default: the translator's runtime/build/vk_pipeline_check.exe. |
ANYBOX_SHADER_JOBS |
Workers for the translator and the pipeline check. 0 (default) leaves the choice to them. |
ANYBOX_WAVE64_EMULATE |
The translator's wave64 emulation mode, auto (default), on or off. 32-wide GPUs need it on. |
ANYBOX_PIPELINE_CHUNK |
Index entries per pipeline checker process, 500 by default. The GPU driver's compiler keeps its memory until the process exits, so one process for the whole set can run out of memory hours in. 0 runs one process. |
ANYBOX_PIPELINE_MAX_BYTES |
Modules larger than this many bytes are reported as BIG SKIP instead of compiled. 0 (default) compiles all. Use it when a few huge modules need more memory than this PC can commit: the rest of their chunk is still checked, and the check reports the skipped modules by name and does not pass. |
The translator's own requirements (its disassembler, the Vulkan SDK's spirv-as and spirv-val) come from your environment, as when you run it by hand.
| Target | What it does |
|---|---|
shaders |
Runs the translator's shader stage into build/shaders/work, then builds the store in build/shaders/store. The translator skips the stages whose output is still current, so a second run is quick. |
shader_store |
Rebuilds the store only. |
shader_pipelines |
Creates every pipeline on this PC's GPU from build/shaders/work/shaders/spirv, with its cache in build/shaders/pipeline_cache.bin. It runs the checker once per chunk of ANYBOX_PIPELINE_CHUNK entries, and every chunk seeds from and saves to that cache. This takes hours and needs a lot of memory for the largest modules; run it when the translation changes, not on every build. A run that stops or fails part way picks up where it left off: chunks that passed with the same checker executable are reused, and the cache makes the pipelines of an interrupted chunk quick to create again. Pass --recheck to tools/build_shaders.py to check every chunk again. |
Each step writes build/shaders/build.json: the translator's revision and whether it had local changes, the counts of carved and translated shaders, the store's counts, and the pipeline totals with the name of every failed or skipped pipeline. For each chunk that failed it also records the checker's exit code and the last compile the checker named as still running, which is the likely culprit when the checker crashed. Logs go to build/shaders/translate.log and one log per chunk in build/shaders/pipelines/. A new translation drops the store and pipeline results from build.json, so the tests never pass on results from an older translation.
Test (label shaders) |
Passes when |
|---|---|
shaders_store |
Every carved shader has a translation, the store has no missing, invalid or conflicting entries, and the C++ store (d3d12_x) finds every carved container with the stage the translation gives. |
shaders_gpu |
At least one Vulkan device supports what every stored module needs (tools/gpu_report.py). Skipped without Vulkan. |
shaders_layout |
Every stored module's descriptor bindings (read from its SPIR-V by tools/spirv_layout.py) and push constant size fit the title layout d3d12_x creates pipelines with (anybox-pipeline-probe layout). |
shaders_compute |
An evenly spaced sample of 60 compute modules up to 1 MiB compiles through d3d12_x's own device and pipeline code, under the Khronos validation layer when it is installed (any validation error fails the test). Skipped without a usable Vulkan device. |
shaders_pso |
12 compute shaders up to 1 MiB and the largest compute shader go from their carved containers through the store and d3d12_x's pipeline state path, with a 1 MiB run-time compile limit. With an empty cache the small ones are created and the largest is refused rather than compiled (or found in the driver's own cache). With build/shaders/pipeline_cache.bin every one must come from the cache once shaders_pipelines passes. Then 8 vertex shaders that read vertex inputs become graphics pipelines through the store, an input layout built from their signature and the render state path, with a test pixel shader. Skipped without a usable Vulkan device. |
shaders_pipelines |
The last shader_pipelines run covered every entry, every chunk completed, and no module or pipeline failed. Skipped until it has run. |
build.json and the logs name shaders: like the store, they stay on your machine.
Contributing (CONTRIBUTING.md)
Thanks for helping. AnyBox grows one function at a time, and most contributions are small: implement one stub, forward one export, or add the stubs a new title needs. This page is everything you need to do that.
- Needs page. The needs page ranks every known function by how many titles need it and AnyBox lacks it. Start from the top. Add your own titles to it with
python tools/import_audit.py <package> --needs docs/needs/<TitleId>.json(details). - Progress page. Every stub is listed per library on the progress page. Locally:
python tools/progress.py --module xgameruntime. - A title you own.
python tools/import_audit.py <decrypted package folder>lists every import asimplemented,forwarded,stub,absent(no AnyBox declaration yet) orunrouted(no library serves the DLL). Run it before you start, so you work on what the title actually calls. - Issues labeled
good first issueandlibrary request. - Known gaps in docs/dev/debt, especially entries ending in
Closes when:.
Search open pull requests for the function name before you start, so two people don't implement the same thing.
| You want to | Do this |
|---|---|
| Implement a stub | Replace the AbxNotImplemented(__func__) body with the real behaviour, give the declaration its real signature, and add a test. Keep an exact signature from the public GDK headers; do not copy the GDK headers into the repository. |
| Use the host's implementation unchanged | Add Name=hostdll.Name to the library's Forwards.def and remove its stub. Only when the console and desktop contracts match; record any doubt in debt. |
| Serve an import by ordinal | Add <Name> @<ordinal> to the library's Ordinals.txt. CMake pins the export at that ordinal, and the relinker refuses a title that imports an ordinal no library pins. |
| Add imports a title needs | python tools/import_audit.py <package> --json audit.json then python tools/stubgen.py --from-audit audit.json. Commit the generated stubs, declarations and debt fragment. |
| Serve a new DLL | python tools/stubgen.py --new-library <name> --dll <name>.dll, then reconfigure CMake. |
| Change the relinker | Build with -DANYBOX_RELINKER_ONLY=ON (works on Linux and macOS too) and add a case to RelinkerTests.cpp. |
| Change a tool | Add or extend a test in tools/tests; CTest runs them. |
- Follow the conventions: naming, no comments in code, Conventional Commits.
- Implement or stop. Every function either does exactly what it is supposed to or stops the process through
AbxNotImplemented/AbxUnsupported, which write the run report. A silent stub (returns success without doing the work) is allowed only when it unblocks a title and affects only presentation, and it is listed under Silent stubs in its library's debt file. - Implement the general behaviour of a function, not what one title happens to need. Never branch on a title ID, path or value from one trace.
- Missing imports fail at conversion or start-up with a clear error; never add fallbacks that keep running.
- Every
ABX_APIexport has exactly one declaration in a header under its library'sinclude/.tools/check_conventions.pychecks this. - Don't replace modules that titles ship themselves (engine and middleware DLLs, XSAPI thunks). Only system libraries are reimplemented.
- Behaviour taken from a public header or documentation says so in the PR. Behaviour not checked against a console is recorded in debt.
- Third-party code is a git submodule under
3rdparty/, built from source with CMake. - Tests finish in 30 s each.
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build
ctest --test-dir build --output-on-failure
python tools/check_conventions.py
Toolchains and the relinker-only build are in BUILD.md.
- One topic per pull request, based on current
main. Follow-ups go in a new pull request. - Fill in the template: what changed, how it was tested, dependencies, the issue it fixes, the title it unblocks (
Unblocks: 4D5307E6 #12), and whether AI assisted. - Known gaps are added, changed or removed through a fragment in
docs/dev/debt/changes/<branch>.md, never by editing the debt files (format). Maintainers fold fragments withpython tools/debt_fold.py. - The README embeds the documentation pages as collapsible sections. After editing one of them, run
python tools/readme_docs.py; a test fails while the README is out of date. - Investigation notes, logs and screenshots go in the pull request, not in the repository.
- CI runs the conventions check, the relinker tests on Linux, the full Windows build and tests, and posts the library progress change as a comment.
- Labels are added for you: the area a pull request touches (
libs,relinker,tools,ci, ordocswhen it changes only documentation; labeler.yml),fixes issuewhen it closes an issue, andunblocks titlewhen itsUnblocks:line names a title ID. - A pull request that conflicts with
maingets theneeds rebaselabel within the hour. Rebase it on currentmainand force-push; the label goes away by itself. After 7 days in conflict with no activity, it is markedstalewith a reminder. Nothing is closed automatically. - Say whether the change was written with AI assistance. The author is responsible for every line.
Use the Game bring-up discussion form, one thread per title ID. Include the anybox-report.json summary line (python tools/run_report_summary.py anybox-report.json), the AnyBox commit and your system. A failed run with a complete report is as useful as a successful one. See GAME_TESTING.md.
Only share material you have the right to distribute. Never attach game files, keys or decrypted executables.
Conventions (docs/dev/CONVENTIONS.md)
python tools/check_conventions.py checks the rules marked ✔. CI runs it on every pull request.
- ✔ No comments in C and C++ under
core/, except#endiflines, namespace-end lines and an upstream licence notice at the top of an adapted file. Explanations of gaps belong in technical debt. - ✔ Text files are UTF-8.
- C++20 standard library; the relinker uses nothing else. Libraries may use the Windows API.
- Types and functions
PascalCase, locals and parameterscamelCase, memberscamelCase_, globalsg_camelCase, thread-localst_camelCase, constantsPascalCase. - Exported functions keep their console names exactly (
XTaskQueueCreate). - Library-internal code lives in an anonymous namespace.
- ✔ A library folder name is lowercase letters, digits and underscores, and has
Imports.txt,<name>.hppandCMakeLists.txt. - ✔ A DLL name pattern is served by one library only.
- ✔ Every
ABX_APIdefinition has exactly one declaration, in a header; none in source files. Every declaration has a definition. - ✔ A function is either defined or forwarded, not both.
- Stubs call
AbxNotImplemented(__func__). Unknown behaviour inside an implemented function callsAbxUnsupported(__func__, "<what is unknown>"). - Implemented functions trace each call with
AbxTrace("<Function>(<arguments>) -> <result>", ...): arguments in call order, pointers with%p, flags and codes in hex. - Signatures not taken from a public header are declared without parameters and listed under Unknown function info in the library's debt file.
- Implementation files are named after the API area (
TaskQueue.cpp,GameSave.cpp); unimplemented stubs live inInventory.cpp.
- ✔ Commit subjects are Conventional Commits:
type(scope): summary, with type one offeat fix docs style refactor perf test build ci chore revert. The scope is a library (xgameruntime),relinker,runtime,tools,ciordocs. - PR titles follow the same format.
Technical debt (docs/dev/TechnicalDebt.md)
Known gaps: what differs from the console, what is unverified, and what stops a title. Entries about one library or component are in debt, one file per library, under the same ### sections as this page. An entry may end with Closes when: and the measurement, title or test that would close it, so contributors can search for the ones they can re-check.
A pull request does not edit the debt files. It adds its own fragment, docs/dev/debt/changes/<branch>.md, with a # <name> line per debt file (TechnicalDebt for this page) and operations under it:
# xgameruntime
## add Silent stubs
- [XFoo](../../../core/libs/xdll/xgameruntime/Inventory.cpp) (xgameruntime) - returns S_OK without reading its argument
## change [XTaskQueueTerminate]
- [XTaskQueueTerminate](../../../core/libs/xdll/xgameruntime/TaskQueue.cpp) (xgameruntime) - cancellation order measured on a console
## remove [XBaz]add puts entries after the last entry of that ### section, creating the section if needed. change and remove name text that occurs in exactly one entry of the file. python tools/debt_fold.py --check validates fragments (CI runs it), --show <name> prints a debt file with pending fragments applied, and running it without options applies and deletes every fragment.
Every function either does exactly what it is supposed to or stops the title through AbxNotImplemented or AbxUnsupported. The exceptions are listed under Silent stubs in each library's debt file.
- Only Windows hosts run converted titles. A Linux host would need a PE loader for the converted image and the AnyBox DLLs.
- Titles must already be decrypted, plain PE files. AnyBox does not read or unpack protected packages.
- A title's own unhandled exception filter, installed after start-up, replaces AnyBox's, and its crashes then produce no run report.
run.exitCodeis alwaysnull: the report is written before the exit code is known.
Progress (docs/dev/PROGRESS.md)
What is counted, where it is published, and how to read it.
tools/progress.py scans core/libs/xdll/<library>/ (excluding tests/) through tools/anybox_scan.py:
- implemented: an
ABX_APIfunction definition whose body does not callAbxNotImplemented; - stub: an
ABX_APIdefinition whose body callsAbxNotImplemented; - forwarded: a
Name=dll.Targetline in the library'sForwards.def.
Comments, string and character literals are blanked before matching, so braces or names inside them do not count. The percentage is (implemented + forwarded) / declared. A count says nothing about whether a title runs; compatibility lives in the Game bring-up discussions.
Progress also counts what AnyBox does not declare yet, from the export inventories and title needs records:
- not declared: a function a library's DLLs are known to export or titles import, with no declaration.
known = declared + not declared, andknownPercentis done of known. - export list not known yet (
*on the map): no inventory or needs record covers the library's DLLs, so its known total is just what it declares. - DLLs with no library (
unserved): DLLs that titles import or inventories list, that no library serves and Windows does not provide. Each is a dashed red tile on the map and a row on the page with thestubgen.py --new-librarycommand that starts it.
python tools/progress.py out/ # progress.json, progress.html, progress.svg, badge-libraries.svg
python tools/progress.py --module xgameruntime
python tools/progress.py --json
python tools/progress.py --compare base.json head.json # the pull request comment; empty when no library changed
python tools/progress.py --root ../other-checkout --json # count another checkout with this version of the tool
tools/progress_history.py measures the first-parent history: one point per UTC day, the last commit of that day, read through git show with today's counting rules. It writes history.json, history.svg and history.html. --cache <file> keeps measured commits between runs.
- Pages workflow: on pushes to
mainthat touchcore/libs, the tools or the docs, it publishes the progress page, map, badge and history to GitHub Pages. - Progress report workflow: on pull requests, it counts the base (
--root) and the merged head with the same version of the tool and compares them. Progress comment posts the result on the pull request as one comment, updated on each push and deleted when the change no longer touches a library: the new percentage and its change, the functions implemented, forwarded, newly stubbed, removed or no longer done, and a table of the changed libraries. It runs in a separate workflow because pull requests from forks get a read-only token.
Progress counts only what AnyBox already declares. Three tools find everything else and rank it, without implementing anything:
tools/lib_inventory.pylists every export of import libraries (.lib, short format) or DLLs, and stores the names indocs/inventorywith--json. The inventory from the public PC GDK is committed; its README says how it was made.tools/import_audit.py--needs docs/needs/<TitleId>.jsonstores what one title imports, minus host and bundled DLLs, indocs/needs.tools/needs.pymerges both with the current library scan:- every known function, with its DLL, the library that serves it, its status and the titles that import it, sorted so the functions most titles need and AnyBox lacks come first;
- per DLL: known exports, how many titles need it, declared, done;
- per title: how many of its imports are done, and its next blockers.
python tools/needs.py site/ # needs.json, needs.html; prints a Markdown summary
python tools/stubgen.py --from-audit site/needs.json # declares every absent function as a stub
The Pages workflow publishes needs.html next to the progress page.
tools/import_audit.py reads a title's PE files and classifies every import:
| Status | Meaning |
|---|---|
| implemented | the routed library implements it |
| forwarded | the routed library forwards it to the host |
| stub | declared; calling it stops the title with a run report |
| absent | the DLL is routed but the function is not declared; stubgen.py --from-audit adds it |
| bundled | the title ships the DLL itself |
| host | desktop Windows provides the DLL |
| unrouted | nothing serves the DLL; start a library with stubgen.py --new-library |
It exits with 1 when something is absent or unrouted (--strict-stubs also fails on stubs).
Tool for porting GDK console executables to Windows PCs, by relinking them against reimplemented system libraries.
No emulation and no separate runtime process. A GDK title is already an x86-64 PE program. The relinker points its imports at AnyBox's own DLLs (core/libs/xdll) and switches the console subsystem to a Windows one. The converted program then runs as an ordinary Windows process.
Early. The relinker, the library build, the run reports and the progress tracking work end to end on a test title. Most system functions are still stubs that stop the title with a report naming the function.
Each tile is a library, sized by its number of functions, and each square in it is one function: implemented (green), forwarded to Windows (blue), stub (grey) or known but not declared yet (dark). A dashed red tile is a DLL that titles import and no AnyBox library serves yet. * marks a library whose full export list is not known yet, so its total grows as titles are audited. Known functions come from the export inventories and title needs records.
The progress page lists every function as implemented, forwarded, stub or not declared, and every DLL with no library. It is regenerated on each push to main by tools/progress.py; the history shows how it grows.
| Library | Serves | State |
|---|---|---|
| xgameruntime | xgameruntime.dll |
XGameRuntime init and options, all of XTaskQueue (composite queues, monitors and waiters included), XAsync, XThread, XGameSave and XGameSaveFiles implemented; XUser, most of XPackage and XSystem stubs. Titles built with the GDK call the runtime through QueryApiImpl method tables rather than named exports: the XAsync and XTaskQueue table is mapped for the methods a bundled GDK module was measured calling (enough for that module's initialization to succeed), and every other table or method stops and names itself |
| d3d12_x | d3d12_x.dll, d3d12_xs.dll |
uses two back ends: root signature serialization is forwarded to the host's d3d12.dll, and everything the device does goes to Vulkan. Built on the Vulkan side: the device, shader store, compute and graphics pipeline state (render state, vertex input, cache first), resource barriers, texture images, views and samplers, bindless descriptors, the buffer window, and fences, queues, resources, command allocators, command lists, descriptor heaps, root signatures and pipeline states (Graphics). Device creation still stops the title until its calls show the device's shape |
| xaudio2 | xaudio2_9.dll |
forwarded to the host's XAudio2 |
| gameinput | gameinput.dll |
forwarded to the host's GameInput |
| kernelx | kernelx.dll |
Win32 subset forwarded to kernel32 |
| xmem | xmem.dll |
XMemAlloc, XMemFree, XMemVirtualQuery and XMemGetWorkingSetStatistics implemented; the allocation attribute word is not decoded yet, so every block is plain read-write memory |
Unsupported or unexpected states stop the process with a run report (anybox-report.json) that names the library and function, the place in the title that reached it and the stack, and with a debugger attached the stop breaks into it (Debugging a stop). Nothing returns a made-up success.
Console shaders ship as native GPU code, not DXIL, so no desktop driver can take them as they are. AnyBox's graphics library (d3d12_x) therefore runs a title's D3D12.X device on Vulkan, with the title's shaders translated to SPIR-V ahead of time by an external translator. The parts of D3D12 that need no GPU, root signature serialization and deserialization, go to the host's own d3d12.dll. The design is on #4 and the pieces are in Architecture.
Built and tested on a GPU without the title's executable (each with its own probe and tests):
- Pipeline state: compute and graphics descriptions resolve their shaders through the store by the hash of each shader container. Blend, rasterizer, depth-stencil, samples, topology and formats become Vulkan state, and the input layout is matched to the vertex shader's inputs. Each pipeline is created once and taken from the pipeline cache first; one that would need too much memory to compile in the title is refused, not compiled.
- Resources: D3D12 resource states become Vulkan barriers, texture descriptions become Vulkan images (typeless, depth and block-compressed formats included), and view and sampler descriptions become Vulkan image views and samplers.
- Commands: clears, buffer copies, uploads and readbacks through placed footprints (block-compressed included), texture copies (depth and stencil planes included), MSAA resolves, draws (viewports, scissors, culling and winding as in D3D12, vertex and index buffers, read-only depth-stencil passes), dispatches and indirect draws and dispatches (
ExecuteIndirectwith plain draw or dispatch signatures, count buffers included) are recorded on Vulkan; GPU tests read every result back and compare it. - D3D12 objects: fences and command queues as COM objects on Vulkan timeline semaphores, with waits held back until their value is signalled so queues never deadlock; committed buffers in the buffer window (mappable, with the GPU addresses the shaders use) and textures in device memory, zero-initialized as in D3D12; command allocators and command lists that record barriers (per subresource), copies, resolves and input-assembler and rasterizer state into Vulkan command buffers, which the queue executes in order with its signals and waits; descriptor heaps (shader-visible ones in the buffer window, at the addresses shaders read descriptors from) holding buffer descriptors, render target and depth-stencil views and samplers, with descriptor copies and render target and depth-stencil clears; root signatures and compute and graphics pipeline states as objects, bound on command lists with their root arguments.
- Root signatures: a title's serialized root signatures are read through the host
d3d12.dllinto parameters, descriptor tables and static samplers (as Vulkan samplers). - Shader resources: the descriptor hash table and bindless set the translated shaders look their images and samplers up in, the buffer descriptors they read their buffers through (constant buffers, raw, structured and typed views), and the buffer window below 4 GB their buffer addresses point into.
Still needing the executable or another source: the device object and its method slots, how root arguments and the heap base reach the translated shaders' push constants (the last step before command lists can draw and dispatch), the console's descriptor sizes and its image and sampler descriptor words, the root signature to shader register mapping, mesh pipelines and presentation.
The shader set is built on your PC from your own copy, into the build folder, like the rest of the project. It is never committed or shared. With a checkout of the translator:
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON ^
-DANYBOX_GAME_PACKAGE=<package folder> -DANYBOX_SHADER_TRANSLATOR=<translator checkout>
cmake --build build
cmake --build build --target shaders # translate and build the shader store (about an hour)
cmake --build build --target shader_pipelines # create every pipeline on your GPU (hours; resumes if stopped)
ctest --test-dir build -L shaders --output-on-failure
The settings (worker count, wave64 emulation for 32-wide GPUs, pipeline chunk size, the size limit for modules too large for your PC's memory) and what each test checks are in Building shaders with the project.
Measured on one title's package (26,503 shaders) with an RTX 3070 Ti and 32 GB of RAM:
| Step | State |
|---|---|
| Translate to SPIR-V | ✅ 26,503 of 26,503 (72 minutes) |
| Shader store | ✅ 25,889 modules (614 containers are byte-identical copies), none missing, invalid or conflicting; the C++ store finds all 26,503 containers |
| GPU support | ✅ the GPU supports every feature the modules need |
| Title layout | ✅ every module fits the one descriptor layout and the 144-byte push constants |
| Compute sample through AnyBox's own pipeline code | ✅ 60 of 60, no validation errors |
| Bindless descriptors and buffer access on the GPU | ✅ 3,701 of 3,701 descriptor lookups; buffer windows below 4 GB of up to 2 GiB |
| The title's shaders through AnyBox's pipeline state code | ✅ 12 compute shaders and 8 vertex shaders with vertex inputs become pipelines from their own containers; the largest compute shader is refused in 0.3 s instead of a 75 GB compile; with the offline cache, the pipelines come back without compiling |
| Every pipeline created by the driver | |
| Shaders running in a title | ❌ needs the title's executable: device creation, command lists, root signatures and presentation follow from its calls |
What is not proven yet: that any translated shader computes the right values inside the title, and how the title binds its resources at run time. Both need the executable.
Per-title status lives in the Game bring-up discussions, one thread per title ID. Start a thread with the bring-up form and paste the line from python tools/run_report_summary.py anybox-report.json.
- Pick the top item on the needs page, which ranks what titles need and AnyBox lacks. Or audit a title you own with
python tools/import_audit.py <package> --needs docs/needs/<TitleId>.jsonand contribute the record so it counts. - Read CONTRIBUTING.md and the XTaskQueue implementation as a worked example.
- Open a pull request with the template. CI runs the conventions check and posts the progress change.
This project is intended for interoperability, research, preservation and compatibility. It does not include, distribute or require copyrighted software, firmware, cryptographic keys or proprietary libraries, and it does not decrypt or unpack protected packages. It works only on executables the user has already obtained in plain form, in accordance with applicable laws and license terms.
AnyBox is an independent project. It is not affiliated with, authorized or endorsed by any platform holder. All trademarks belong to their respective owners.
AnyBox is built to be like AnyPS5, for GDK titles.
GNU General Public License version 2 only. See LICENSE.