Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e925b63
d3d12_xs: route command queue slot 35 to ExecuteCommandLists
Vadson159 Nov 23, 2026
d3a1c29
d3d12: persist the pipeline cache across launches (D3D-704)
ddaikodaiko Nov 23, 2026
86cd0c5
d3d12: draw the console's rectangle lists (17, PSO type 19) and quad …
tedin7 Nov 23, 2026
a6b31d5
d3d12: rectangle list stage emits (v1 v2 v4) (v1 v4 v3) with capabili…
tedin7 Nov 23, 2026
a3da512
d3d12: checkpoint slow compute pipeline compiles
P2GR Nov 23, 2026
49410a5
d3d12: a slot-133 buffer whose pages are not imported is a shadow at …
tibzejoker Nov 23, 2026
14dc9af
d3d12: enable SSE4.1 for Clang's slot-133 streaming copy
venetanji Nov 23, 2026
ba5e9a3
local: merge #7604
Mumogg Nov 23, 2026
ccf9f87
local: merge #7286 with list-array unwrap
Mumogg Nov 23, 2026
d2b4538
Merge remote-tracking branch 'astro/ladder-frame' into local/ladder-f…
Mumogg Nov 23, 2026
ced3615
local: merge #7584 (docs conflict: ours)
Mumogg Nov 23, 2026
f90a017
Merge branch 'pr6446' into local/ladder-frame-wine
Mumogg Nov 23, 2026
97f0dcd
Merge branch 'pr8591' into local/ladder-frame-wine
Mumogg Nov 23, 2026
8c5ce53
local: wire #8591 into present_state_for
Mumogg Nov 23, 2026
bdab731
Merge branch 'pr7384' into local/ladder-frame-wine
Mumogg Nov 23, 2026
c4dc7e2
Merge branch 'pr7535' into local/ladder-frame-wine
Mumogg Nov 23, 2026
ab1fbff
d3d12: shaders reach a title-placed buffer through the root views and…
Etr0p Nov 23, 2026
7a8ae20
docs: section 3.3 says how shaders reach title-placed buffers
Etr0p Nov 23, 2026
d8ba5ff
local: trace PresentX
Mumogg Nov 23, 2026
6566800
d3d12: buffer addresses in the title's own memory reach a shader thro…
Etr0p Nov 23, 2026
d2f328e
d3d12: only the title's memory gets a copy; the table scan covers the…
Etr0p Nov 23, 2026
e997a1f
test: cs_user_data's root-view-to-table mode names its pointer target…
Etr0p Nov 23, 2026
6d7842a
d3d12: read LEONIDA_TITLE_WINDOWS_MB with getenv_s, as the file's oth…
Etr0p Nov 23, 2026
f9db5e6
d3d12: a bound table's slots the title wrote in its own heap backing …
Etr0p Nov 23, 2026
dbab003
d3d12: quad lists draw as triangle-list indices (0 1 2) (0 2 3) so fl…
tedin7 Nov 23, 2026
6d1f046
docs, comments: describe the title's VA by its range, not by a measur…
Etr0p Nov 23, 2026
81caaa1
d3d12: rect_list_geometry records that packed f16 attributes cannot b…
tedin7 Nov 23, 2026
e64653e
Merge branch 'pr7448' into local/ladder-frame-wine
Mumogg Nov 23, 2026
237f9e0
local: diagnostics (draw/present/clear/rect state), rect experiments
Mumogg Nov 23, 2026
f9896e0
local: merge #9137 (slot 133 kept as on ladder-frame)
Mumogg Nov 23, 2026
c9ea508
local: descriptor write-through and table mirror for title-backed hea…
Mumogg Nov 23, 2026
0c7ec65
local: apply #9419 (present dump) as a patch
Mumogg Nov 23, 2026
3a4ffa4
local: graphics stage layout experiment (s8), CB diagnostics
Mumogg Nov 23, 2026
902d594
local: slot 70 title views, rect fourth corner v1+v3-v2, diagnostics
Mumogg Nov 23, 2026
1a04df0
Merge main (9ec34cdff) into the frame-loop boot stack
Mumogg Nov 24, 2026
74bf391
merge follow-up: the test tree builds again
Mumogg Nov 24, 2026
35a9252
rect_list_geometry: the tested fourth-corner rule is the default agai…
Mumogg Nov 24, 2026
aba2409
Merge main (84347bbb6): the pipeline-library stage of #19 next to the…
Mumogg Nov 24, 2026
e0d4fd2
runtime: remove the local diagnostics and experiments; descriptor cop…
Mumogg Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ work on booting can start as soon as one is available to a developer.
| Audio banks (AWC: Opus, XMA2) | ✅ Exported whole. Opus repackaged **losslessly** as Ogg Opus; PCM (codec 0/2) as WAV; XMA2 decoded with ffmpeg. `--wav` adds 16-bit PCM WAV ([notes](docs/audio.md)) |
| Music/radio config | ? Measured. **1,589** audio-config records with exact durations and AWC stream ids; station grouping and content-id lists; no per-track start offsets ([notes](docs/audio_config.md)) |
| PE loader and import shims | ⚠️ Runs a stand-in executable end to end (`gta6rt --run`: CRT startup, statics, heap, files, threads, GDK imports through the shims, exit code back). Controllers through a GameInput shim on SDL3 (any controller SDL supports, rumble, DualSense trigger effects and lightbar; built when SDL3 is installed or with `-DLEONIDA_SDL3_FETCH=ON`, [notes](docs/gameinput.md)). `--trace-d3d12` logs every D3D12 call and its outcome for the first boot. Untested against the real executable |
| Xbox D3D12 → Vulkan | ⚠️ In progress. A Vulkan-backed device behind the Xbox-ABI proxy creates queues, command lists, fences, descriptor heaps, committed, placed and reserved resources, render-target and depth views (3D targets included), texture views and samplers (2D, cube, 1D and 3D views, the depth and stencil planes of depth-stencil textures, packed formats such as B5G6R5, B4G4R4A4 and R9G9B9E5, buffer SRVs — raw, structured and typed; they go into the bindless set), root signatures, pipelines and query heaps, and draws run on Vulkan. Barriers, clears, uploads, copies (BC included), colour resolves, predication, CPU-side texture reads and writes, and occlusion, timestamp and pipeline-statistics queries run on Vulkan, checked on one GPU. The console-shaped command-list proxy, the measured `PresentX` queue slots (30/32, layout-detected) wired to the presentation core, and `AllocateUploadMemory` (list slot 148, a mapped-upload arena whose addresses translate to buffer device addresses in root descriptors and IA/SO views) cover the console-ABI surface the package measures. Still open: the console list tail and the descriptor-table record model ([plan](docs/d3d12_vulkan.md)) |
| Xbox D3D12 → Vulkan | ⚠️ In progress. A Vulkan-backed device behind the Xbox-ABI proxy creates queues, command lists, fences, descriptor heaps, committed, placed and reserved resources, render-target and depth views (3D targets included), texture views and samplers (2D, cube, 1D and 3D views, the depth and stencil planes of depth-stencil textures, packed formats such as B5G6R5, B4G4R4A4 and R9G9B9E5, buffer SRVs — raw, structured and typed; they go into the bindless set), root signatures, pipelines and query heaps, and draws run on Vulkan. Barriers, clears, uploads, copies (BC included), colour resolves, predication, CPU-side texture reads and writes, and occlusion, timestamp and pipeline-statistics queries run on Vulkan, checked on one GPU. The console-shaped command-list proxy, the measured `PresentX` queue slots (30/32, layout-detected) wired to the presentation core, and `AllocateUploadMemory` (list slot 148, a mapped-upload arena whose addresses translate to buffer device addresses in root descriptors and IA/SO views) cover the console-ABI surface the package measures. Still open: the console list tail and the descriptor-table record model ([plan](docs/d3d12_vulkan.md), [console ABI](docs/d3d12_xs_console_abi.md)) |
| Ray tracing (BVH) | ⚠️ In progress. `BuildRaytracingAccelerationStructure` builds BLASes and TLASes on the GPU in the console's XDXR BVH4 layout (the default; `LEONIDA_RT_AS=khr` uses Vulkan's own acceleration structures instead), which the translated shaders walk themselves through `image_bvh_intersect_ray` (all four triangle node types, TRI0-TRI3, with the barycentric remap byte); the GPU builder writes TRI0 and TRI1 leaves. Updates refit instead of rebuilding, and clone, compaction and the compacted/current postbuild sizes work; checked against a CPU reference on synthetic scenes. The build descriptions are recovered from the package's `XboxBvhBuilder.dll` ([notes](docs/xdxr.md)). The game's `*_bvh4.rpf` packs are measured: offline-built, dehydrated BLASes that rehydrate through that DLL with their geometry from the drawables in `levels.rpf` (measured on 8 of the 10 sampled BLAS; [notes](docs/bvh.md)). Not done in the builder: serialization. TRI1 pairing (no memory saved yet) and BOX16 nodes for `MINIMIZE_MEMORY` BLASes (an assumed switch) are in ([notes](docs/bvh.md)). Open: whether the game rehydrates the packs or rebuilds them ([#313](https://github.com/ItsNotRexed/Leonida/issues/313)) |

The table above is written by hand. To measure it on your own checkout (unit and runtime tests, which rows of
Expand Down
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,18 @@ method, scope and caveats. No game data is included.
| [descriptor_lookup_intel.md](descriptor_lookup_intel.md) | Intel UHD Graphics 770 (Xe-LP, Windows, driver 101.6129) timings for the same lookups at 1k–100k live entries; both memory placements within 0.6% of each other. |
| [d3d12_xs_surface.md](d3d12_xs_surface.md) | The 116-slot `d3d12_xs.dll` export surface; 83/83 standard GUIDs match the PC SDK. |
| [xdxr.md](xdxr.md) | `BATCHED_DESC2` (`0x50`) and `XDXR_STREAM_DESC` (`0x10`) from `XboxBvhBuilder.dll`'s reads; stream records' offsets and defaults; offline statistics not in the package. |
| [d3d12_xs_console_abi.md](d3d12_xs_console_abi.md) | The D3D12.X console ABI the `d3d12_xs` shim must reproduce: device/queue/list vtable slots, command-list object fields and record encodings, root-argument SGPR rules, unified memory; sibling-layer measurements marked unverified here. |
| [d3d12_command_objects.md](d3d12_command_objects.md) | Measured command queue/list/fence/`PresentX` surface; verified vs prior art vs open. |
| [xbox_d3d12_xs.md](xbox_d3d12_xs.md) | The `d3d12_xs` graphics ABI quoted from Microsoft's public GDK reference: root signatures, state objects, DXIL libraries, hit groups, shader cache sessions; which pages are missing or NDA-gated. |
| [runtime_imports.md](runtime_imports.md) | The 16 shipped modules' measured imports and shim/host/unimplemented split. |
| [xmem_exe_calls.md](xmem_exe_calls.md) | How the retail executable calls `xmem.dll`: call sites and constant arguments per import (`tools/import_call_sites.py`), the 23 `XMemVirtualAlloc` calls that all pass an attribute word, and the inferred shape of the physical-page family. |
| [audio_hal_exe_calls.md](audio_hal_exe_calls.md) | How the retail executable calls the 22 audio coprocessor, texture layout and DirectStorage imports that have no shim: call sites, constant arguments, and the four calls with a negative-result branch. |
| [cpu_features.md](cpu_features.md) | CPU instructions in the executable a desktop CPU may lack (`tools/cpu_feature_scan.py`): 19 SSE4a, 10 CLZERO and 4 MONITORX/MWAITX sites (AMD only) and 8 CLWB sites (Intel since Ice Lake), all real code; `#UD` on hosts without them. |
| [xcl_compare.md](xcl_compare.md) | XCL's synthetic test title under `gta6rt --run` and under XCL (`tools/xcl_compare.py`): 5 of 50 checks pass here, both hangs are the documented manual-queue terminate deadlock, and each other difference mapped to an open item or a lead. |
| [directstorage.md](directstorage.md) | DirectStorage for the console title: the evidence for the DLL (`dstorage_xs.dll`, also `xcrdapi.dll`, `dstorage.dll`) and the console ABI with its confidence, and the shim: `GAME:` file open, queues, file and memory reads, status arrays, fences, events, cancel and errors; decompression and physical pages still open. |
| [gameinput.md](gameinput.md) | The GameInput shim on SDL3: `GameInputCreate` and the v0 `IGameInput`/`IGameInputDevice`/`IGameInputReading`/`IGameInputDispatcher` surface on any SDL gamepad, DualSense adaptive-trigger approximation and lightbar, force-feedback motors and trigger haptics through SDL's haptic API; 261 checks on virtual joysticks and a fake haptic backend; by hand on an Xbox Series X pad (Bluetooth) and a DualSense (USB). 261 checks on virtual joysticks and a fake haptic backend, not yet tried on a real pad. |
| [directstorage.md](directstorage.md) | DirectStorage for the console title: the evidence for the DLL (`dstorage_xs.dll`, also `xcrdapi.dll`, `dstorage.dll`) and the console ABI with its confidence, and the shim: `GAME:` file open, queues, file and memory reads, status arrays, fences, events, cancel and errors, zlib requests inflated with their `E_DSTORAGE_ZLIB_*` errors; BCPack, swizzle and physical pages still open. |
| [gameinput.md](gameinput.md) | The GameInput shim on SDL3: `GameInputCreate` and the v0 `IGameInput`/`IGameInputDevice`/`IGameInputReading`/`IGameInputDispatcher` surface on any SDL gamepad, DualSense adaptive-trigger approximation and lightbar, force-feedback motors and trigger haptics through SDL's haptic API; 261 checks on virtual joysticks and a fake haptic backend, not yet tried on a real pad. |
| [saves.md](saves.md) | Save containers: `JSAV` (index + JSON story save, byte-exact rebuild), `ASAV` header, `SLAYER1` packed copy (not decoded); `tools/saves.py` and import into the offline `XGameSave` folder; key hashes are case-sensitive joaat (`tools/save_keys.py`). |
| [pipeline_check.md](pipeline_check.md) | Driver-level corpus check: the full corpus, 26,503 of 26,503 modules and pipelines, 0 failures (RTX 4060 Ti); an earlier 10/12-shard run, 22,092 modules and 2,217 compute pipelines, also had 0 failures. Driver-level corpus check: 10/12 shards, 22,092 modules, 2,217 compute pipelines, 0 failures. |
| [multi_gpu_validation.md](multi_gpu_validation.md) | Running disjoint shards on eight identical RDNA1/RADV GPUs: PCI-BDF pinning, base controls, per-card logs, the V540 farm's aggregate results and its known driver limitations. |
Expand Down
15 changes: 11 additions & 4 deletions docs/d3d12_command_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,10 @@ section 3.5a), and the console list has methods well past the PC tail: 71, 73, 8
FSR DLL.

Slot 148 matters beyond the builder: the address it returns is written by the CPU and passed unchanged to the GPU
as a root SRV address, so console upload memory has the same address for the CPU and the GPU. A replacement must
return memory whose CPU pointer is also a valid GPU address (for this layer: inside the arena of
[d3d12_vulkan.md §3.3](d3d12_vulkan.md)).
as a root SRV address, so console upload memory has the same address for the CPU and the GPU. On a PC the two
address spaces differ, so `d3d12_xs_device.cpp` carves a bump arena out of persistently-mapped UPLOAD-heap
buffers: the title writes the mapped memory and the six root descriptor setters and the IA/SO view setters
translate the CPU pointer to the chunk's buffer device address before forwarding.

The function at `0xd580` uses the 71/73 pair instead of the slot-146 barrier when the byte at RVA `0xd773c` is set.
That byte is one of seven bools at `0xd7738`–`0xd773e` in zero-initialised `.bss`. The only accesses to them in
Expand Down Expand Up @@ -764,6 +765,12 @@ Queues and fences are wrapped the same way.
object implements but the proxy does not model is logged once and refused.
- **The refused tail.** A slot past the public chain, up to the end of the proxy's own table (128 queue and
64 fence slots, every one a thunk), logs its first four argument words once and returns `E_NOTIMPL`.
- **Fence slot 12.** The one served slot past the chain. The retail executable calls it as
`(value, descriptor, flags)` and reads the return as a pointer to the fence's 64-bit completed value: it
compares that value with `~0` (device removed) and subtracts the value it waits for. The proxy returns a
per-fence mirror. Completion events refresh it immediately. A 10 ms wait timeout also refreshes it if the
fence rewinds below the pending event's threshold. Slot 12 and the CPU `Signal` (10) refresh it synchronously.
The descriptor's second word is a code pointer, which is not called.
- **The guard region.** Each table sits at the end of the first page of a 64 KiB reservation, and the rest
of that reservation is never committed. A slot past the table therefore faults on the vtable read itself,
inside the reservation, and a vectored handler logs the slot before the fault goes on. A vtable read that
Expand Down Expand Up @@ -830,7 +837,7 @@ command object.
| Item | Why it is blocked |
|---|---|
| `PresentX` | No slot, signature, plane struct or swapchain/plane parameters. Prior art gives only names, the 2-plane/8-view limits and four flag names. |
| `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. |
| `CreateCommandQueueX` | No slot or parameter layout; only the UMD message and an inferred shape. The retail title calls device slot 48 as (desc, riid, out) with a 32-byte desc (#6954), which differs from the (pDesc, pShaderQueueParams, riid, out) shape inferred above. |
| `SuspendX` / `ResumeX` | No slot or signature. |
| Xbox queue/list/fence/allocator slot deviations | No runtime binary and no game executable; the package has no queue, fence or allocator client, and its only command-list client is the BVH builder. |
| Builder's list field `+0x350` | Read once (`0x1d877`) and not explained by the inline buffer of section 3.5a, which covers `+0x18`, `+0x28`, `+0x30`, `+0x140`, `+0x141`, `+0x344` and `+0x544`. |
Expand Down
Loading