Disambiguate slot 86 mesh and amplification tags #2240

Merged
R0Y00 merged 2 commits from upstream-pr/2248 into main 2026-11-25 08:20:11 +00:00
R0Y00 commented 2026-11-25 07:40:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T07:40:36Z.


Refs #1759 and #1760.

Slot 86 accepts an Xbox MS subobject with tag 24 when it contains a bounded, desktop-format shader-model-6 mesh program. Desktop amplification DXIL has the same tag and keeps its amplification role with a desktop MS subobject. Unsupported DXIL and ambiguous or duplicate stage combinations are refused. The existing native PSO restrictions still apply, including the empty root signature and one single-sample color target. Console program translation and fixed-descriptor pipeline creation are outside this change.

cmake --build --preset release --target startup_indirect_draw_indexed
ctest --preset release --no-tests=error -j 1 -R '^startup_indirect_(mesh_|draw(_indexed)?_(warp|hardware))' -V

Release on Windows 11 build 26200.9974 passed 10/10 with no skips. WARP used driver 10.0.26100.9818. The GeForce RTX 4060 Laptop GPU used driver 32.0.16.1656. The D3D12 debug layer was enabled on both adapters. The desktop mesh tag, console mesh tag and desktop AS-to-MS payload cases produced 4/8 and 8/8 non-clear pixels for one and two GPU-written groups. Pixel DXIL under the shared tag left 0/8 non-clear pixels. Argument guards remained intact. The previous shim rejected the new console-tag fixture on WARP, leaving 0/8 non-clear pixels where four were expected.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6599651573 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2248). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T07:40:36Z. --- Refs #1759 and #1760. Slot 86 accepts an Xbox MS subobject with tag 24 when it contains a bounded, desktop-format shader-model-6 mesh program. Desktop amplification DXIL has the same tag and keeps its amplification role with a desktop MS subobject. Unsupported DXIL and ambiguous or duplicate stage combinations are refused. The existing native PSO restrictions still apply, including the empty root signature and one single-sample color target. Console program translation and fixed-descriptor pipeline creation are outside this change. ```powershell cmake --build --preset release --target startup_indirect_draw_indexed ctest --preset release --no-tests=error -j 1 -R '^startup_indirect_(mesh_|draw(_indexed)?_(warp|hardware))' -V ``` Release on Windows 11 build 26200.9974 passed 10/10 with no skips. WARP used driver 10.0.26100.9818. The GeForce RTX 4060 Laptop GPU used driver 32.0.16.1656. The D3D12 debug layer was enabled on both adapters. The desktop mesh tag, console mesh tag and desktop AS-to-MS payload cases produced 4/8 and 8/8 non-clear pixels for one and two GPU-written groups. Pixel DXIL under the shared tag left 0/8 non-clear pixels. Argument guards remained intact. The previous shim rejected the new console-tag fixture on WARP, leaving 0/8 non-clear pixels where four were expected.
tedin7 commented 2026-11-25 07:43:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T07:43:20Z.

Review: COMMENTED


Review of head e46ef0db72a463f2474b9a152841c34f49050fb7.

Scope read: desktop_dxil_mesh_stage() and the stream rewrite in build_stream_pipeline() (src/startup_stubs/d3d12_xs_device.cpp), the new CTest entries, the new HLSL/fixture cases and the docs note.

Commands executed locally (Linux):

  • git diff --stat origin/main...HEAD: 5 files, +154/-31.
  • python3 tests/docs_links_check.py: self-test passed, 18 Markdown files, 419 links OK.
  • python3 tests/bidi_controls_check.py: 1523 files, no bidirectional controls.
  • git diff --check origin/main...HEAD: clean.
  • git merge-tree --write-tree origin/main HEAD: CONFLICT (content): Merge conflict in tests/startup_indirect_draw_indexed.cpp.
  • gh pr checks 2248: Linux Python checks pass; Windows build/test and gfx1013 fixtures were still pending when I looked.

P1: none.

P2

  1. The PR conflicts with main in tests/startup_indirect_draw_indexed.cpp (GitHub also reports CONFLICTING). Please rebase and re-run the Windows targets named in the body on the rebased head, because the conflict is inside the file that holds the new fixtures.
  2. The PR is not a Draft, but the Windows CI jobs were still pending and the PR cannot merge as it stands. Consider moving it back to Draft until the rebase and a fresh Windows run are in.

Logic review (no defects found)

  • Tag 24 is classified from the actual DXIL program-version kind (13 = mesh, 14 = amplification) with SM major 6 enforced. Only the mesh case is rewritten to the MS tag, so a desktop amplification shader keeps its role.
  • Container parsing is bounded: header and part offsets, part sizes, the program-header size word, the bitcode offset and size, and the BC C0 DE magic. XDAT parts and duplicate DXIL parts are refused. I found no out-of-range read.
  • Ordering is symmetric: an MS-then-AS stream and an AS-then-MS stream are both handled. Mesh + mesh, two amplification subobjects, and amplification without mesh are refused by the mesh/amplification/console_mesh flags and the final (amplification && !mesh) guard.
  • The second pass sees the rewritten tag, so the empty-root and pixel-stage checks apply equally to the console-tag and desktop-tag mesh paths.
  • Nit: type is now a mutable reference into the copied stream. This is correct, but a short comment saying "tag rewritten in the copy" at the first mutation would help future readers (the existing comment mentions rewriting, so this is minor).
  • Nit: the error text "ambiguous or unsupported DXIL" covers both an unreadable container and a real ambiguity. Splitting the two messages would make triage easier.

Mutation testing: not run. The touched code is D3D12 and Windows-only, so it cannot be built here. Mutation and runtime proof belong to the Windows run. I did not queue Win2025 myself.

Verdict (comment only): logic looks sound. The blocker is the merge conflict. Re-check the new tests on the rebased head.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6053625471 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2248#pullrequestreview-6053625471). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T07:43:20Z. **Review:** COMMENTED --- Review of head `e46ef0db72a463f2474b9a152841c34f49050fb7`. **Scope read:** `desktop_dxil_mesh_stage()` and the stream rewrite in `build_stream_pipeline()` (`src/startup_stubs/d3d12_xs_device.cpp`), the new CTest entries, the new HLSL/fixture cases and the docs note. **Commands executed locally (Linux):** - `git diff --stat origin/main...HEAD`: 5 files, +154/-31. - `python3 tests/docs_links_check.py`: self-test passed, 18 Markdown files, 419 links OK. - `python3 tests/bidi_controls_check.py`: 1523 files, no bidirectional controls. - `git diff --check origin/main...HEAD`: clean. - `git merge-tree --write-tree origin/main HEAD`: `CONFLICT (content): Merge conflict in tests/startup_indirect_draw_indexed.cpp`. - `gh pr checks 2248`: Linux Python checks pass; Windows build/test and gfx1013 fixtures were still pending when I looked. **P1: none.** **P2** 1. The PR conflicts with `main` in `tests/startup_indirect_draw_indexed.cpp` (GitHub also reports `CONFLICTING`). Please rebase and re-run the Windows targets named in the body on the rebased head, because the conflict is inside the file that holds the new fixtures. 2. The PR is not a Draft, but the Windows CI jobs were still pending and the PR cannot merge as it stands. Consider moving it back to Draft until the rebase and a fresh Windows run are in. **Logic review (no defects found)** - Tag 24 is classified from the actual DXIL program-version kind (13 = mesh, 14 = amplification) with SM major 6 enforced. Only the mesh case is rewritten to the MS tag, so a desktop amplification shader keeps its role. - Container parsing is bounded: header and part offsets, part sizes, the program-header size word, the bitcode offset and size, and the `BC C0 DE` magic. `XDAT` parts and duplicate DXIL parts are refused. I found no out-of-range read. - Ordering is symmetric: an MS-then-AS stream and an AS-then-MS stream are both handled. Mesh + mesh, two amplification subobjects, and amplification without mesh are refused by the `mesh`/`amplification`/`console_mesh` flags and the final `(amplification && !mesh)` guard. - The second pass sees the rewritten tag, so the empty-root and pixel-stage checks apply equally to the console-tag and desktop-tag mesh paths. - Nit: `type` is now a mutable reference into the copied stream. This is correct, but a short comment saying "tag rewritten in the copy" at the first mutation would help future readers (the existing comment mentions rewriting, so this is minor). - Nit: the error text "ambiguous or unsupported DXIL" covers both an unreadable container and a real ambiguity. Splitting the two messages would make triage easier. **Mutation testing:** not run. The touched code is D3D12 and Windows-only, so it cannot be built here. Mutation and runtime proof belong to the Windows run. I did not queue Win2025 myself. **Verdict (comment only):** logic looks sound. The blocker is the merge conflict. Re-check the new tests on the rebased head. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 09:03:59 +00:00
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
R0Y00/Xbox2Windows!2240
No description provided.