shader: lower packed mesh rows and whole-wave VCC branches (Part of #3703) #3841

Merged
timbot103 merged 1 commit from upstream-pr/3841 into main 2026-12-02 10:11:37 +00:00
timbot103 commented 2026-12-02 08:42:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-02T08:42:09Z.


Part of #3703.

Summary

Addresses two #3703 mesh refusal buckets (including unproven pair of packed mesh signature rows, the top remaining wall at 264 programs in the 2 Dec stacked mesh census, plus VCC branch without a whole-wave mask, 35 programs):

  • Packed mesh signature rows: generalizes packed FP16 PARAM export widening from 2 rows to 1–4 unambiguously reflected min16float rows (s.component == 6), with each row starting at a fresh DWORD and element-relative DXIL columns for non-zero start masks (e.g., .zw). Mixed-type rows, missing channels, overflow, and duplicate targets stay refused.
  • Whole-wave VCC branches: lowers s_mov_b64 vcc, exec, s_xor_b64 vcc, ..., full-EXEC lane-linear v_cmp_gt_u32 count tests (capped > wave_base), wave32 VCC_LO-only VCCZ tests, and invalidates both VCC representations on partial s_mov_b32 vcc_lo/vcc_hi writes or arm VCC changes.

Verification

  • ctest --preset pr --no-tests=error --output-on-failure -R '^native_mesh_packed_rows_vcc_ir$': passed (66 positive DXIL cases + 21 refusal controls).
  • Debug (dev) and Release (release): 3/3 passed (native_mesh_packed_rows_vcc_ir|native_direct_mesh|native_direct_container), zero skips, zero new C++20 /W4 warnings on edited lines.
  • tests/bidi_controls_check.py, tests/docs_links_check.py, and git diff --check origin/main..HEAD passed.
  • Opened as Draft under #3514's 5-PR ready cap.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5602907783 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3841). Originally posted by [timbot103](https://github.com/timbot103) on 2026-12-02T08:42:09Z. --- Part of #3703. ### Summary Addresses two #3703 mesh refusal buckets (including `unproven pair of packed mesh signature rows`, the top remaining wall at 264 programs in the 2 Dec stacked mesh census, plus `VCC branch without a whole-wave mask`, 35 programs): - **Packed mesh signature rows:** generalizes packed FP16 `PARAM` export widening from 2 rows to 1–4 unambiguously reflected `min16float` rows (`s.component == 6`), with each row starting at a fresh DWORD and element-relative DXIL columns for non-zero start masks (e.g., `.zw`). Mixed-type rows, missing channels, overflow, and duplicate targets stay refused. - **Whole-wave VCC branches:** lowers `s_mov_b64 vcc, exec`, `s_xor_b64 vcc, ...`, full-EXEC lane-linear `v_cmp_gt_u32` count tests (`capped > wave_base`), wave32 `VCC_LO`-only `VCCZ` tests, and invalidates both VCC representations on partial `s_mov_b32 vcc_lo/vcc_hi` writes or arm VCC changes. ### Verification - `ctest --preset pr --no-tests=error --output-on-failure -R '^native_mesh_packed_rows_vcc_ir$'`: passed (66 positive DXIL cases + 21 refusal controls). - Debug (`dev`) and Release (`release`): 3/3 passed (`native_mesh_packed_rows_vcc_ir|native_direct_mesh|native_direct_container`), zero skips, zero new C++20 `/W4` warnings on edited lines. - `tests/bidi_controls_check.py`, `tests/docs_links_check.py`, and `git diff --check origin/main..HEAD` passed. - Opened as Draft under `#3514`'s 5-PR ready cap.
lukaslw-lab commented 2026-12-02 08:47:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T08:47:12Z.

Review: APPROVED


Reviewed 52744450 (draft) by reading the diff; not built or run.

Verdict: approve. The new VCC forms keep each lane's bit, the words and the nonempty flag consistent, and the packed-row widening stays unambiguous. No MUST.

  • SHOULD Run a before/after m86 census on f365f125. On our local stack, the packed-rows wall is 264 programs, so it is the largest one this targets. The VCC changes also mark VCC unknown wherever an arm or partial write changed it, which can refuse programs that translate today.
  • NIT This conflicts with #3832 in the packed-row export (the position_scope condition #3832 relaxes for staged exports).
  • Checked, no finding:
    • Count test (gfx1013_direct_mesh.inl:1908): under full EXEC, v_cmp_gt_u32 limit, tid is nonempty for a wave exactly when its first thread is below min(limit, threads). It is recorded only for a uniform limit.
    • s_xor_b64 vcc and s_mov_b64 vcc, exec: the words and the lane bit come from the same sources, and constant operands give 0/-1 words with 0/1 bits. Uniform SGPR words are split per lane by wave_lane.
    • Wave32 VCCZ reads VCC_LO only (:2241), as the ISA specifies, while SCC of the B64 operation still uses both words.
    • s_mov_b32 to vcc_lo/vcc_hi (:2389) and VCC changed in an arm (vcc_changed, :849) clear both representations, so later reads fail closed.
    • Packed rows (:1369): only min16float rows, one per signature row, with no output record of their own. Tail rows are claimed only by a sole packed PARAM, and every channel must be exported.

Tests: native_mesh_packed_rows_vcc_ir (66 cases, 21 refusals) is in the pr filter.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6147386226 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3841#pullrequestreview-6147386226). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-12-02T08:47:12Z. **Review:** APPROVED --- Reviewed `52744450` (draft) by reading the diff; not built or run. **Verdict: approve.** The new VCC forms keep each lane's bit, the words and the nonempty flag consistent, and the packed-row widening stays unambiguous. No MUST. - **SHOULD** Run a before/after `m86` census on `f365f125`. On our local stack, the packed-rows wall is 264 programs, so it is the largest one this targets. The VCC changes also mark VCC unknown wherever an arm or partial write changed it, which can refuse programs that translate today. - **NIT** This conflicts with #3832 in the packed-row export (the `position_scope` condition #3832 relaxes for staged exports). - Checked, no finding: - Count test (`gfx1013_direct_mesh.inl:1908`): under full EXEC, `v_cmp_gt_u32 limit, tid` is nonempty for a wave exactly when its first thread is below `min(limit, threads)`. It is recorded only for a uniform limit. - `s_xor_b64 vcc` and `s_mov_b64 vcc, exec`: the words and the lane bit come from the same sources, and constant operands give `0`/`-1` words with `0`/`1` bits. Uniform SGPR words are split per lane by `wave_lane`. - Wave32 VCCZ reads `VCC_LO` only (`:2241`), as the ISA specifies, while SCC of the B64 operation still uses both words. - `s_mov_b32` to `vcc_lo`/`vcc_hi` (`:2389`) and VCC changed in an arm (`vcc_changed`, `:849`) clear both representations, so later reads fail closed. - Packed rows (`:1369`): only `min16float` rows, one per signature row, with no output record of their own. Tail rows are claimed only by a sole packed PARAM, and every channel must be exported. Tests: `native_mesh_packed_rows_vcc_ir` (66 cases, 21 refusals) is in the `pr` filter.
lukaslw-lab commented 2026-12-02 09:23:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T09:23:04Z.


Census follow-up for the SHOULD in my review: f365f125 + this PR alone, same capture and method as #3703 / #3814 (6,685 distinct mesh programs, 6,436 pixel stages). Counts only.

Build Mesh translated Lost vs main
f365f125 1,036 —
f365f125 + #3841 1,044 (+8) 0

94 programs move off their first refusal: unproven pair of packed mesh signature rows 59, mesh VCC branch lacks a proven guest whole-wave mask 35. No validation failures.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7340808201 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3841#issuecomment-7340808201). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-12-02T09:23:04Z. --- Census follow-up for the SHOULD in my review: `f365f125` + this PR alone, same capture and method as #3703 / #3814 (6,685 distinct mesh programs, 6,436 pixel stages). Counts only. | Build | Mesh translated | Lost vs main | |---|---:|---:| | `f365f125` | 1,036 | — | | `f365f125` + #3841 | **1,044** (+8) | 0 | 94 programs move off their first refusal: `unproven pair of packed mesh signature rows` 59, `mesh VCC branch lacks a proven guest whole-wave mask` 35. No validation failures.
timbot103 commented 2026-12-02 09:34:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-02T09:34:19Z.


Promoted to Ready for review now that #3806 and #3826 merged (keeping at 5/5 non-draft PRs per #3514). Re-checked CLEAN / MERGEABLE against origin/main (45c809ab) with all CI checks green.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7341126294 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3841#issuecomment-7341126294). Originally posted by [timbot103](https://github.com/timbot103) on 2026-12-02T09:34:19Z. --- Promoted to Ready for review now that #3806 and #3826 merged (keeping at 5/5 non-draft PRs per #3514). Re-checked `CLEAN / MERGEABLE` against `origin/main` (`45c809ab`) with all CI checks green.
R0Y00 commented 2026-12-02 10:08:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T10:08:20Z.

Review: COMMENTED


On exact head 52744450, a local Windows Debug build passed both native_mesh_packed_rows_vcc_ir and native_direct_mesh. This branch's baseline predates the current main failure in the unrelated integer/float row fixture. I am testing its integration with the isolated fixture repair before landing.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6148713521 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3841#pullrequestreview-6148713521). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T10:08:20Z. **Review:** COMMENTED --- On exact head `52744450`, a local Windows Debug build passed both `native_mesh_packed_rows_vcc_ir` and `native_direct_mesh`. This branch's baseline predates the current main failure in the unrelated integer/float row fixture. I am testing its integration with the isolated fixture repair before landing.
R0Y00 commented 2026-12-02 10:10:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T10:10:56Z.

Review: APPROVED


Exact-head Windows Debug regression passed native_mesh_packed_rows_vcc_ir and native_direct_mesh (2/2). The local trial merge with current main, #3828, #3831, and the separate fixture correction from #3851 also passed both Mesh checks and six pixel controls/readbacks (8/8 total).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6148757163 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3841#pullrequestreview-6148757163). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T10:10:56Z. **Review:** APPROVED --- Exact-head Windows Debug regression passed `native_mesh_packed_rows_vcc_ir` and `native_direct_mesh` (2/2). The local trial merge with current main, #3828, #3831, and the separate fixture correction from #3851 also passed both Mesh checks and six pixel controls/readbacks (8/8 total).
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!3841
No description provided.