d3d12: the title's startup command signatures are created (argument type 105, DISPATCH_MESH), again (RT-SLOT41) #377

Manually merged
github merged 5 commits from gh-pr/377/head into gh-pr/377/base 2026-11-26 08:56:28 +00:00
Owner

@⁠Mumogg on GitHub · 2026-11-24 04:11 UTC · original
Mumogg:slot41-command-signatures → main · +142 −5 · 8 files · 5 commits · merged 2026-11-24 22:52 UTC

Claimed in #14 as RT-SLOT41. Depends on: #349, #350, #356, #362, #369, #375 (their commits come first here; this pull request is the last three commits).

What and why

After #375 the title creates five one-argument command signatures at startup through device slot 41 (CreateCommandSignature at its PC position) and stops when one is refused: its device set-up returns false and it hits its own int3. Two of the five are refused on main:

Commit Author What
4c04c0f4e mrp1no a console indirect argument of type 105 (12-byte stride) is created as DISPATCH; slot 41 gets its own handler
084c8c60e mrp1no the type is read as its 32 bits, because a constant expression that casts 105 to the enum does not compile with clang-cl
efc347830 NiiRoZz the Vulkan layer creates a DISPATCH_MESH signature on a device with mesh shaders; ExecuteIndirect with it records nothing yet and says so once

All three are cherry-picked with -x and keep their authors; all are ancestors of main whose content is not in the tree. Conflicts were neighbours only (slot lists, the mock's cases), except one: in d3d12_com.cpp the last commit carried a copy of the argument-range validation that main no longer has at that place, so I kept only its early return for DISPATCH_MESH.

I applied them one at a time: with the first two alone the run still ends at the same stop, and the third is what lets it go on. So both refusals are real here.

Measured

Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on main ece4ba5b3, with #142 and #328 applied on top for the boot runs (they are not in this branch).

--run Ends with
up to #375 the title's int3 after its device set-up returns false; last slot called: 41
+ this further on; the last new slot called is 61

The count of traced D3D12 calls is 1,655 in both (CreateCommandSignature is not one of the traced calls). The log line slot 41 argument type 105 (stride 12) created as DISPATCH appears once. The next stop is device slot 61, forwarded as it is; on the console that slot writes a sampler to a descriptor handle.

  • xs_proxy_mock_test under Wine passes, with the slot 41 case (type 105 reaches the PC slot as a copy with DISPATCH).
  • d3d12_mesh_test under Wine passes on the RTX 5070 Ti (mesh tier 1), with the commit's DISPATCH_MESH signature case.

Not built with MSVC and not run on Windows.

AI-assisted (Claude Code); built and run on the machine above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt

**@⁠Mumogg** on GitHub · 2026-11-24 04:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/377) `Mumogg:slot41-command-signatures` → `main` · +142 −5 · 8 files · 5 commits · merged 2026-11-24 22:52 UTC Claimed in #14 as `RT-SLOT41`. Depends on: #349, #350, #356, #362, #369, #375 (their commits come first here; this pull request is the last three commits). ### What and why After #375 the title creates five one-argument command signatures at startup through device slot 41 (`CreateCommandSignature` at its PC position) and stops when one is refused: its device set-up returns false and it hits its own `int3`. Two of the five are refused on `main`: | Commit | Author | What | |---|---|---| | `4c04c0f4e` | mrp1no | a console indirect argument of type 105 (12-byte stride) is created as `DISPATCH`; slot 41 gets its own handler | | `084c8c60e` | mrp1no | the type is read as its 32 bits, because a constant expression that casts 105 to the enum does not compile with clang-cl | | `efc347830` | NiiRoZz | the Vulkan layer creates a `DISPATCH_MESH` signature on a device with mesh shaders; `ExecuteIndirect` with it records nothing yet and says so once | All three are cherry-picked with `-x` and keep their authors; all are ancestors of `main` whose content is not in the tree. Conflicts were neighbours only (slot lists, the mock's cases), except one: in `d3d12_com.cpp` the last commit carried a copy of the argument-range validation that `main` no longer has at that place, so I kept only its early return for `DISPATCH_MESH`. I applied them one at a time: with the first two alone the run still ends at the same stop, and the third is what lets it go on. So both refusals are real here. ### Measured Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on `main` `ece4ba5b3`, with #142 and #328 applied on top for the boot runs (they are not in this branch). | `--run` | Ends with | |---|---| | up to #375 | the title's `int3` after its device set-up returns false; last slot called: 41 | | + this | further on; the last new slot called is 61 | The count of traced D3D12 calls is 1,655 in both (`CreateCommandSignature` is not one of the traced calls). The log line `slot 41 argument type 105 (stride 12) created as DISPATCH` appears once. The next stop is device slot 61, forwarded as it is; on the console that slot writes a sampler to a descriptor handle. - `xs_proxy_mock_test` under Wine passes, with the slot 41 case (type 105 reaches the PC slot as a copy with `DISPATCH`). - `d3d12_mesh_test` under Wine passes on the RTX 5070 Ti (mesh tier 1), with the commit's `DISPATCH_MESH` signature case. Not built with MSVC and not run on Windows. AI-assisted (Claude Code); built and run on the machine above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
The retail title creates five one-argument command signatures with no root
signature at startup (device slot 41, CreateCommandSignature at its PC
position). One has the console argument type 105 and a 12-byte stride, next
to a DISPATCH and a DISPATCH_MESH of 12 bytes. The PC layer refuses the
unknown type, which is stop 19 of the RT-5 boot measurements.

Read statically from the title's call sites (shapes only): the two
ExecuteIndirect sites of that signature pass MaxCommandCount 1 and an offset
into the same argument buffer as the DISPATCH sites. Right before, they set
the same compute state as the DISPATCH path (pipeline, compute root signature,
tables, constants, SRV and UAV); they record on a second command list of the
title's context. So the argument is taken as a D3D12_DISPATCH_ARGUMENTS.

Slot 41 now has its own handler. A description that holds type 105 is copied
with that type replaced by DISPATCH (logged once). Any other description is
forwarded as the same pointer. What the console does differently for type 105
is left open in docs/d3d12_vulkan.md (section 4.9).

xs_proxy_mock_test: a two-argument description (a root constant, then type
105) reaches the PC slot 41 as a copy with DISPATCH, the same stride, count,
root signature, IID and output, and the caller's description is untouched; a
PC description is passed through unchanged. With main's d3d12_xs_device.cpp
the new check fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4c04c0f4e3)
105 is outside D3D12_INDIRECT_ARGUMENT_TYPE's range [0, 15], so clang-cl
rejects a constant expression that casts it to the enum (reported by
umnitus on #7163). The handler now reads each argument's Type field as a
uint32_t through memcpy and compares it with 105; the test writes and reads
the raw value the same way, and the mock records it the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 084c8c60e7)
The Vulkan layer created signatures for draw, draw-indexed and dispatch only and answered E_NOTIMPL
for DISPATCH_MESH, which the PC runtime creates on any mesh-shader tier 1 device. A title that
creates such a signature at startup and asserts on the result stopped there.

The signature is created when the device has VK_EXT_mesh_shader (MeshShaderTier 1), as a new
IndirectKind::dispatch_mesh (the name and value #3777 uses, so the two merge). ExecuteIndirect with
it records nothing yet and says so once; #3777 replays it as vkCmdDrawMeshTasksIndirectEXT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit efc347830b)
Resolving the cherry-pick of efc347830 I dropped main's record-size, stride and span checks (e1ec785b2), which
d3d12_execute_indirect_validation_test depends on and which matter to every D3D12 user (found in review on
#377). They are back as on main, the record-size chain knows D3D12_DISPATCH_MESH_ARGUMENTS, and the early
return for a DISPATCH_MESH signature comes after the checks.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:56:27 +00:00
github manually merged commit 438859b525 into gh-pr/377/base 2026-11-26 08:56:28 +00:00
github-bot referenced this pull request from a commit 2026-11-26 08:56:28 +00:00
Author
Owner

@⁠ubiquitarianism on GitHub · 2026-11-24 04:51 UTC · original

Holding this, and the PRs stacked on it (#383, #385, #391, #395, #396), on one regression. The d3d12_com.cpp conflict resolution drops main's ExecuteIndirect validation: the record-size, stride and max_count * stride span checks from e1ec785b2. That block is still on main at that spot, and d3d12_execute_indirect_validation_test's out-of-bounds and stride cases depend on it. It also matters for every D3D12 user, not just the retail boot.

Please restore the block, add dispatch_mesh ? sizeof(D3D12_DISPATCH_MESH_ARGUMENTS) to the record-size chain, and put the DISPATCH_MESH early return after the checks.

Two small notes for the PRs above it:

  • #383 passes dest to proxy_create_sampler_x untranslated; it should go through translate_cpu_handle from #375.
  • #385's slot-74 S_OK stand-in and #395's recorded-but-never-called allocator callback need a row in docs/d3d12_vulkan.md / docs/retail_boot_chain.md.

#362, #369 and #375 are being merged after a Windows build.

**@⁠ubiquitarianism** on GitHub · 2026-11-24 04:51 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/377#issuecomment-7122399095) Holding this, and the PRs stacked on it (#383, #385, #391, #395, #396), on one regression. The `d3d12_com.cpp` conflict resolution drops main's ExecuteIndirect validation: the record-size, stride and `max_count * stride` span checks from e1ec785b2. That block is still on main at that spot, and `d3d12_execute_indirect_validation_test`'s out-of-bounds and stride cases depend on it. It also matters for every D3D12 user, not just the retail boot. Please restore the block, add `dispatch_mesh ? sizeof(D3D12_DISPATCH_MESH_ARGUMENTS)` to the record-size chain, and put the DISPATCH_MESH early return after the checks. Two small notes for the PRs above it: - #383 passes `dest` to `proxy_create_sampler_x` untranslated; it should go through `translate_cpu_handle` from #375. - #385's slot-74 `S_OK` stand-in and #395's recorded-but-never-called allocator callback need a row in `docs/d3d12_vulkan.md` / `docs/retail_boot_chain.md`. #362, #369 and #375 are being merged after a Windows build.
Author
Owner

@⁠Mumogg on GitHub · 2026-11-24 09:54 UTC · original

Fixed, and sorry for that one: resolving the cherry-pick I dropped main's block.

  • ExecuteIndirect has the record-size, stride and span checks back exactly as on main, the record-size chain has dispatch_mesh ? sizeof(D3D12_DISPATCH_MESH_ARGUMENTS), and the DISPATCH_MESH early return comes after the checks. The diff of d3d12_com.cpp against main in that function is now only those two additions. d3d12_execute_indirect_validation and d3d12_mesh pass under Wine (RTX 5070 Ti, driver 615.78.08).
  • #383: the destination goes through translate_cpu_handle.
  • #385 and #395: each has a row in the Xbox-only table of docs/d3d12_vulkan.md, both marked as stand-ins, with what is open.

Everything from #375 to #432 is rebased on main d7576d56a; #375 has the scoping for the three Windows failures (details there; I cannot run device_proxy_test under Wine, it needs WARP).

AI-assisted.

**@⁠Mumogg** on GitHub · 2026-11-24 09:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/377#issuecomment-7128061194) Fixed, and sorry for that one: resolving the cherry-pick I dropped `main`'s block. - `ExecuteIndirect` has the record-size, stride and span checks back exactly as on `main`, the record-size chain has `dispatch_mesh ? sizeof(D3D12_DISPATCH_MESH_ARGUMENTS)`, and the DISPATCH_MESH early return comes after the checks. The diff of `d3d12_com.cpp` against `main` in that function is now only those two additions. `d3d12_execute_indirect_validation` and `d3d12_mesh` pass under Wine (RTX 5070 Ti, driver 615.78.08). - #383: the destination goes through `translate_cpu_handle`. - #385 and #395: each has a row in the Xbox-only table of `docs/d3d12_vulkan.md`, both marked as stand-ins, with what is open. Everything from #375 to #432 is rebased on `main` `d7576d56a`; #375 has the scoping for the three Windows failures (details there; I cannot run `device_proxy_test` under Wine, it needs WARP). AI-assisted.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 22:52 UTC · original

Merged. Mumogg is still away and this is the next rung on main's boot path (device slot 41, where the title stops once #375 is in), so I brought the branch up to date the same way as #375: one merge commit of main (9f25f1ef2) on top of 88b8dbad9 (438859b52). Mumogg's commits are untouched and nothing was force-pushed.

Conflicts: two.

  • runtime/shims/d3d12_com.cpp: ExecuteIndirect keeps main's argument-range rule from #1066 with its comment, and this PR's DISPATCH_MESH early return follows the checks. The PR's older max_count * stride check is gone, because #1066 replaced it on main.
  • docs/d3d12_vulkan.md: both table rows kept (argument type 105, then slot 81 / PresentX).

The hold (the owner's comment of 04:51 UTC, answered by Mumogg in 88b8dbad9): its three points are in the merged code.

  • The record-size, stride and range checks are there; the range check is now #1066's rule.
  • The record-size chain has dispatch_mesh ? sizeof(D3D12_DISPATCH_MESH_ARGUMENTS).
  • The DISPATCH_MESH return comes after the checks.
  • d3d12_execute_indirect_validation passes on both devices.

Tests (Linux; clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU):

  • Linux portable ctest: 72 pass and 2 skipped, on main and on the branch.
  • Full Windows suite under Wine, the branch against main 9f25f1ef2: no test changed state on either device.
  • Repeated on main 89d7dfcf5 + the branch, against a baseline of the same main (it had moved by two runtime/ merges, #615 and #992): the iGPU run is unchanged; on llvmpipe one test, run_tiny_gdk_load, failed once and passes when the 17 run_tiny* tests are re-run alone on the same build, so it was a collision between the two parallel device runs.
  • xs_proxy_mock passes on both devices. d3d12_mesh passes on llvmpipe with the new case, and fails on the iGPU at a pipeline-statistics check exactly as on main.
  • Not run here: MSVC, native Windows, a mesh-capable discrete GPU, and the game itself. Mumogg's own run reports the title past slot 41, with the next stop at slot 61.

Notes for later, none blocking:

  • Argument type 105 as DISPATCH is marked as a hypothesis in this PR, and a mesh ExecuteIndirect records nothing yet (it is logged once).
  • A code comment cites #3777, a number from the old repository that links nowhere now.

#383 is the next rung.

AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 22:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/377#issuecomment-7146737711) Merged. Mumogg is still away and this is the next rung on `main`'s boot path (device slot 41, where the title stops once #375 is in), so I brought the branch up to date the same way as #375: one merge commit of `main` (`9f25f1ef2`) on top of `88b8dbad9` (`438859b52`). Mumogg's commits are untouched and nothing was force-pushed. **Conflicts:** two. - `runtime/shims/d3d12_com.cpp`: `ExecuteIndirect` keeps `main`'s argument-range rule from #1066 with its comment, and this PR's `DISPATCH_MESH` early return follows the checks. The PR's older `max_count * stride` check is gone, because #1066 replaced it on `main`. - `docs/d3d12_vulkan.md`: both table rows kept (argument type 105, then slot 81 / `PresentX`). **The hold** (the owner's comment of 04:51 UTC, answered by Mumogg in `88b8dbad9`): its three points are in the merged code. - The record-size, stride and range checks are there; the range check is now #1066's rule. - The record-size chain has `dispatch_mesh ? sizeof(D3D12_DISPATCH_MESH_ARGUMENTS)`. - The `DISPATCH_MESH` return comes after the checks. - `d3d12_execute_indirect_validation` passes on both devices. **Tests** (Linux; clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU): - Linux portable `ctest`: 72 pass and 2 skipped, on `main` and on the branch. - Full Windows suite under Wine, the branch against `main` `9f25f1ef2`: no test changed state on either device. - Repeated on `main` `89d7dfcf5` + the branch, against a baseline of the same `main` (it had moved by two `runtime/` merges, #615 and #992): the iGPU run is unchanged; on llvmpipe one test, `run_tiny_gdk_load`, failed once and passes when the 17 `run_tiny*` tests are re-run alone on the same build, so it was a collision between the two parallel device runs. - `xs_proxy_mock` passes on both devices. `d3d12_mesh` passes on llvmpipe with the new case, and fails on the iGPU at a pipeline-statistics check exactly as on `main`. - Not run here: MSVC, native Windows, a mesh-capable discrete GPU, and the game itself. Mumogg's own run reports the title past slot 41, with the next stop at slot 61. **Notes for later, none blocking:** - Argument type 105 as `DISPATCH` is marked as a hypothesis in this PR, and a mesh `ExecuteIndirect` records nothing yet (it is logged once). - A code comment cites `#3777`, a number from the old repository that links nowhere now. #383 is the next rung. AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.