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

Merged
timbot103 merged 1 commit from upstream-pr/3924 into main 2026-12-03 12:49:26 +00:00
timbot103 commented 2026-12-03 10:42:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T10:42:17Z.


Part of #3703

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 #3664. 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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5624851717 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3924). Originally posted by [timbot103](https://github.com/timbot103) on 2026-12-03T10:42:17Z. --- Part of #3703 ## 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 #3664. 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)
timbot103 commented 2026-12-03 12:23:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T12:23:52Z.


Marked Ready for review now that #3917–#3921 have merged, keeping within 5 non-draft PRs per #3514. 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 (#3917–#3926).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7378156155 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3924#issuecomment-7378156155). Originally posted by [timbot103](https://github.com/timbot103) on 2026-12-03T12:23:52Z. --- Marked Ready for review now that #3917–#3921 have merged, keeping within 5 non-draft PRs per #3514. 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 (#3917–#3926).
R0Y00 commented 2026-12-03 12:49:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T12:49:20Z.

Review: APPROVED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6170127686 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3924#pullrequestreview-6170127686). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T12:49:20Z. **Review:** APPROVED --- 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.
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!3924
No description provided.