Skip to content

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

Merged
aslan2142 merged 5 commits into
ProjectLeonida:mainfrom
Mumogg:slot41-command-signatures
Nov 24, 2026
Merged

aslan2142 merged 5 commits into
ProjectLeonida:mainfrom
Mumogg:slot41-command-signatures

Conversation

@Mumogg

@Mumogg Mumogg commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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

@ubiquitarianism

Copy link
Copy Markdown
Collaborator

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 e1ec785. 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:

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

mrp1no and others added 4 commits November 24, 2026 03:52
…TCH (slot 41)

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 <noreply@anthropic.com>
(cherry picked from commit 4c04c0f)
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 <noreply@anthropic.com>
(cherry picked from commit 084c8c6)
…device with mesh shaders

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 <noreply@anthropic.com>
(cherry picked from commit efc3478)
…H has a record size and returns after it

Resolving the cherry-pick of efc3478 I dropped main's record-size, stride and span checks (e1ec785), which
d3d12_execute_indirect_validation_test depends on and which matter to every D3D12 user (found in review on
ubiquitarianism#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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
@Mumogg
Mumogg force-pushed the slot41-command-signatures branch from 3b86f5f to 88b8dba Compare November 24, 2026 09:54
Mumogg added a commit to Mumogg/leonida-continued that referenced this pull request Nov 24, 2026
…riptor range

Slot 61 passed the destination handle to the PC CreateSampler as given. With the title's descriptor range
honoured (__XMemAllocationHooks__), a handle in that range has to be translated to the real heap's, as device
slots 17 to 24 do (asked for in review on ProjectLeonida#377).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Mumogg added a commit to Mumogg/leonida-continued that referenced this pull request Nov 24, 2026
Asked for in review on ProjectLeonida#377.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Mumogg added a commit to Mumogg/leonida-continued that referenced this pull request Nov 24, 2026
…ow in the Xbox-only table

Asked for in review on ProjectLeonida#377.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
@Mumogg

Mumogg commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

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

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.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aslan2142
aslan2142 merged commit 28a32e1 into ProjectLeonida:main Nov 24, 2026
4 of 5 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator

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.

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

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

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants