runtime: forward one GPU-written indirect DispatchMesh #1916

Manually merged
github merged 4 commits from gh-pr/1916/head into gh-pr/1916/base 2026-11-26 23:42:28 +00:00
Owner

@⁠avt0m4t48 on GitHub · 2026-11-24 21:06 UTC · original
avt0m4t48:fix/startup-indirect-mesh → main · +229 −51 · 7 files · 4 commits · merged 2026-11-24 21:15 UTC

Refs #1759. Builds on #1909's indirect graphics fixture and state checks. The single-frame census in #1412 counted 3,715 mesh-dispatch records.

Forward one rootless desktop DispatchMesh record through guest list slot 61 with the exact D3D12_DISPATCH_MESH_ARGUMENTS stride. The native stream parser admits a desktop mesh/pixel pipeline with an empty root signature. The direct list requires a matching pipeline, target, viewport and scissor and transitions the placed argument resource to INDIRECT_ARGUMENT. The mesh command supplies its topology. Amplification, stream output, and console shader bindings are outside this slice.

The compute writer selects one or two mesh groups at a nonzero argument offset. The source-built mesh renders four or eight pixels respectively. Every pixel and argument word is compared. The omitted writer, short argument range and missing viewport leave the target clear.

  • Windows build 26100, Microsoft Basic Render Driver 10.0.26100.33648, D3D12 debug layer enabled. cmake --build --preset release --target startup_indirect_draw_indexed startup_indirect_dispatch and ctest --preset release --no-tests=error -R '^startup_indirect_(dispatch|draw(_indexed)?|mesh)_warp$' -V passed all four tests. Candidate run
  • Before the mesh changes, the guest pipeline rejected stream subobject 25 and pixel (0,0) stayed 0xff000000 instead of 0xff0000ff. All three previous indirect fixtures passed at that baseline. Negative control
  • Linux DXC compiled both graphics shaders with warnings denied. Windows-target MinGW syntax, startup translator and documentation checks passed. The physical test can be run with ctest --preset release --no-tests=error -R '^startup_indirect_mesh_hardware$' -V.

Physical GPU execution and application mesh pipeline integration remain open. The fixture uses source-built desktop shaders.

**@⁠avt0m4t48** on GitHub · 2026-11-24 21:06 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1916) `avt0m4t48:fix/startup-indirect-mesh` → `main` · +229 −51 · 7 files · 4 commits · merged 2026-11-24 21:15 UTC Refs #1759. Builds on #1909's indirect graphics fixture and state checks. The single-frame census in #1412 counted 3,715 mesh-dispatch records. Forward one rootless desktop `DispatchMesh` record through guest list slot 61 with the exact `D3D12_DISPATCH_MESH_ARGUMENTS` stride. The native stream parser admits a desktop mesh/pixel pipeline with an empty root signature. The direct list requires a matching pipeline, target, viewport and scissor and transitions the placed argument resource to `INDIRECT_ARGUMENT`. The mesh command supplies its topology. Amplification, stream output, and console shader bindings are outside this slice. The compute writer selects one or two mesh groups at a nonzero argument offset. The source-built mesh renders four or eight pixels respectively. Every pixel and argument word is compared. The omitted writer, short argument range and missing viewport leave the target clear. - Windows build 26100, Microsoft Basic Render Driver 10.0.26100.33648, D3D12 debug layer enabled. `cmake --build --preset release --target startup_indirect_draw_indexed startup_indirect_dispatch` and `ctest --preset release --no-tests=error -R '^startup_indirect_(dispatch|draw(_indexed)?|mesh)_warp$' -V` passed all four tests. [Candidate run](https://github.com/avt0m4t48/Xbox2Windows/actions/runs/45487176129) - Before the mesh changes, the guest pipeline rejected stream subobject 25 and pixel `(0,0)` stayed `0xff000000` instead of `0xff0000ff`. All three previous indirect fixtures passed at that baseline. [Negative control](https://github.com/avt0m4t48/Xbox2Windows/actions/runs/45486140968) - Linux DXC compiled both graphics shaders with warnings denied. Windows-target MinGW syntax, startup translator and documentation checks passed. The physical test can be run with `ctest --preset release --no-tests=error -R '^startup_indirect_mesh_hardware$' -V`. Physical GPU execution and application mesh pipeline integration remain open. The fixture uses source-built desktop shaders.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:42:27 +00:00
github manually merged commit 015b8d89c5 into gh-pr/1916/base 2026-11-26 23:42:28 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 21:16 UTC · original · reviewed

Review of exact head 015b8d89c5bf9c2f49880de4817b155faadf8bdc (title is neutral; the diff touches CMakeLists.txt, CMakePresets.json, docs/experiments.md, docs/startup-runtime.md, src/startup_stubs/d3d12_xs_device.cpp, tests/startup_indirect_draw_indexed.cpp, tests/startup_indirect_mesh.hlsl).

Verdict: no P1, no P2 found. Three P3 test-coverage notes below.

Commands run locally (against origin/main...HEAD):

  • git diff --check origin/main...HEAD: clean, rc=0
  • tests/docs_links_check.py: "Self-test passed. Checked 18 Markdown files and 380 links."
  • tests/bidi_controls_check.py: "Checked 1339 tracked source, script and build/CI files: no bidirectional controls."
  • x2w_pipe.py win2025 1916 --targets d3d12_xs_shim,startup_indirect_draw_indexed,startup_indirect_dispatch --regex '^startup_indirect_(dispatch|draw(_indexed)?|mesh)_warp$' on Windows Server 2025 (Debug and Release /O2): 4/4 passed in both (startup_indirect_mesh_warp, startup_indirect_draw_warp, startup_indirect_draw_indexed_warp, startup_indirect_dispatch_warp). The mesh test ran and passed on WARP here; it was not skipped.

Mutations (each applied as a patch on top of the exact head, run on Windows Server 2025 Debug, then discarded; the checkout stayed clean):

  1. desktop_stream_size: the mesh subobject size 24 changed to 16. startup_indirect_mesh_warp FAILED. Caught.
  2. list_execute_indirect: || pass.indirect_graphics.mesh != mesh removed. 4/4 still passed. NOT caught (P3 a).
  3. build_stream_pipeline: the mesh stream-output refusal (if (output->NumEntries || output->NumStrides)) changed to if (false). 4/4 still passed. NOT caught (P3 b).
  4. build_stream_pipeline: supported = mesh ? !is_vertex && readable_shader_container(*code) changed to drop !is_vertex (a VS accepted in a mesh stream). 4/4 still passed. NOT caught (P3 c).

What I checked by reading:

  • For streams without a mesh subobject the refusal condition is the same as before (empty root, type at most PS, reflected VS/PS); only the mesh path is new. The MS subobject (type 25) is sized only inside build_stream_pipeline; AS (24) is still refused as an unknown subobject.
  • mesh is a property of the stream, stored in IndirectGraphicsPipeline, and list_execute_indirect requires it to equal the signature kind, so a rootless DispatchMesh signature cannot run a VS/PS pipeline in the normal path.
  • The mesh path skips the triangle-list topology check, since a mesh pipeline has no IA topology; the target, viewport, scissor, single-sample and no-depth checks stay shared with Draw/DrawIndexed.
  • The hardware variant skips with code 77 and a printed reason when no non-software, non-Basic-Render adapter reports mesh tier 1. The WARP variant also uses SKIP_RETURN_CODE 77 (CMakeLists.txt startup_indirect_mesh_${backend}), so a WARP that loses mesh support would show as Skipped, not Failed.

P3 (optional, not blocking):

  • (a) src/startup_stubs/d3d12_xs_device.cpp:1966: nothing runs a Draw/DrawIndexed pipeline with the mesh signature (or the reverse), so the new pass.indirect_graphics.mesh != mesh guard is untested. One extra refusal case in tests/startup_indirect_draw_indexed.cpp would cover it.
  • (b) src/startup_stubs/d3d12_xs_device.cpp (mesh stream-output refusal) and (c) the VS-in-mesh-stream refusal: no case feeds such a stream, so neither refusal is guarded. The native pipeline creation may reject them anyway, but then the wrapper's own message and fallback are what the guest sees.

Limits: only WARP was available here (hardware adapter coverage is not claimed by the PR either). The Windows runs used the Debug and Release presets but the mutations ran on Debug only.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 21:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1916#pullrequestreview-6047543002) · **reviewed** Review of exact head `015b8d89c5bf9c2f49880de4817b155faadf8bdc` (title is neutral; the diff touches `CMakeLists.txt`, `CMakePresets.json`, `docs/experiments.md`, `docs/startup-runtime.md`, `src/startup_stubs/d3d12_xs_device.cpp`, `tests/startup_indirect_draw_indexed.cpp`, `tests/startup_indirect_mesh.hlsl`). **Verdict: no P1, no P2 found.** Three P3 test-coverage notes below. Commands run locally (against `origin/main...HEAD`): - `git diff --check origin/main...HEAD`: clean, rc=0 - `tests/docs_links_check.py`: "Self-test passed. Checked 18 Markdown files and 380 links." - `tests/bidi_controls_check.py`: "Checked 1339 tracked source, script and build/CI files: no bidirectional controls." - `x2w_pipe.py win2025 1916 --targets d3d12_xs_shim,startup_indirect_draw_indexed,startup_indirect_dispatch --regex '^startup_indirect_(dispatch|draw(_indexed)?|mesh)_warp$'` on Windows Server 2025 (Debug and Release /O2): 4/4 passed in both (`startup_indirect_mesh_warp`, `startup_indirect_draw_warp`, `startup_indirect_draw_indexed_warp`, `startup_indirect_dispatch_warp`). The mesh test ran and passed on WARP here; it was not skipped. Mutations (each applied as a patch on top of the exact head, run on Windows Server 2025 Debug, then discarded; the checkout stayed clean): 1. `desktop_stream_size`: the mesh subobject size 24 changed to 16. `startup_indirect_mesh_warp` FAILED. Caught. 2. `list_execute_indirect`: `|| pass.indirect_graphics.mesh != mesh` removed. 4/4 still passed. NOT caught (P3 a). 3. `build_stream_pipeline`: the mesh stream-output refusal (`if (output->NumEntries || output->NumStrides)`) changed to `if (false)`. 4/4 still passed. NOT caught (P3 b). 4. `build_stream_pipeline`: `supported = mesh ? !is_vertex && readable_shader_container(*code)` changed to drop `!is_vertex` (a VS accepted in a mesh stream). 4/4 still passed. NOT caught (P3 c). What I checked by reading: - For streams without a mesh subobject the refusal condition is the same as before (empty root, type at most PS, reflected VS/PS); only the mesh path is new. The MS subobject (type 25) is sized only inside `build_stream_pipeline`; AS (24) is still refused as an unknown subobject. - `mesh` is a property of the stream, stored in `IndirectGraphicsPipeline`, and `list_execute_indirect` requires it to equal the signature kind, so a rootless DispatchMesh signature cannot run a VS/PS pipeline in the normal path. - The mesh path skips the triangle-list topology check, since a mesh pipeline has no IA topology; the target, viewport, scissor, single-sample and no-depth checks stay shared with Draw/DrawIndexed. - The hardware variant skips with code 77 and a printed reason when no non-software, non-Basic-Render adapter reports mesh tier 1. The WARP variant also uses `SKIP_RETURN_CODE 77` (`CMakeLists.txt` `startup_indirect_mesh_${backend}`), so a WARP that loses mesh support would show as Skipped, not Failed. P3 (optional, not blocking): - (a) `src/startup_stubs/d3d12_xs_device.cpp:1966`: nothing runs a Draw/DrawIndexed pipeline with the mesh signature (or the reverse), so the new `pass.indirect_graphics.mesh != mesh` guard is untested. One extra refusal case in `tests/startup_indirect_draw_indexed.cpp` would cover it. - (b) `src/startup_stubs/d3d12_xs_device.cpp` (mesh stream-output refusal) and (c) the VS-in-mesh-stream refusal: no case feeds such a stream, so neither refusal is guarded. The native pipeline creation may reject them anyway, but then the wrapper's own message and fallback are what the guest sees. Limits: only WARP was available here (hardware adapter coverage is not claimed by the PR either). The Windows runs used the Debug and Release presets but the mutations ran on Debug only. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.