Retail boot stops with int3 after ~1653 D3D12 calls on Volta/Wine (no world frame) #2147

Closed
leonida/mandy
opened 2026-11-25 23:22:41 +00:00 by 31415-n · 2 comments
31415-n commented 2026-11-25 23:22:41 +00:00

Reproducible bounded retail run; no game data, paths, addresses or logs attached.

Setup: local 1.0.2.1 package. Port built from main 1fe5072af plus PR #1930 cherry-picks (bary-fallback per-vertex support). Full shader corpus translated 26,503/26,503 with --wave64-emulate on --mesh-compute --bary-fallback; --texel-offset-fallback is unnecessary (maintenance8 present). Run flags: LEONIDA_TITLE_WATCHDOG=0, LEONIDA_LOCAL_DIAGNOSTICS=1, LEONIDA_INPUT_SCRIPT, visible window, 900 s limit.

Hardware/systems:

  • Tesla V100-SXM2-16GB (Volta), driver 580.178.04, Vulkan 1.4.312, subgroup 32. System Wine 9.0: with LEONIDA_VK_DEVICE=V100 the device is selected, but watchdog-armed headless runs end after ~300 s with 0 D3D12 calls; a visible watchdog-off run reaches 1653 D3D12 calls.
  • GE-Proton 11-14 (Wine 11.0 Staging) on the same machine: LEONIDA_VK_DEVICE=V100 matches no Vulkan device, so without the filter the runtime picks GeForce GT 1030. With LEONIDA_ARENA_MB=2048 the console descriptor heap fits in the arena (confirmed by [rt] desc-probe), PresentX reports ready, but the run still ends with int3 after D3D12 call #1653 (CreateDescriptorHeap), 0 counted presents, exit 3.

Counts in the Wine 11 visible run: 1653 D3D12 calls (1634 ok, 19 called), 150 [rt] lines. The D3D12 trace ends at CreateDescriptorHeap; the last logged feature is CreateCommandSignature with console argument type 105 as DISPATCH. Raising the arena from the default 256 MiB to 2048 MiB removes the "arena full" line but does not clear the stop.

The exception is 0x80000003 at the same title site in both Wine versions. Decoded with tools/int3_cause.py (PR #1503 applied): the int3 is taken when a window-creation helper returns zero (RegisterClassExA / CreateWindowExA path). No world frame is reached.

Question for the layer owners: which window/descriptor-heap handle check fails at this point, and is this a Wine-only expectation or a D3D12 proxy bug? Related: PR #1930, issue #1492 (V100 GPU test record), issue #3 (descriptor heap slot 14).

Reproducible bounded retail run; no game data, paths, addresses or logs attached. Setup: local 1.0.2.1 package. Port built from main 1fe5072af plus PR #1930 cherry-picks (bary-fallback per-vertex support). Full shader corpus translated 26,503/26,503 with --wave64-emulate on --mesh-compute --bary-fallback; --texel-offset-fallback is unnecessary (maintenance8 present). Run flags: LEONIDA_TITLE_WATCHDOG=0, LEONIDA_LOCAL_DIAGNOSTICS=1, LEONIDA_INPUT_SCRIPT, visible window, 900 s limit. Hardware/systems: - Tesla V100-SXM2-16GB (Volta), driver 580.178.04, Vulkan 1.4.312, subgroup 32. System Wine 9.0: with LEONIDA_VK_DEVICE=V100 the device is selected, but watchdog-armed headless runs end after ~300 s with 0 D3D12 calls; a visible watchdog-off run reaches 1653 D3D12 calls. - GE-Proton 11-14 (Wine 11.0 Staging) on the same machine: LEONIDA_VK_DEVICE=V100 matches no Vulkan device, so without the filter the runtime picks GeForce GT 1030. With LEONIDA_ARENA_MB=2048 the console descriptor heap fits in the arena (confirmed by [rt] desc-probe), PresentX reports ready, but the run still ends with int3 after D3D12 call #1653 (CreateDescriptorHeap), 0 counted presents, exit 3. Counts in the Wine 11 visible run: 1653 D3D12 calls (1634 ok, 19 called), 150 [rt] lines. The D3D12 trace ends at CreateDescriptorHeap; the last logged feature is CreateCommandSignature with console argument type 105 as DISPATCH. Raising the arena from the default 256 MiB to 2048 MiB removes the "arena full" line but does not clear the stop. The exception is 0x80000003 at the same title site in both Wine versions. Decoded with tools/int3_cause.py (PR #1503 applied): the int3 is taken when a window-creation helper returns zero (RegisterClassExA / CreateWindowExA path). No world frame is reached. Question for the layer owners: which window/descriptor-heap handle check fails at this point, and is this a Wine-only expectation or a D3D12 proxy bug? Related: PR #1930, issue #1492 (V100 GPU test record), issue #3 (descriptor heap slot 14).
31415-n commented 2026-11-27 20:46:46 +00:00

Summary

The stop in this issue is CreateCommandSignature refusing a terminal DISPATCH_MESH argument on a device that has no mesh shaders. The refusal is silent, so the trace shows the previous successful create as its last feature and the failure appears only as the stop.

A patch that rewrites that one argument to DISPATCH on such a device clears the stop completely: with LEONIDA_SKIP_INT3 unset the boot reaches 41,824 D3D12 calls and 250 PresentX ok with no int3 at all.

Two things this comment does: it says which of the already-open pull requests settle which part of the problem and which do not, and it puts the code up so the discussion has something concrete to argue about.


1. What the trace says

Recap of the numbers in this issue: 1,653 D3D12 calls, 0 presents, the trace ends at CreateDescriptorHeap, and the last logged feature is device slot 41 creating the console argument type 105 as DISPATCH.

That last line is the clue. It is not the call that fails; it is the last one that succeeds. The failure is the next signature the title creates, and it is invisible in the trace for two reasons:

  • Device::CreateCommandSignature returns E_NOTIMPL for DISPATCH_MESH when info.mesh_shader is false (runtime/shims/d3d12_vulkan_device.cpp, the switch on the last argument type) and logs nothing;
  • the slot-41 proxy in runtime/shims/d3d12_xs_device.cpp forwards that description unchanged, also without a line.

#377 established the mechanism this issue runs into, and said so in its own body: the title creates five one-argument command signatures at startup through device slot 41, and it stops when one of them is refused — its device set-up returns false and it hits its own int3. #377 closed that for argument type 105 and for DISPATCH_MESH on a device with mesh shaders. The mesh-less device was left out:

case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH:
    // As DispatchMesh: only a device with mesh shaders (MeshShaderTier 1) takes it.
    if (!state_.info.mesh_shader) return E_NOTIMPL;

That is the wall. On a V100 (no VK_EXT_mesh_shader) the fifth signature is refused, device set-up returns false, and the title asserts. This also explains why the stop is at the same site in Wine 9 and Wine 11: it is not a Wine behaviour at all.

2. The pull requests that already exist

Pull request State What it settles What it does not settle
#377 RT-SLOT41 merged 2026-11-24 The five startup signatures are created; type 105 is served as DISPATCH; DISPATCH_MESH is created on a device with mesh shaders The mesh-less case: E_NOTIMPL stays, and the title stops exactly as its own body describes
#424 D3D-MESH-INDIRECT-EXEC closed, unmerged Replays a fixed-count indirect mesh dispatch through vkCmdDrawMeshTasksIndirectEXT Signature creation; it assumes the signature exists
#2492 RT-INDIRECT-DISPATCH-MESH-PARITY open ExecuteIndirect with DISPATCH_MESH records the way DispatchMesh does (viewport arrays, mesh_ok window) Same: recording, not creation
#2180 RT-INDIRECT-KIND-SWITCH open Names IndirectKind::dispatch_mesh in indirect_record_size, no -Wswitch gaps Creation
#1737 D3D-INDIRECT-STATE-REFUSE open Refuses a signature that puts arguments before its draw (root constants, VBV/IBV) until per-command state is replayed Does not touch one-argument signatures, so it does not interact with this fix
#1937 D3D-INDIRECT-STATE-REPLAY open Replays a compound signature's vertex/index buffer views and root arguments Compound signatures only
#1620 INDIRECT-STATE-ARGS closed, unmerged Stores indirect argument types and replays VBV/IBV state Creation
#499 D3D-EXECIND-GRAPHICS open Replays full graphics state for indirect DRAW/DRAW_INDEXED Graphics kinds
#1885 MAKE-GAME-MESH-COMPUTE-NO-EXT open make_game enables --mesh-compute by itself when the device has no VK_EXT_mesh_shader The runtime still refuses the signature, so the boot still stops
#1514 open vk_pipeline_check checks --mesh-compute entries as compute pipelines Verification only
#1395 RT-526 open LEONIDA_SKIP_ASSERTS steps over guest asserts Bypasses the symptom; the refusal stays
#1503 INT3-CAUSE-DECODE-AND-TRACE-FIXES open Fixes in tools/int3_cause.py: load widths, high-byte registers, global writers, returns dedup, int 29h flow It is the tool that decoded this site in the first place, and those fixes were not in the tree when it did

Also adjacent, and neither of them this stop: #2054 hardens window fitting in runtime/shims/lifecycle.cpp, and #2139 makes title_window and xgameruntime_offline skip in session 0.

So: no open pull request closes this. The nearest one, #2492, is about recording an indirect mesh dispatch that already exists, not about creating its signature on a device that cannot run one.

3. The two candidate causes that were posted in the coordination thread

Two readings of this stop exist in #1608:

  1. A window-creation helper returns zero. From the int3_cause decode, and from the launch-6 analysis in this comment: the title re-registers sgaWindowClass, a second RegisterClassExA answers atom 0, the helper returns 0, and the assert follows. RegisterClassExA is indeed not shimmed on main — runtime/shims/lifecycle.cpp has only CreateWindowExA/W, so the call goes to the host user32.
  2. CreateCommandSignature refuses DISPATCH_MESH. From this comment: the five startup signatures were checked one by one, the first four returned S_OK, the fifth (DISPATCH_MESH, 12-byte stride) returned E_NOTIMPL, and then graphics initialisation returned false.

Reading 2 is the cause of this stop. The patch below changes nothing except the creation of that signature, and the assert disappears entirely — with LEONIDA_SKIP_INT3 unset there is no int3 at all, and the run goes 25x further. A window-class registration cannot be affected by that change.

Reading 1 is therefore either a consequence (the failed device set-up reaches a window helper that then returns 0) or a misread of the site by the decoder whose fixes are still in #1503. It is not needed to explain this stop, and I am not claiming it is wrong for other stops.

4. The patch

On a device that reports MeshShaderTier == D3D12_MESH_SHADER_TIER_NOT_SUPPORTED, the terminal DISPATCH_MESH argument of a one-argument signature is rewritten to DISPATCH. That is the same mapping #377 already measured for console argument type 105, and it is sound for the same reason: this work folder's mesh shaders are translated with --mesh-compute, both ExecuteIndirect sites set the compute state first, and the 12-byte record is D3D12_DISPATCH_ARGUMENTS in both cases.

The guard reads the same fact the refusal reads: CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7) answers MeshShaderTier from state_.info.mesh_shader, the very flag the E_NOTIMPL is conditioned on. A mesh-capable device keeps the real signature.

--- a/runtime/shims/d3d12_xs_device.cpp
+++ b/runtime/shims/d3d12_xs_device.cpp
@@ -4973,6 +4973,17 @@ std::uint32_t argument_type(const D3D12_INDIRECT_ARGUMENT_DESC& arg) {
     return type;
 }
 
+// The title's DISPATCH_MESH signatures are compute dispatches: this work folder's mesh shaders were translated with
+// --mesh-compute and the ExecuteIndirect sites set compute state before them, just as for the DISPATCH signatures.
+// Their 12-byte argument record is D3D12_DISPATCH_ARGUMENTS in both cases. On a device without MeshShaderTier 1 the
+// PC device refuses DISPATCH_MESH with E_NOTIMPL, and the title asserts during device setup. Rewrite it to DISPATCH
+// only on such a device; a mesh-capable one keeps the real signature.
+bool real_device_has_mesh_shaders(ID3D12Device* real) {
+    D3D12_FEATURE_DATA_D3D12_OPTIONS7 options{};
+    if (FAILED(real->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &options, sizeof(options)))) return false;
+    return options.MeshShaderTier != D3D12_MESH_SHADER_TIER_NOT_SUPPORTED;
+}
+
 HRESULT proxy_create_command_signature(DeviceProxy* self, const D3D12_COMMAND_SIGNATURE_DESC* desc,
                                        std::uint64_t root_signature, const IID* riid, void** out) {
     note_slot(41);
@@ -4983,7 +4994,11 @@ HRESULT proxy_create_command_signature(DeviceProxy* self, const D3D12_COMMAND_SI
     if (desc && desc->pArgumentDescs)
         for (UINT i = 0; i < desc->NumArgumentDescs && !console; ++i)
             console = argument_type(desc->pArgumentDescs[i]) == kXboxIndirectArgumentDispatch105;
-    if (!console) return forward(self->real, desc, root_signature, riid, out);
+    const bool mesh_as_dispatch = desc && desc->NumArgumentDescs && desc->pArgumentDescs &&
+                                  argument_type(desc->pArgumentDescs[desc->NumArgumentDescs - 1]) ==
+                                      D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH &&
+                                  !real_device_has_mesh_shaders(self->real);
+    if (!console && !mesh_as_dispatch) return forward(self->real, desc, root_signature, riid, out);
 
     std::unique_ptr<D3D12_INDIRECT_ARGUMENT_DESC[]> args(new (std::nothrow)
                                                              D3D12_INDIRECT_ARGUMENT_DESC[desc->NumArgumentDescs]);
@@ -4993,13 +5008,21 @@ HRESULT proxy_create_command_signature(DeviceProxy* self, const D3D12_COMMAND_SI
     }
     for (UINT i = 0; i < desc->NumArgumentDescs; ++i) {
         args[i] = desc->pArgumentDescs[i];
-        if (argument_type(args[i]) == kXboxIndirectArgumentDispatch105)
+        if (argument_type(args[i]) == kXboxIndirectArgumentDispatch105 ||
+            (mesh_as_dispatch && i + 1 == desc->NumArgumentDescs &&
+             argument_type(args[i]) == D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH))
             args[i].Type = D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH;
     }
     static std::atomic<bool> logged{false};
-    if (!logged.exchange(true, std::memory_order_relaxed))
+    if (console && !logged.exchange(true, std::memory_order_relaxed))
         std::fprintf(stderr, "[rt] d3d12_xs: slot 41 argument type 105 (stride %u) created as DISPATCH\n",
                      desc->ByteStride);
+    if (mesh_as_dispatch) {
+        static std::atomic<bool> mesh_logged{false};
+        if (!mesh_logged.exchange(true, std::memory_order_relaxed))
+            std::fprintf(stderr, "[rt] d3d12_xs: slot 41 DISPATCH_MESH (stride %u) created as DISPATCH: no mesh tier\n",
+                         desc->ByteStride);
+    }
     D3D12_COMMAND_SIGNATURE_DESC pc = *desc;
     pc.pArgumentDescs = args.get();
     return forward(self->real, &pc, root_signature, riid, out);

The one-time log line is deliberate: the refusal that causes this issue is silent, and that is why it took checking the five signatures by hand to find it.

5. Evidence

Device: Tesla V100-SXM2-16GB (Volta), driver 580.178.04, Vulkan 1.4.312, subgroup 32, no VK_EXT_mesh_shader. Wine 9.0, 64-bit. Shader library translated with --mesh-compute. Build: main aa663c4c5 with the local --bary-fallback work, plus the patch above.

Run D3D12 calls PresentX ok int3
before the patch (the trace in this issue) 1,653 0 yes, during device set-up
after, LEONIDA_SKIP_INT3 unset 41,824 250 none
after, LEONIDA_SKIP_INT3=1 65,683 389 none; 2,400+ recorded draws

The third row goes further only because other guest asserts further along are stepped over; the one this issue is about is gone in both.

The line that says the patch fired, once per process:

[rt] d3d12_xs: slot 41 DISPATCH_MESH (stride 12) created as DISPATCH: no mesh tier

6. What this does not claim

  • No window frame. PresentX is a no-op on this machine: vkGetPhysicalDeviceSurfaceSupportKHR answers unsupported for the V100 on the X display in use, which is driven by another card. The 250 PresentX ok calls return success and present nothing. A capture of the source texture is the only thing that shows the title's output here.
  • No test yet. This is a local commit, not a pull request. A test belongs in xs_proxy_mock_test (device slot 41, mock answering CheckFeatureSupport) and does not exist yet.
  • No claim about the console. Whether a real Xbox treats a mesh signature as a dispatch on a mesh-less device is a hypothesis. What is measured is that the title sets the compute state before both ExecuteIndirect sites, exactly as it does for the type-105 signature that #377 already serves as DISPATCH.

7. Questions for the layer owners

  1. Where should the rewrite live? Here, in the console slot-41 proxy, it only helps the title's console path. In Device::CreateCommandSignature it would also serve a PC caller and keep one place that knows about mesh_shader, but it changes what a PC API call does. Which do you prefer?
  2. Knob or not? #377's type-105 mapping is unconditional. This one could be too, or it could sit behind LEONIDA_… so a run can see the refusal. I lean unconditional, for the same reason as type 105: the alternative is a stop, not a different result.
  3. A mesh-capable device to confirm the guard. On a GPU with VK_EXT_mesh_shader the patch must be a no-op and the real signature must be created. One line in the log from such a run would settle it. Mine cannot.

If this is the right shape, I can turn it into a pull request with the mock test and the contract row for docs/d3d12_vulkan.md (the row is written, it is not in this comment).

AI-assisted.

## Summary The stop in this issue is `CreateCommandSignature` refusing a terminal `DISPATCH_MESH` argument on a device that has no mesh shaders. The refusal is silent, so the trace shows the previous successful create as its last feature and the failure appears only as the stop. A patch that rewrites that one argument to `DISPATCH` on such a device clears the stop completely: with `LEONIDA_SKIP_INT3` **unset** the boot reaches 41,824 D3D12 calls and 250 `PresentX ok` with no int3 at all. Two things this comment does: it says which of the already-open pull requests settle which part of the problem and which do not, and it puts the code up so the discussion has something concrete to argue about. --- ## 1. What the trace says Recap of the numbers in this issue: 1,653 D3D12 calls, 0 presents, the trace ends at `CreateDescriptorHeap`, and the last *logged* feature is device slot 41 creating the console argument type 105 as `DISPATCH`. That last line is the clue. It is not the call that fails; it is the last one that **succeeds**. The failure is the next signature the title creates, and it is invisible in the trace for two reasons: - `Device::CreateCommandSignature` returns `E_NOTIMPL` for `DISPATCH_MESH` when `info.mesh_shader` is false (`runtime/shims/d3d12_vulkan_device.cpp`, the `switch` on the last argument type) and logs nothing; - the slot-41 proxy in `runtime/shims/d3d12_xs_device.cpp` forwards that description unchanged, also without a line. #377 established the mechanism this issue runs into, and said so in its own body: the title creates five one-argument command signatures at startup through device slot 41, and **it stops when one of them is refused** — its device set-up returns false and it hits its own int3. #377 closed that for argument type 105 and for `DISPATCH_MESH` *on a device with mesh shaders*. The mesh-less device was left out: ```cpp case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH: // As DispatchMesh: only a device with mesh shaders (MeshShaderTier 1) takes it. if (!state_.info.mesh_shader) return E_NOTIMPL; ``` That is the wall. On a V100 (no `VK_EXT_mesh_shader`) the fifth signature is refused, device set-up returns false, and the title asserts. This also explains why the stop is at the same site in Wine 9 and Wine 11: it is not a Wine behaviour at all. ## 2. The pull requests that already exist | Pull request | State | What it settles | What it does not settle | |---|---|---|---| | [#377](https://github.com/ProjectLeonida/mandy/pull/377) `RT-SLOT41` | merged 2026-11-24 | The five startup signatures are created; type 105 is served as `DISPATCH`; `DISPATCH_MESH` is created **on a device with mesh shaders** | The mesh-less case: `E_NOTIMPL` stays, and the title stops exactly as its own body describes | | [#424](https://github.com/ProjectLeonida/mandy/pull/424) `D3D-MESH-INDIRECT-EXEC` | closed, unmerged | Replays a fixed-count indirect mesh dispatch through `vkCmdDrawMeshTasksIndirectEXT` | Signature creation; it assumes the signature exists | | [#2492](https://github.com/ProjectLeonida/mandy/pull/2492) `RT-INDIRECT-DISPATCH-MESH-PARITY` | open | `ExecuteIndirect` with `DISPATCH_MESH` records the way `DispatchMesh` does (viewport arrays, `mesh_ok` window) | Same: recording, not creation | | [#2180](https://github.com/ProjectLeonida/mandy/pull/2180) `RT-INDIRECT-KIND-SWITCH` | open | Names `IndirectKind::dispatch_mesh` in `indirect_record_size`, no `-Wswitch` gaps | Creation | | [#1737](https://github.com/ProjectLeonida/mandy/pull/1737) `D3D-INDIRECT-STATE-REFUSE` | open | Refuses a signature that puts arguments *before* its draw (root constants, VBV/IBV) until per-command state is replayed | Does not touch one-argument signatures, so it does not interact with this fix | | [#1937](https://github.com/ProjectLeonida/mandy/pull/1937) `D3D-INDIRECT-STATE-REPLAY` | open | Replays a compound signature's vertex/index buffer views and root arguments | Compound signatures only | | [#1620](https://github.com/ProjectLeonida/mandy/pull/1620) `INDIRECT-STATE-ARGS` | closed, unmerged | Stores indirect argument types and replays VBV/IBV state | Creation | | [#499](https://github.com/ProjectLeonida/mandy/pull/499) `D3D-EXECIND-GRAPHICS` | open | Replays full graphics state for indirect `DRAW`/`DRAW_INDEXED` | Graphics kinds | | [#1885](https://github.com/ProjectLeonida/mandy/pull/1885) `MAKE-GAME-MESH-COMPUTE-NO-EXT` | open | `make_game` enables `--mesh-compute` by itself when the device has no `VK_EXT_mesh_shader` | The runtime still refuses the signature, so the boot still stops | | [#1514](https://github.com/ProjectLeonida/mandy/pull/1514) | open | `vk_pipeline_check` checks `--mesh-compute` entries as compute pipelines | Verification only | | [#1395](https://github.com/ProjectLeonida/mandy/pull/1395) `RT-526` | open | `LEONIDA_SKIP_ASSERTS` steps over guest asserts | Bypasses the symptom; the refusal stays | | [#1503](https://github.com/ProjectLeonida/mandy/pull/1503) `INT3-CAUSE-DECODE-AND-TRACE-FIXES` | open | Fixes in `tools/int3_cause.py`: load widths, high-byte registers, global writers, returns dedup, `int 29h` flow | It is the tool that decoded this site in the first place, and those fixes were not in the tree when it did | Also adjacent, and neither of them this stop: [#2054](https://github.com/ProjectLeonida/mandy/pull/2054) hardens window fitting in `runtime/shims/lifecycle.cpp`, and [#2139](https://github.com/ProjectLeonida/mandy/pull/2139) makes `title_window` and `xgameruntime_offline` skip in session 0. So: no open pull request closes this. The nearest one, #2492, is about recording an indirect mesh dispatch that already exists, not about creating its signature on a device that cannot run one. ## 3. The two candidate causes that were posted in the coordination thread Two readings of this stop exist in [#1608](https://github.com/ProjectLeonida/mandy/issues/1608): 1. **A window-creation helper returns zero.** From the `int3_cause` decode, and from the launch-6 analysis in [this comment](https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7206091460): the title re-registers `sgaWindowClass`, a second `RegisterClassExA` answers atom 0, the helper returns 0, and the assert follows. `RegisterClassExA` is indeed not shimmed on `main` — `runtime/shims/lifecycle.cpp` has only `CreateWindowExA`/`W`, so the call goes to the host `user32`. 2. **`CreateCommandSignature` refuses `DISPATCH_MESH`.** From [this comment](https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7208821474): the five startup signatures were checked one by one, the first four returned `S_OK`, the fifth (`DISPATCH_MESH`, 12-byte stride) returned `E_NOTIMPL`, and then graphics initialisation returned false. Reading 2 is the cause of **this** stop. The patch below changes nothing except the creation of that signature, and the assert disappears entirely — with `LEONIDA_SKIP_INT3` unset there is no int3 at all, and the run goes 25x further. A window-class registration cannot be affected by that change. Reading 1 is therefore either a consequence (the failed device set-up reaches a window helper that then returns 0) or a misread of the site by the decoder whose fixes are still in #1503. It is not needed to explain this stop, and I am not claiming it is wrong for other stops. ## 4. The patch On a device that reports `MeshShaderTier == D3D12_MESH_SHADER_TIER_NOT_SUPPORTED`, the terminal `DISPATCH_MESH` argument of a one-argument signature is rewritten to `DISPATCH`. That is the same mapping #377 already measured for console argument type 105, and it is sound for the same reason: this work folder's mesh shaders are translated with `--mesh-compute`, both `ExecuteIndirect` sites set the compute state first, and the 12-byte record is `D3D12_DISPATCH_ARGUMENTS` in both cases. The guard reads the same fact the refusal reads: `CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7)` answers `MeshShaderTier` from `state_.info.mesh_shader`, the very flag the `E_NOTIMPL` is conditioned on. A mesh-capable device keeps the real signature. ```diff --- a/runtime/shims/d3d12_xs_device.cpp +++ b/runtime/shims/d3d12_xs_device.cpp @@ -4973,6 +4973,17 @@ std::uint32_t argument_type(const D3D12_INDIRECT_ARGUMENT_DESC& arg) { return type; } +// The title's DISPATCH_MESH signatures are compute dispatches: this work folder's mesh shaders were translated with +// --mesh-compute and the ExecuteIndirect sites set compute state before them, just as for the DISPATCH signatures. +// Their 12-byte argument record is D3D12_DISPATCH_ARGUMENTS in both cases. On a device without MeshShaderTier 1 the +// PC device refuses DISPATCH_MESH with E_NOTIMPL, and the title asserts during device setup. Rewrite it to DISPATCH +// only on such a device; a mesh-capable one keeps the real signature. +bool real_device_has_mesh_shaders(ID3D12Device* real) { + D3D12_FEATURE_DATA_D3D12_OPTIONS7 options{}; + if (FAILED(real->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &options, sizeof(options)))) return false; + return options.MeshShaderTier != D3D12_MESH_SHADER_TIER_NOT_SUPPORTED; +} + HRESULT proxy_create_command_signature(DeviceProxy* self, const D3D12_COMMAND_SIGNATURE_DESC* desc, std::uint64_t root_signature, const IID* riid, void** out) { note_slot(41); @@ -4983,7 +4994,11 @@ HRESULT proxy_create_command_signature(DeviceProxy* self, const D3D12_COMMAND_SI if (desc && desc->pArgumentDescs) for (UINT i = 0; i < desc->NumArgumentDescs && !console; ++i) console = argument_type(desc->pArgumentDescs[i]) == kXboxIndirectArgumentDispatch105; - if (!console) return forward(self->real, desc, root_signature, riid, out); + const bool mesh_as_dispatch = desc && desc->NumArgumentDescs && desc->pArgumentDescs && + argument_type(desc->pArgumentDescs[desc->NumArgumentDescs - 1]) == + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH && + !real_device_has_mesh_shaders(self->real); + if (!console && !mesh_as_dispatch) return forward(self->real, desc, root_signature, riid, out); std::unique_ptr<D3D12_INDIRECT_ARGUMENT_DESC[]> args(new (std::nothrow) D3D12_INDIRECT_ARGUMENT_DESC[desc->NumArgumentDescs]); @@ -4993,13 +5008,21 @@ HRESULT proxy_create_command_signature(DeviceProxy* self, const D3D12_COMMAND_SI } for (UINT i = 0; i < desc->NumArgumentDescs; ++i) { args[i] = desc->pArgumentDescs[i]; - if (argument_type(args[i]) == kXboxIndirectArgumentDispatch105) + if (argument_type(args[i]) == kXboxIndirectArgumentDispatch105 || + (mesh_as_dispatch && i + 1 == desc->NumArgumentDescs && + argument_type(args[i]) == D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH)) args[i].Type = D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH; } static std::atomic<bool> logged{false}; - if (!logged.exchange(true, std::memory_order_relaxed)) + if (console && !logged.exchange(true, std::memory_order_relaxed)) std::fprintf(stderr, "[rt] d3d12_xs: slot 41 argument type 105 (stride %u) created as DISPATCH\n", desc->ByteStride); + if (mesh_as_dispatch) { + static std::atomic<bool> mesh_logged{false}; + if (!mesh_logged.exchange(true, std::memory_order_relaxed)) + std::fprintf(stderr, "[rt] d3d12_xs: slot 41 DISPATCH_MESH (stride %u) created as DISPATCH: no mesh tier\n", + desc->ByteStride); + } D3D12_COMMAND_SIGNATURE_DESC pc = *desc; pc.pArgumentDescs = args.get(); return forward(self->real, &pc, root_signature, riid, out); ``` The one-time log line is deliberate: the refusal that causes this issue is silent, and that is why it took checking the five signatures by hand to find it. ## 5. Evidence Device: Tesla V100-SXM2-16GB (Volta), driver 580.178.04, Vulkan 1.4.312, subgroup 32, **no** `VK_EXT_mesh_shader`. Wine 9.0, 64-bit. Shader library translated with `--mesh-compute`. Build: `main` `aa663c4c5` with the local `--bary-fallback` work, plus the patch above. | Run | D3D12 calls | `PresentX ok` | int3 | |---|---|---|---| | before the patch (the trace in this issue) | 1,653 | 0 | yes, during device set-up | | after, `LEONIDA_SKIP_INT3` **unset** | 41,824 | 250 | **none** | | after, `LEONIDA_SKIP_INT3=1` | 65,683 | 389 | none; 2,400+ recorded draws | The third row goes further only because other guest asserts further along are stepped over; the one this issue is about is gone in both. The line that says the patch fired, once per process: ``` [rt] d3d12_xs: slot 41 DISPATCH_MESH (stride 12) created as DISPATCH: no mesh tier ``` ## 6. What this does not claim - **No window frame.** `PresentX` is a no-op on this machine: `vkGetPhysicalDeviceSurfaceSupportKHR` answers unsupported for the V100 on the X display in use, which is driven by another card. The 250 `PresentX ok` calls return success and present nothing. A capture of the source texture is the only thing that shows the title's output here. - **No test yet.** This is a local commit, not a pull request. A test belongs in `xs_proxy_mock_test` (device slot 41, mock answering `CheckFeatureSupport`) and does not exist yet. - **No claim about the console.** Whether a real Xbox treats a mesh signature as a dispatch on a mesh-less device is a hypothesis. What is measured is that the title sets the compute state before both `ExecuteIndirect` sites, exactly as it does for the type-105 signature that #377 already serves as `DISPATCH`. ## 7. Questions for the layer owners 1. **Where should the rewrite live?** Here, in the console slot-41 proxy, it only helps the title's console path. In `Device::CreateCommandSignature` it would also serve a PC caller and keep one place that knows about `mesh_shader`, but it changes what a PC API call does. Which do you prefer? 2. **Knob or not?** #377's type-105 mapping is unconditional. This one could be too, or it could sit behind `LEONIDA_…` so a run can see the refusal. I lean unconditional, for the same reason as type 105: the alternative is a stop, not a different result. 3. **A mesh-capable device to confirm the guard.** On a GPU with `VK_EXT_mesh_shader` the patch must be a no-op and the real signature must be created. One line in the log from such a run would settle it. Mine cannot. If this is the right shape, I can turn it into a pull request with the mock test and the contract row for `docs/d3d12_vulkan.md` (the row is written, it is not in this comment). AI-assisted.
aslan2142 commented 2026-12-01 17:06:30 +00:00

Closing this issue because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the report/contribution! If you believe this issue was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

Closing this issue because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the report/contribution! If you believe this issue was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No assignees
No project
No milestone
Dependencies

No dependencies set

Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
leonida/mandy#2147
No description provided.