shader: supply mesh57 descriptor words from the guest V# #3801

Merged
lambirou merged 18 commits from upstream-pr/3801 into main 2026-12-03 14:57:32 +00:00
lambirou commented 2026-12-01 23:58:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-01T23:58:48Z.


Problem

The slot 57 runtime previously bound a temporary SRV for the guest descriptor words and copied that descriptor into the draw heap. The submitter also accepted a nonzero exit from an in-box WARP pre-dispatch fault, so it could report a pass without reaching the draw.

The remaining two-table failure was in the fixture: it placed the second physical SRV at a hard-coded 32-byte offset. WARP uses a 64-byte descriptor increment, so the view landed on an invalid descriptor and removed the device.

Change

  • Create the 8192-dword R32_UINT table SRV directly in the shader-visible heap. The runtime no longer stages a temporary descriptor or calls CopyDescriptorsSimple.
  • Use a synthetic guest V# for the exact descriptor-word case while preserving the separate two-buffer and RTV probe.
  • Create the second table view at the adapter's measured descriptor increment, then copy its 32-byte token into the mesh table's 32-byte logical slot.
  • Keep every capability skip tied to a complete pre-failure probe transcript. Descriptor words remains an unconditional exact requirement.
  • Include the pixel coordinate, expected and observed values, dispatch census and process streams when a pixel mismatch occurs.

Validation

  • startup_mesh57_runtime_warp: passed, 1/1, descriptor words and two-table entries each match all 1024 pixels with dispatchmesh 1.
  • startup_mesh57_runtime_hardware: passed, 1/1 on AMD RX 9060 XT, driver 32.0.32029.2010.
  • native_direct: passed, 4/4.
  • Mutation of V# word 5 to zero: fails at (16,1), expected bf4000ff, got bf0000ff, with dispatchmesh 1.
  • Hosted Windows CI for dcf7828e: all required checks passed.
  • python -B tests/docs_links_check.py and git diff --check passed locally.

Refs #3703, #2413. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5596924421 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3801). Originally posted by [lambirou](https://github.com/lambirou) on 2026-12-01T23:58:48Z. --- ## Problem The slot 57 runtime previously bound a temporary SRV for the guest descriptor words and copied that descriptor into the draw heap. The submitter also accepted a nonzero exit from an in-box WARP pre-dispatch fault, so it could report a pass without reaching the draw. The remaining two-table failure was in the fixture: it placed the second physical SRV at a hard-coded 32-byte offset. WARP uses a 64-byte descriptor increment, so the view landed on an invalid descriptor and removed the device. ## Change - Create the 8192-dword `R32_UINT` table SRV directly in the shader-visible heap. The runtime no longer stages a temporary descriptor or calls `CopyDescriptorsSimple`. - Use a synthetic guest V# for the exact descriptor-word case while preserving the separate two-buffer and RTV probe. - Create the second table view at the adapter's measured descriptor increment, then copy its 32-byte token into the mesh table's 32-byte logical slot. - Keep every capability skip tied to a complete pre-failure probe transcript. Descriptor words remains an unconditional exact requirement. - Include the pixel coordinate, expected and observed values, dispatch census and process streams when a pixel mismatch occurs. ## Validation - `startup_mesh57_runtime_warp`: passed, 1/1, descriptor words and two-table entries each match all 1024 pixels with `dispatchmesh 1`. - `startup_mesh57_runtime_hardware`: passed, 1/1 on AMD RX 9060 XT, driver `32.0.32029.2010`. - `native_direct`: passed, 4/4. - Mutation of V# word 5 to zero: fails at `(16,1)`, `expected bf4000ff, got bf0000ff`, with `dispatchmesh 1`. - Hosted Windows CI for `dcf7828e`: all required checks passed. - `python -B tests/docs_links_check.py` and `git diff --check` passed locally. Refs #3703, #2413. AI-assisted.
lambirou commented 2026-12-02 14:44:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-02T14:44:58Z.

Review: COMMENTED


Reviewed ad7a54d0 against #3758/#3754; read the frontend, runtime binding and revision changes, not built here.

Verdict: changes requested. The frontend now materialises descriptor words through a 1024-entry table and bumps the mesh57 revision to 5, but the PR body itself says the runtime root-signature/binding path is not proven by a fixture. A mismatch between the guest table parameter and the runtime root SRV would only appear on the real capture, after the profile revision has already changed.

  • MUST Add a runtime fixture that binds the 1024-entry descriptor table, reads words 1–3 through it, and covers a missing entry, a non-SRV entry and an out-of-range slot. The frontend controls alone do not prove the host root signature, the SRV root parameter or the table construction.
  • MUST descriptor_table_root() selects the first guest descriptor-table root parameter without checking that it declares an SRV range or that it is the table the eight-word fetch came from. Validate the table's ranges and the expected register/space, or require the translator to carry the root index explicitly.
  • SHOULD The revision bump invalidates every existing slot 57 cache entry. The docs/body should state that cost and the fallback when the new root binding is absent; a missing descriptor table currently refuses during lowering, so an older profile can no longer be reused.
  • Checked, no finding: the descriptor words are bounds-checked at 1024 entries; non-SRV entries stay zero; the runtime refuses the published pair when the descriptor table is present but the profile does not describe it; the frontend still refuses numeric reads outside the eight-word fetch.

The PR is currently DIRTY; rebase and rerun the mesh57 runtime checks after the base PRs land.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6153057209 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3801#pullrequestreview-6153057209). Originally posted by [lambirou](https://github.com/lambirou) on 2026-12-02T14:44:58Z. **Review:** COMMENTED --- Reviewed `ad7a54d0` against #3758/#3754; read the frontend, runtime binding and revision changes, not built here. **Verdict: changes requested.** The frontend now materialises descriptor words through a 1024-entry table and bumps the mesh57 revision to 5, but the PR body itself says the runtime root-signature/binding path is not proven by a fixture. A mismatch between the guest table parameter and the runtime root SRV would only appear on the real capture, after the profile revision has already changed. - **MUST** Add a runtime fixture that binds the 1024-entry descriptor table, reads words 1–3 through it, and covers a missing entry, a non-SRV entry and an out-of-range slot. The frontend controls alone do not prove the host root signature, the SRV root parameter or the table construction. - **MUST** `descriptor_table_root()` selects the first guest descriptor-table root parameter without checking that it declares an SRV range or that it is the table the eight-word fetch came from. Validate the table's ranges and the expected register/space, or require the translator to carry the root index explicitly. - **SHOULD** The revision bump invalidates every existing slot 57 cache entry. The docs/body should state that cost and the fallback when the new root binding is absent; a missing descriptor table currently refuses during lowering, so an older profile can no longer be reused. - Checked, no finding: the descriptor words are bounds-checked at 1024 entries; non-SRV entries stay zero; the runtime refuses the published pair when the descriptor table is present but the profile does not describe it; the frontend still refuses numeric reads outside the eight-word fetch. The PR is currently `DIRTY`; rebase and rerun the mesh57 runtime checks after the base PRs land.
R0Y00 commented 2026-12-03 11:59:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T11:59:41Z.

Review: CHANGES_REQUESTED


The previous hosted Windows failure at 74092072 was startup_mesh57_runtime_warp, descriptor words: the fixture process exited 2173. At 60a8ff0f, the replacement returns 0 for that exit code on any WARP build before checking the forwarded draw or reading pixels. It never checks a driver version or adapter capability. A repeated descriptor-write failure can therefore make the test pass without exercising the PR's new runtime binding.

Please keep this failure visible while diagnosing the descriptor write. If the case is unsupported on the hosted adapter, gate that condition on an independently measured capability, or move the descriptor-only case to a separate CTest and report a verified capability skip as 77. The hardware and capable WARP paths should still require the forwarded draw, exact pixels and negative cases.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6169330143 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3801#pullrequestreview-6169330143). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T11:59:41Z. **Review:** CHANGES_REQUESTED --- The previous hosted Windows failure at 74092072 was startup_mesh57_runtime_warp, descriptor words: the fixture process exited 2173. At 60a8ff0f, the replacement returns 0 for that exit code on any WARP build before checking the forwarded draw or reading pixels. It never checks a driver version or adapter capability. A repeated descriptor-write failure can therefore make the test pass without exercising the PR's new runtime binding. Please keep this failure visible while diagnosing the descriptor write. If the case is unsupported on the hosted adapter, gate that condition on an independently measured capability, or move the descriptor-only case to a separate CTest and report a verified capability skip as 77. The hardware and capable WARP paths should still require the forwarded draw, exact pixels and negative cases.
lambirou commented 2026-12-03 14:06:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-03T14:06:52Z.


Updated at 2411e130. The runtime now creates the descriptor-word table SRV directly in the shader-visible heap and the descriptor-word fixture uses a synthetic guest V#; the global hosted-WARP 2173 skip is removed. The exact case passes on WARP and RX 9060 XT with dispatchmesh 1 and all 1024 expected pixels. The unrelated two-table control is gated by a separate, independent two-SRV probe. A word-5 mutation still fails at the expected pixel. Please rerun the hosted checks on this head; the CI rerun will verify the hosted WARP runtime independently from the local Debug run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7380911117 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3801#issuecomment-7380911117). Originally posted by [lambirou](https://github.com/lambirou) on 2026-12-03T14:06:52Z. --- Updated at `2411e130`. The runtime now creates the descriptor-word table SRV directly in the shader-visible heap and the descriptor-word fixture uses a synthetic guest V#; the global hosted-WARP 2173 skip is removed. The exact case passes on WARP and RX 9060 XT with `dispatchmesh 1` and all 1024 expected pixels. The unrelated two-table control is gated by a separate, independent two-SRV probe. A word-5 mutation still fails at the expected pixel. Please rerun the hosted checks on this head; the CI rerun will verify the hosted WARP runtime independently from the local Debug run.
R0Y00 commented 2026-12-03 14:21:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T14:21:07Z.


Re-ran 2411e130 in MSVC Debug on Windows 11 build 26300 with the D3D12 debug layer enabled. The synthetic descriptor-word case now forwards one DispatchMesh and matches all 1,024 pixels on both WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. Native direct mesh and the full RTX runtime case passed. The full WARP runtime test still fails in two table entries with exit 2173. I ran descriptor-srv-write-probe separately on the same WARP build: both shader-visible views were accepted, zero D3D12 warnings/errors, exit 0. This probe does not reproduce the remaining two-table failure on this driver, so I am keeping the review open for that path.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7381300285 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3801#issuecomment-7381300285). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T14:21:07Z. --- Re-ran 2411e130 in MSVC Debug on Windows 11 build 26300 with the D3D12 debug layer enabled. The synthetic descriptor-word case now forwards one DispatchMesh and matches all 1,024 pixels on both WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. Native direct mesh and the full RTX runtime case passed. The full WARP runtime test still fails in two table entries with exit 2173. I ran descriptor-srv-write-probe separately on the same WARP build: both shader-visible views were accepted, zero D3D12 warnings/errors, exit 0. This probe does not reproduce the remaining two-table failure on this driver, so I am keeping the review open for that path.
lambirou commented 2026-12-03 14:24:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-03T14:24:14Z.


Superseded by dcf7828ed: the first probe at a4418820 created two buffer SRVs, but the hosted two-views case still failed. The measured difference was the hard-coded physical descriptor offset. WARP reports a 64-byte descriptor increment, while the mesh table uses a 32-byte logical stride.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7381386945 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3801#issuecomment-7381386945). Originally posted by [lambirou](https://github.com/lambirou) on 2026-12-03T14:24:14Z. --- Superseded by `dcf7828ed`: the first probe at `a4418820` created two buffer SRVs, but the hosted `two-views` case still failed. The measured difference was the hard-coded physical descriptor offset. WARP reports a 64-byte descriptor increment, while the mesh table uses a 32-byte logical stride.
R0Y00 commented 2026-12-03 14:50:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T14:50:05Z.

Review: APPROVED


Re-reviewed dcf7828e. The two-table fixture now creates the second SRV at the real heap increment and copies just its token into the 32-byte logical slot. In my prior one-line experiment on a4418820, using only the physical increment avoided the SRV fault but yielded mesh_bind: unsupported MS native byte buffer descriptor. The current logical-slot copy fixes that second part.

Independently rebuilt with MSVC Debug on Windows 11 build 26300 and ran ctest --preset dev --no-tests=error -j 1 -V -R '^(startup_mesh57_runtime_(warp|hardware)|native_direct_mesh)$': 3/3 passed. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 each reached both descriptor words and two table entries, with one forwarded DispatchMesh and 1,024 matching pixels per case. The D3D12 debug layer was enabled, with no capability skips. The previous WARP failure is resolved in this run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6172123222 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3801#pullrequestreview-6172123222). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T14:50:05Z. **Review:** APPROVED --- Re-reviewed dcf7828e. The two-table fixture now creates the second SRV at the real heap increment and copies just its token into the 32-byte logical slot. In my prior one-line experiment on a4418820, using only the physical increment avoided the SRV fault but yielded mesh_bind: unsupported MS native byte buffer descriptor. The current logical-slot copy fixes that second part. Independently rebuilt with MSVC Debug on Windows 11 build 26300 and ran `ctest --preset dev --no-tests=error -j 1 -V -R '^(startup_mesh57_runtime_(warp|hardware)|native_direct_mesh)$'`: 3/3 passed. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 each reached both descriptor words and two table entries, with one forwarded DispatchMesh and 1,024 matching pixels per case. The D3D12 debug layer was enabled, with no capability skips. The previous WARP failure is resolved in this run.
lambirou commented 2026-12-03 14:58:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-03T14:58:03Z.


Fixed and merged at dcf7828ed. The actual two-views failure was the hard-coded cpu + 32 physical descriptor offset: WARP reports a 64-byte descriptor increment. The fixture now creates the second SRV at the measured physical increment and copies its 32-byte token to the logical slot read by the mesh program. The independent probe mirrors the two-buffer plus RTV path and only maps WARP 2173 to a measured skip after a valid pre-failure transcript; all other results remain failures. Local descriptor words still passes with 1024 exact pixels and dispatchmesh 1. CI run https://github.com/R0Y00/Xbox2Windows/actions/runs/47130310749 is green: Windows 12m09s, Linux Python and gfx1013 assembly all passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7382334683 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3801#issuecomment-7382334683). Originally posted by [lambirou](https://github.com/lambirou) on 2026-12-03T14:58:03Z. --- Fixed and merged at `dcf7828ed`. The actual `two-views` failure was the hard-coded `cpu + 32` physical descriptor offset: WARP reports a 64-byte descriptor increment. The fixture now creates the second SRV at the measured physical increment and copies its 32-byte token to the logical slot read by the mesh program. The independent probe mirrors the two-buffer plus RTV path and only maps WARP `2173` to a measured skip after a valid pre-failure transcript; all other results remain failures. Local `descriptor words` still passes with 1024 exact pixels and `dispatchmesh 1`. CI run https://github.com/R0Y00/Xbox2Windows/actions/runs/47130310749 is green: Windows `12m09s`, Linux Python and gfx1013 assembly all passed.
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!3801
No description provided.