
- Boots: No
- Release: None
- File: None
Leonida GDK Shims: How Xbox System Calls Run on Windows
Xbox system calls do not exist on Windows, so Leonida reimplements them with shims. This guide explains what a shim is and which layer it replaces.
Contents
What a Shim Is
A shim is a replacement layer. It presents the interface that calling code expects, and it carries out the request with the facilities that are actually available on the target system. In Leonida on Windows, the calling code expects Xbox operating system calls, and the target system is native Windows, where those Xbox calls do not exist. The shim sits between the two, so that code written for one system can call into the other without being rewritten call by call.
Static recompilation makes shims necessary rather than optional. Leonida keeps x86-64 code, so the processor instructions can carry over, but the operating system calls cannot, because Windows does not provide the Xbox calls that the code expects. A shim answers each expected call with Windows behaviour that matches the request as closely as the project defines. The quality of a shim is therefore judged by how faithfully each call is answered, not by how many calls are listed.
Shims are also a boundary for testing. A shim can be built and exercised without the full game, and its behaviour can be checked against the interface it claims to replace. That boundary is useful, and it is also a limit: a shim that works in isolation has not yet been shown to work under the full pattern of calls that real game code would make. The distinction between a built shim and a proven shim under real load is one to keep in mind through this guide.
The Three Shim Areas
The project names three shim areas: GDK, XMem, and d3d12_xs. Each name points to a different kind of Xbox facility. GDK covers the game development kit surface that game code uses to talk to the system. XMem covers memory facilities. The d3d12_xs surface covers the Xbox form of Direct3D 12. Naming the three areas separately matters, because a shim for one area does not cover another, and progress in one area does not imply progress in the others.
| Shim area | What it replaces | Why it is needed on Windows |
|---|---|---|
| GDK | Xbox system calls through the game development kit surface | Windows does not provide those Xbox calls |
| XMem | Xbox memory facilities | Windows memory facilities differ from the Xbox facilities the code expects |
| d3d12_xs | Xbox Direct3D 12 surface calls | The Xbox form of the calls must be answered for Windows graphics work |
Readers sometimes treat the word shim as if it meant a single small patch. In Leonida it means a layer with three named areas, each with its own calls to answer. When a project update mentions shims, the useful follow-up question is always which area it concerns, which calls it covers, and what test exercised it. A general statement about shims, without those details, does not tell a reader how much of the Xbox surface is actually answered.
GDK Calls in Detail
GDK is the surface through which game code reaches system services on Xbox. A GDK shim therefore has to answer the calls that game code makes through that surface, using Windows facilities underneath. The shim does not make Windows into Xbox. It translates each request at the boundary, so that the calling code sees the interface it expects while the work underneath is Windows work.
The difficulty in GDK shimming is fidelity at the boundary. A call that returns the wrong result, or that handles an edge case differently from the Xbox behaviour, can change what the calling code does next. That is why shim work is described here as reimplementation rather than as a simple rename. Reimplementation means the behaviour behind the interface must be built, not just the name of the interface.
Because the game does not boot, GDK shim behaviour cannot yet be judged by a run of the game. It can be judged by the interface it presents, by the calls it claims to cover, and by any tests that exercise it directly. Readers should treat claims about GDK shims in those terms, and should not read a built shim as proof that game code calling through GDK would behave correctly end to end.
XMem and Memory Calls
XMem covers the memory facilities that Xbox code expects. Memory calls control allocation, layout, and access patterns, and code that depends on those patterns can behave differently if the underlying facilities answer in a different way. An XMem shim must therefore answer memory requests in a way that preserves the expectations of the calling code, using Windows memory facilities underneath.
Memory shimming is easy to understate and hard to get right. A memory call that succeeds is not the same as a memory call that succeeds with the layout and lifetime the caller expects. The shim layer has to carry those expectations across the boundary, and any gap at that boundary can surface later, far from the call that caused it. That is why memory work deserves the same careful reading as graphics work, even though it produces no visible output on its own.
As with GDK, the current position limits what can be claimed. The shim areas are named, the approach is stated, and the game does not boot. XMem progress should be read as preparation of a layer that real game code would call, not as evidence that real game code has called it successfully. The loader stand-in run does not change that reading, because the stand-in is not the game.
D3D12_XS and Graphics Calls
The d3d12_xs area covers the Xbox form of Direct3D 12 calls. Those calls sit close to the graphics layer, where Leonida also converts DXBC to DXIL and D3D12, translates RDNA2 shaders to SPIR-V and Vulkan, and works on a D3D12 to Vulkan layer that is still in progress. The shim for d3d12_xs answers the Xbox graphics calls at the boundary, while the translation and conversion layers handle the shader and pipeline work underneath.
Keeping the shim and the graphics conversion separate helps readers judge each one fairly. A d3d12_xs shim can present the expected interface while the D3D12 to Vulkan conversion underneath is still in progress, and shader translation counts can grow while graphics calls remain unproven against real rendering work. The shader translation work for Leonida is measured in 26,503 shaders translated and validated, and that count belongs to the shader layer, not to the shim layer.
The graphics shim also shows why the missing executable matters for shims. Shims are built for calls that game code makes, and without game code, the full call pattern cannot be exercised. The shim can be present, the interface can be defined, and direct tests can pass, while the question of how the shim behaves under the real pattern of graphics calls stays open. That open question is normal for a project at this stage, and it should be stated plainly rather than filled in with assumption.
How Shims Fit the Whole Port
Shims are one part of the port, alongside keeping x86-64 code, translating shaders, exporting assets, converting DXBC, building the runtime, and running the loader. The explanation of how the Leonida port works puts shims in that wider picture, and readers who want the full sequence should read that guide alongside this one. No single part, shims included, is the whole port, and no single part can be judged as if it were.
The loader gives a concrete example of how parts combine without completing the whole. The Leonida loader and its stand-in show a loader that runs a stand-in end to end, which proves the loader path for that substitute. The shims sit on the path that real game code would take through the loader, and the stand-in run does not exercise that path in the same way. Both results are real, and both are limited, and the limit is the same in each case: the game code is absent.
The practical way to follow shim progress is to ask three questions of every update: which shim area is named, which calls are covered, and what test exercised them. If an update answers all three, it is informative. If it names shims in general without those details, it is a statement of direction rather than a measurement of progress. Leonida's stated facts support the careful reading, and the careful reading is the one this guide recommends.
Shims replace Xbox calls on Windows. They do not make the game boot, and the game does not boot. There are 0 releases and 0 tags.
Conclusion
GDK shims, XMem shims, and d3d12_xs shims together form the layer that lets Xbox system calls be answered on native Windows. The layer is necessary because static recompilation keeps x86-64 code while the operating system calls it expects do not exist on Windows. Each area, GDK, memory, and graphics calls, must be reimplemented with its own fidelity, and each area must be judged on the calls it covers and the tests that exercise it.
The honest endpoint remains that the game does not boot, there are 0 releases and 0 tags, and the loader runs a stand-in rather than game code. Shims prepare the boundary that game code would cross, and that preparation is substantial work. It is not a substitute for the crossing itself, and readers should keep that distinction whenever shim progress is discussed.
Frequently Asked Questions
What is a shim in Leonida?
A shim is a replacement layer that presents the Xbox interface calling code expects and carries out the request with Windows facilities. Leonida shims Xbox operating system calls covering GDK, XMem, and d3d12_xs.
Do shims make Windows behave like Xbox?
No. A shim translates requests at the boundary. It does not turn Windows into Xbox, and it does not prove that game code would behave correctly end to end, because the game does not boot.
Which shim areas does Leonida name?
Three areas are named: GDK for system calls, XMem for memory facilities, and d3d12_xs for the Xbox form of Direct3D 12 calls. Each area must be judged separately.