feat(d3d12_x): title bring-up to the game world: mesh pipelines, indirect argument check, console device #81

Manually merged
github merged 10 commits from gh-pr/81/head into gh-pr/81/base 2026-11-26 19:18:07 +00:00
Owner

@⁠Dark3581 on GitHub · 2026-11-25 00:27 UTC · original
Dark3581:feat/title-imports → main · +20953 −259 · 209 files · 10 commits · merged 2026-11-25 00:31 UTC

What

Title bring-up work that takes title 7952987A from boot to its game world, squashed from the bring-up branch:

  • Device and objects: the console D3D12 device, object facades, physical page windows, title allocation hooks, console list slots (barriers, queries, predication, fills, transient allocations), cross-queue memory waits and labels without blocking waits, presenter recreation.
  • Pipelines: graphics and mesh pipelines. A stream with a mesh shader in subobject 24 and no subobject 25 is built as a mesh pipeline. The mesh stage's root-word registers are moved from s16 to s8, where the pixel stage reads them (vulkan/UserDataRebase.cpp). Mesh dispatches run as vkCmdDrawMeshTasks*EXT. Graphics pipelines build in the background only from the pipeline cache, and otherwise when a draw first uses them. Background workers are configurable (d3d12_x.pipeline_workers), and the pipeline cache is saved during the run.
  • GPU-side indirect argument check (commands/IndirectClamp.*): indirect dispatch and mesh dispatch records are checked on the GPU. A record over the device's limits runs empty instead of hanging the GPU.
  • Title textures: GFX10 tiling and XG layouts. Textures are re-uploaded when title memory changes; uploads are submitted without waiting for the GPU. Depth-stencil passes that are read-only for one plane are supported.
  • Runtime and libraries: title watchdog pause setting, thread dumps on request, title memory below 1 TiB, XDsp state blocks, launch and display-timeout API table, GameInput objects and gamepad, persistent local storage, game saves.
  • Tests: stale tests updated to the current behaviour; pso_probe compiles again; MSVC fixes (_ReturnAddress, a variable named small).
  • Docs: bring-up status page with the first in-game HUD; new settings documented.

BCPack-compressed DirectStorage reads stop with a message: this tree has no BCPack decoder.

Tested

Windows 10, RTX 3070 Ti 8 GB.

Check Result
MinGW (WinLibs GCC 15.2 UCRT, Ninja, Release) full build passes
CTest 86/86 (pipeline_probe skipped, needs its GPU environment)
MSVC 19.42 full build passes
python -m unittest discover -s tools/tests 97/97
tools/debt_fold.py --check 32 fragments apply cleanly
tools/readme_docs.py --check up to date
tools/check_conventions.py only the subjects of the squashed wip: commits
Title 7952987A 1.0.2.1 boots, loads into the game world (HUD renders, gameplay telemetry fires); the world is still black and runs at 1–6 fps on a first run

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR (bring-up branch, squashed)
  • python tools/check_conventions.py passes for the code (no comments, one declaration per export); the squashed wip: subjects are the only findings
  • Unimplemented paths stop (AbxNotImplemented / AbxUnsupported)
  • Known gaps through docs/dev/debt/changes/
  • Generic behaviour, not specific to one title (title-specific values are settings)
  • No game files, keys, notes or logs added to the repository (one screenshot of the HUD in the docs)
  • Depends on: none
  • Fixes: none
  • Unblocks: 7952987A
  • Source of behaviour: measured on the title's calls and disassembly
  • AI-assisted: yes
**@⁠Dark3581** on GitHub · 2026-11-25 00:27 UTC · [original](https://github.com/Dark3581/AnyBox/pull/81) `Dark3581:feat/title-imports` → `main` · +20953 −259 · 209 files · 10 commits · merged 2026-11-25 00:31 UTC ### What Title bring-up work that takes title 7952987A from boot to its game world, squashed from the bring-up branch: - **Device and objects:** the console D3D12 device, object facades, physical page windows, title allocation hooks, console list slots (barriers, queries, predication, fills, transient allocations), cross-queue memory waits and labels without blocking waits, presenter recreation. - **Pipelines:** graphics and mesh pipelines. A stream with a mesh shader in subobject 24 and no subobject 25 is built as a mesh pipeline. The mesh stage's root-word registers are moved from s16 to s8, where the pixel stage reads them (`vulkan/UserDataRebase.cpp`). Mesh dispatches run as `vkCmdDrawMeshTasks*EXT`. Graphics pipelines build in the background only from the pipeline cache, and otherwise when a draw first uses them. Background workers are configurable (`d3d12_x.pipeline_workers`), and the pipeline cache is saved during the run. - **GPU-side indirect argument check** (`commands/IndirectClamp.*`): indirect dispatch and mesh dispatch records are checked on the GPU. A record over the device's limits runs empty instead of hanging the GPU. - **Title textures:** GFX10 tiling and XG layouts. Textures are re-uploaded when title memory changes; uploads are submitted without waiting for the GPU. Depth-stencil passes that are read-only for one plane are supported. - **Runtime and libraries:** title watchdog pause setting, thread dumps on request, title memory below 1 TiB, XDsp state blocks, launch and display-timeout API table, GameInput objects and gamepad, persistent local storage, game saves. - **Tests:** stale tests updated to the current behaviour; `pso_probe` compiles again; MSVC fixes (`_ReturnAddress`, a variable named `small`). - **Docs:** bring-up status page with the first in-game HUD; new settings documented. BCPack-compressed DirectStorage reads stop with a message: this tree has no BCPack decoder. ### Tested Windows 10, RTX 3070 Ti 8 GB. | Check | Result | |---|---| | MinGW (WinLibs GCC 15.2 UCRT, Ninja, Release) full build | passes | | CTest | 86/86 (`pipeline_probe` skipped, needs its GPU environment) | | MSVC 19.42 full build | passes | | `python -m unittest discover -s tools/tests` | 97/97 | | `tools/debt_fold.py --check` | 32 fragments apply cleanly | | `tools/readme_docs.py --check` | up to date | | `tools/check_conventions.py` | only the subjects of the squashed `wip:` commits | | Title 7952987A 1.0.2.1 | boots, loads into the game world (HUD renders, gameplay telemetry fires); the world is still black and runs at 1–6 fps on a first run | ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [ ] One topic per PR; follow-ups go in a new PR (bring-up branch, squashed) - [x] `python tools/check_conventions.py` passes for the code (no comments, one declaration per export); the squashed `wip:` subjects are the only findings - [x] Unimplemented paths stop (`AbxNotImplemented` / `AbxUnsupported`) - [x] Known gaps through `docs/dev/debt/changes/` - [x] Generic behaviour, not specific to one title (title-specific values are settings) - [x] No game files, keys, notes or logs added to the repository (one screenshot of the HUD in the docs) - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: 7952987A - [x] Source of behaviour: measured on the title's calls and disassembly - [x] AI-assisted: yes
Boot loop progress on a title package: device slots measured from call sites, console facades for every object handed out, physical page windows on placeholders, title allocation hooks, descriptor increments from settings, and a CPU fixup for clwb.
T# words follow AMD's RDNA2 ISA guide (Tables 45 and 47, format numbering confirmed against the translated shaders' integer-format tables); committed textures also take their size from the title's allocator; device slots 16, 27, 39, 41, 62 and object SetName.
Slot 61 sampler descriptions decode to D3D12_FILTER exactly (the title's flags word is a D3D12_FILTER); S# words follow AMD's RDNA2 Table 46 and are registered in the bindless set; image and sampler words are encoded in every heap so copies carry them; slot 24 CopyDescriptorsSimple; slot 74 records title memory registered with the device.
The title reaches its first present into its window. DirectStorage queues execute file and memory requests with zlib (3rdparty/zlib v1.3.1); XG suggests linear layouts and copies subresources; pipeline state streams, mesh pipelines and native-code pipelines (unbuilt, blobs dumped); enhanced barriers translate to resource states; clzero, monitorx, mwaitx and insertq are emulated; physical frames are numbered in 4 KiB units; fence values are mirrored to memory; frame events are paced.
Graphics:
- pipeline streams with a mesh shader in subobject 24 and no subobject 25
  are built as mesh pipelines; the mesh stage's root-word registers are moved
  from s16 to s8, where the pixel stage reads them (UserDataRebase)
- mesh dispatches and indirect mesh dispatches run as vkCmdDrawMeshTasks*EXT
- indirect dispatch and mesh dispatch records are copied and checked on the
  GPU first; records over the device's group limits run empty instead of
  hanging the GPU (IndirectClamp)
- graphics pipelines build in the background only from the pipeline cache;
  a pipeline that needs a compile waits until a draw first uses it
- background pipeline workers: half the hardware threads at lowest priority,
  d3d12_x.pipeline_workers
- title texture uploads are submitted without waiting for the GPU; staging
  memory is freed when the batch's fence signals
- depth-stencil passes read-only for one plane use the mixed Vulkan layouts
- queries, predication, fills, transient allocations, depth and plane copies
  through a buffer, attachment-less draws, cross-queue memory waits and labels
  without blocking waits, shared copy scratch buffers, presenter recreation,
  pipeline cache saving, live memory statistics

Runtime and libraries:
- title watchdog pause setting, thread dumps on request, hardware write watch
- title memory reserved below 1 TiB (40-bit console GPU addresses)
- XDspActivate and XDspDeactivate state blocks, launch and display timeout
  API table, GFX10 tiling and XG layouts, GameInput objects and gamepad

Tests and docs:
- stale tests updated: the stub scenario uses XUserGetState, module_check
  uses D3D12GetDebugInterface, the T: drive folder, XMemAllocDefault traces,
  conservative rasterization and mesh command signatures are accepted,
  texture flags, clamped view ranges, ID3D12Fence1 in pso_probe
- MSVC: return address through _ReturnAddress, no variable named small
- bring-up status page with the first in-game HUD, new settings documented

BCPack-compressed DirectStorage reads stop with a message: there is no
BCPack decoder in this tree.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:18:05 +00:00
github manually merged commit 3ec2dfa8cc into gh-pr/81/base 2026-11-26 19:18:07 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-25 00:28 UTC · original

Progress report (9f53c52 → 3ec2dfa)

📈 Libraries: 36.09% (+8.3354%, +54 implemented, +42 declared functions)

✅ 54 implemented
Library Name
acphal AcpHalAllocateShapeContexts
acphal AcpHalCreate
acphal AcpHalReleaseShapeContexts
acphal ApuAlloc
acphal ApuCreateHeap
acphal ApuIsVirtualAddressValid
acphal ApuMapApuAddress
acphal ApuMapVirtualAddress
chad XDspActivate
chad XDspConnectWithMaximumStreamLimit
chad XDspDeactivate
chad XDspSubmitCommand
d3d12_x AbxD3D12TitleHostView
d3d12_x D3D12ConfigureVirtualMemoryX
d3d12_x D3D12XboxCreateDevice
gameinput GameInputCreate
xapu XApuConnect
xapu XApuDisconnect
xapu XApuEnqueueCommand
xapu XApuGetResultCount
xcrdapi DStorageGetFactory
xg XGCreateTextureComputer
xg XGSuggestSwizzleMode
xgameruntime AbxUserCloseHandle
xgameruntime AbxUserDuplicateHandle
xgameruntime AbxUserGetIdentifier
xgameruntime XDisplayTryEnableHdrMode
xgameruntime XPackageEnumeratePackages
xgameruntime XPersistentLocalStorageGetPath
xgameruntime XPersistentLocalStorageGetPathSize
xgameruntime XPersistentLocalStorageGetSpaceInfo
xgameruntime XPersistentLocalStoragePromptUserForSpaceAsync
xgameruntime XPersistentLocalStoragePromptUserForSpaceResult
xgameruntime XUserAddAsync
xgameruntime XUserAddResult
xgameruntime XUserCheckPrivilege
xgameruntime XUserGetAgeGroup
xgameruntime XUserGetGamertag
xgameruntime XUserGetIsGuest
xmem AbxXMemAnnounceWritten
xmem AbxXMemMapFrameAt
xmem AbxXMemMirrorPhysicalPage
xmem AbxXMemPhysicalPageView
xmem AbxXMemPhysicalViewAt
xmem AbxXMemWatchGpuMemory
xmem XMemAllocDefault
xmem XMemAllocatePhysicalPages
xmem XMemFreeDefault
xmem XMemFreePhysicalPages
xmem XMemIsToolsMemAvailable
xmem XMemMapPhysicalPages
xmem XMemMapPhysicalPagesScatter
xmem XMemTransferMemory
xmem XMemVirtualAlloc
🆕 3 declared as stubs
Library Name
acphal ApuFree
chad XDspDisconnect
xapu XApuDequeueResult

Changed libraries

Library Before After Change
acphal Not present 8/9 (88.89%) n/a
chad Not present 4/5 (80%) n/a
d3d12_x 4/7 (57.14%) 7/9 (77.78%) +20.63%
gameinput 1/1 (100%) 1/1 (100%) +0.00%
xapu Not present 4/5 (80%) n/a
xcrdapi Not present 1/1 (100%) n/a
xg Not present 2/2 (100%) n/a
xgameruntime 72/397 (18.14%) 88/400 (22%) +3.86%
xmem 4/4 (100%) 19/19 (100%) +0.00%
**@⁠github-actions[bot]** on GitHub · 2026-11-25 00:28 UTC · [original](https://github.com/Dark3581/AnyBox/pull/81#issuecomment-7148547117) <!-- progress-report --> ### Progress report (9f53c52 → 3ec2dfa) 📈 **Libraries**: 36.09% (+8.3354%, +54 implemented, +42 declared functions) <details> <summary>✅ 54 implemented</summary> | Library | Name | | - | - | | acphal | `AcpHalAllocateShapeContexts` | | acphal | `AcpHalCreate` | | acphal | `AcpHalReleaseShapeContexts` | | acphal | `ApuAlloc` | | acphal | `ApuCreateHeap` | | acphal | `ApuIsVirtualAddressValid` | | acphal | `ApuMapApuAddress` | | acphal | `ApuMapVirtualAddress` | | chad | `XDspActivate` | | chad | `XDspConnectWithMaximumStreamLimit` | | chad | `XDspDeactivate` | | chad | `XDspSubmitCommand` | | d3d12_x | `AbxD3D12TitleHostView` | | d3d12_x | `D3D12ConfigureVirtualMemoryX` | | d3d12_x | `D3D12XboxCreateDevice` | | gameinput | `GameInputCreate` | | xapu | `XApuConnect` | | xapu | `XApuDisconnect` | | xapu | `XApuEnqueueCommand` | | xapu | `XApuGetResultCount` | | xcrdapi | `DStorageGetFactory` | | xg | `XGCreateTextureComputer` | | xg | `XGSuggestSwizzleMode` | | xgameruntime | `AbxUserCloseHandle` | | xgameruntime | `AbxUserDuplicateHandle` | | xgameruntime | `AbxUserGetIdentifier` | | xgameruntime | `XDisplayTryEnableHdrMode` | | xgameruntime | `XPackageEnumeratePackages` | | xgameruntime | `XPersistentLocalStorageGetPath` | | xgameruntime | `XPersistentLocalStorageGetPathSize` | | xgameruntime | `XPersistentLocalStorageGetSpaceInfo` | | xgameruntime | `XPersistentLocalStoragePromptUserForSpaceAsync` | | xgameruntime | `XPersistentLocalStoragePromptUserForSpaceResult` | | xgameruntime | `XUserAddAsync` | | xgameruntime | `XUserAddResult` | | xgameruntime | `XUserCheckPrivilege` | | xgameruntime | `XUserGetAgeGroup` | | xgameruntime | `XUserGetGamertag` | | xgameruntime | `XUserGetIsGuest` | | xmem | `AbxXMemAnnounceWritten` | | xmem | `AbxXMemMapFrameAt` | | xmem | `AbxXMemMirrorPhysicalPage` | | xmem | `AbxXMemPhysicalPageView` | | xmem | `AbxXMemPhysicalViewAt` | | xmem | `AbxXMemWatchGpuMemory` | | xmem | `XMemAllocDefault` | | xmem | `XMemAllocatePhysicalPages` | | xmem | `XMemFreeDefault` | | xmem | `XMemFreePhysicalPages` | | xmem | `XMemIsToolsMemAvailable` | | xmem | `XMemMapPhysicalPages` | | xmem | `XMemMapPhysicalPagesScatter` | | xmem | `XMemTransferMemory` | | xmem | `XMemVirtualAlloc` | </details> <details> <summary>🆕 3 declared as stubs</summary> | Library | Name | | - | - | | acphal | `ApuFree` | | chad | `XDspDisconnect` | | xapu | `XApuDequeueResult` | </details> #### Changed libraries | Library | Before | After | Change | | - | - | - | - | | acphal | Not present | 8/9 (88.89%) | n/a | | chad | Not present | 4/5 (80%) | n/a | | d3d12_x | 4/7 (57.14%) | 7/9 (77.78%) | +20.63% | | gameinput | 1/1 (100%) | 1/1 (100%) | +0.00% | | xapu | Not present | 4/5 (80%) | n/a | | xcrdapi | Not present | 1/1 (100%) | n/a | | xg | Not present | 2/2 (100%) | n/a | | xgameruntime | 72/397 (18.14%) | 88/400 (22%) | +3.86% | | xmem | 4/4 (100%) | 19/19 (100%) | +0.00% |
This discussion has been locked. Commenting is limited to contributors.
No description provided.