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

Merged
Mumogg merged 5 commits from upstream-pr/377 into main 2026-11-24 22:52:04 +00:00
Mumogg commented 2026-11-24 04:11:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mumogg on 2026-11-24T04:11:03Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465924393 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/377). Originally posted by [Mumogg](https://github.com/Mumogg) on 2026-11-24T04:11:03Z. --- 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
ubiquitarianism commented 2026-11-24 04:51:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-11-24T04:51:20Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7122399095 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/377#issuecomment-7122399095). Originally posted by [ubiquitarianism](https://github.com/ubiquitarianism) on 2026-11-24T04:51:20Z. --- 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.
Mumogg commented 2026-11-24 09:54:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mumogg on 2026-11-24T09:54:57Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7128061194 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/377#issuecomment-7128061194). Originally posted by [Mumogg](https://github.com/Mumogg) on 2026-11-24T09:54:57Z. --- 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.
aslan2142 commented 2026-11-24 22:52:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-24T22:52:06Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7146737711 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/377#issuecomment-7146737711). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-24T22:52:06Z. --- 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).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!377
No description provided.