shader: prove packed mesh PARAM order and coverage (Part of #3703) #3926

Manually merged
github merged 1 commit from github-bot/gh-3924 into gh-pr/3924/base 2026-12-03 12:56:32 +00:00 AGit
Owner

@⁠timbot103 on GitHub · 2026-12-03 10:42 UTC · original
timbot103:shader/mesh-packed-signature-order → main · +155 −67 · 4 files · 1 commits · merged 2026-12-03 12:49 UTC

Part of #3705

P2 · Unproven packed mesh signature rows

The census at 368a045df put 740 programs in this first-refusal row. The work split described exp param0 after higher PARAM exports or inside a SAVEEXEC skip. This change proves both shapes on source-built input.

  • Resolve a reflected packed FP16 row without its own output record when exactly one preceding packed record can own it. Attribute ownership depends on signature register order independently of instruction order.
  • On direct allocation, accept a packed PARAM before POS0 and within an EXECZ skip when the reaching SAVEEXEC mask is exactly the allocated flat-thread vertex range. Staged allocation retains its position-coverage proof.
  • Competing row owners, missing source DWORDs, duplicate targets and narrower masks still refuse. The fixture verifies 3 DXIL modules and 4 refusal controls.

The private census still needs to be rerun to measure the first-refusal delta.

Verification

Windows 11 10.0.26200.9974, MSVC 19.44.35230.0, DXC 1.9.2602.17 (21d28f727). Microsoft Basic Render Driver (WARP) 10.0.26100.9818 and NVIDIA GeForce RTX 5080 32.0.16.2140 (621.40). The D3D12 debug layer was unavailable on both adapters.

Built with cmake --build out/build/dev -- -j 6 and cmake --build out/build/release --target compile_dxil offscreen_check startup_indirect_draw_indexed -- -j 6.

Tested commit 82aa325f.

ctest --preset dev --no-tests=error -j 1 -V -R 'native_direct_mesh|native_direct_container|native_mesh_' # 23 passed, 0 failed, 0 skipped
ctest --preset release --no-tests=error -j 1 -V -R 'native_direct_mesh|native_direct_container|native_mesh_' # 20 passed, 3 failed, 0 skipped
$env:X2W_SYNC_MESH_REQUESTS = '1'
ctest --preset release --no-tests=error -j 1 -V -R '^native_mesh_(guarded_allocation|empty_allocation|missing_position)_warp$' # 3 passed, 0 failed, 0 skipped
Remove-Item Env:X2W_SYNC_MESH_REQUESTS
ctest --preset pr --no-tests=error -R '^native_mesh_packed_order_dxil$' # 1 passed, 0 failed, 0 skipped
ctest --preset dev --no-tests=error -R '^native_compute_pack_refusals$' # 1 passed, 0 failed, 0 skipped

The existing mesh readbacks passed on the RTX 5080 (5/5 in Debug and Release) and WARP (5/5 in Debug). On Release WARP, the two read-first-lane tests passed and the three allocation tests reproduced #3666. The first allocation test reported accepted=1 refused=0, with one archived refusal expected. All three passed with synchronous mesh requests.

python -B tests/bidi_controls_check.py, python -B tests/docs_links_check.py, and git diff --check origin/main...HEAD passed.

🤖 Generated with Claude Code

**@⁠timbot103** on GitHub · 2026-12-03 10:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3924) `timbot103:shader/mesh-packed-signature-order` → `main` · +155 −67 · 4 files · 1 commits · merged 2026-12-03 12:49 UTC Part of #3705 ## P2 · Unproven packed mesh signature rows The census at `368a045df` put 740 programs in this first-refusal row. The work split described `exp param0` after higher PARAM exports or inside a SAVEEXEC skip. This change proves both shapes on source-built input. - Resolve a reflected packed FP16 row without its own output record when exactly one preceding packed record can own it. Attribute ownership depends on signature register order independently of instruction order. - On direct allocation, accept a packed PARAM before POS0 and within an EXECZ skip when the reaching SAVEEXEC mask is exactly the allocated flat-thread vertex range. Staged allocation retains its position-coverage proof. - Competing row owners, missing source DWORDs, duplicate targets and narrower masks still refuse. The fixture verifies 3 DXIL modules and 4 refusal controls. The private census still needs to be rerun to measure the first-refusal delta. ## Verification Windows 11 `10.0.26200.9974`, MSVC `19.44.35230.0`, DXC `1.9.2602.17` (`21d28f727`). Microsoft Basic Render Driver (WARP) `10.0.26100.9818` and NVIDIA GeForce RTX 5080 `32.0.16.2140` (`621.40`). The D3D12 debug layer was unavailable on both adapters. Built with `cmake --build out/build/dev -- -j 6` and `cmake --build out/build/release --target compile_dxil offscreen_check startup_indirect_draw_indexed -- -j 6`. Tested commit `82aa325f`. ```powershell ctest --preset dev --no-tests=error -j 1 -V -R 'native_direct_mesh|native_direct_container|native_mesh_' # 23 passed, 0 failed, 0 skipped ctest --preset release --no-tests=error -j 1 -V -R 'native_direct_mesh|native_direct_container|native_mesh_' # 20 passed, 3 failed, 0 skipped $env:X2W_SYNC_MESH_REQUESTS = '1' ctest --preset release --no-tests=error -j 1 -V -R '^native_mesh_(guarded_allocation|empty_allocation|missing_position)_warp$' # 3 passed, 0 failed, 0 skipped Remove-Item Env:X2W_SYNC_MESH_REQUESTS ctest --preset pr --no-tests=error -R '^native_mesh_packed_order_dxil$' # 1 passed, 0 failed, 0 skipped ctest --preset dev --no-tests=error -R '^native_compute_pack_refusals$' # 1 passed, 0 failed, 0 skipped ``` The existing mesh readbacks passed on the RTX 5080 (5/5 in Debug and Release) and WARP (5/5 in Debug). On Release WARP, the two read-first-lane tests passed and the three allocation tests reproduced #3666. The first allocation test reported `accepted=1 refused=0`, with one archived refusal expected. All three passed with synchronous mesh requests. `python -B tests/bidi_controls_check.py`, `python -B tests/docs_links_check.py`, and `git diff --check origin/main...HEAD` passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 10:48:46 +00:00
Author
Owner

@⁠timbot103 on GitHub · 2026-12-03 12:23 UTC · original

Marked Ready for review now that #3919–#3921 have merged, keeping within 5 non-draft PRs per #3516. The branch merges cleanly with current main, and CI is green at this head. It was also built and tested together with the other open wave branches (#3919–#3926).

**@⁠timbot103** on GitHub · 2026-12-03 12:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3924#issuecomment-7378156155) Marked Ready for review now that #3919–#3921 have merged, keeping within 5 non-draft PRs per #3516. The branch merges cleanly with current `main`, and CI is green at this head. It was also built and tested together with the other open wave branches (#3919–#3926).
github-bot changed target branch from main to gh-pr/3924/base 2026-12-03 12:56:16 +00:00
github manually merged commit 82aa325fdd into gh-pr/3924/base 2026-12-03 12:56:32 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-03 12:49 UTC · original · approved these changes

Reviewed 82aa325f. Checked reflected row ownership, defined source halves and the allocated vertex count on the direct SAVEEXEC path. Independently built compile_dxil in Windows MSVC Debug and ran ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^native_mesh_(packed_rows_vcc_ir|packed_order_dxil)$': 2/2 passed.

Forcing legacy_count_skip off made allocated-vertex-saveexec fail at +0x74. Removing the final limit equality by itself left both checks green. In the exercised varying-compare path the count must already match before the mask is recorded, so the narrower-count fixture exercises that earlier check. The unmodified build passed again. These checks validate and inspect emitted DXIL.

**@⁠R0Y00** on GitHub · 2026-12-03 12:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3924#pullrequestreview-6170127686) · **approved these changes** Reviewed 82aa325f. Checked reflected row ownership, defined source halves and the allocated vertex count on the direct SAVEEXEC path. Independently built compile_dxil in Windows MSVC Debug and ran `ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^native_mesh_(packed_rows_vcc_ir|packed_order_dxil)$'`: 2/2 passed. Forcing legacy_count_skip off made allocated-vertex-saveexec fail at +0x74. Removing the final limit equality by itself left both checks green. In the exercised varying-compare path the count must already match before the mask is recorded, so the narrower-count fixture exercises that earlier check. The unmodified build passed again. These checks validate and inspect emitted DXIL.
This discussion has been locked. Commenting is limited to contributors.
No description provided.