shader: lower whole-quad EXECZ joins in pixel stages (Part of #3814) #3848
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3848"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-02T09:01:22Z.
Part of #3814 (W5: ~270 pixel stages where a skip lands on
s_wqm_b64).Summary
Extends pixel read-only arm lowering in
src/gfx1013_direct_graphics.inlto handle whole-quad (s_wqm_b64/s_wqm_b32) joins:s_wqm_b64 exec, sPrestores (wave64 and wave32) as well as two-step pairs (s_mov_b64 exec, sP; s_wqm_b64 exec, execands_wqm_b64 sW, sP; s_mov_b64 exec, sW).covered_lane()so helper lanes preserve their entry values before WQM activates for subsequent implicit-LOD sampling / DPP ops.s_wqm_b64 exec, exectargets (WQM(0) == 0), unproven/clobberedsP, reviving killed lanes, escaped arm scalars/SCC, and wave32/wave64 mismatches.Verification
compile_dxil,offscreen_check, andnative_pixel_ir_dumpin Debug (dev) and Release (release) with zero new C++20/W4warnings on edited lines.ctest --preset pr --no-tests=error --output-on-failure -R '^native_pixel_w5_wqm_reentry_controls$': passed (19 validated translations + 23 refusals).dev) and Release (release): 10/10 passed in each build, zero skips.10.0.26100.9818) and NVIDIA GeForce RTX 5080 (32.0.16.2140) on Windows 11 (26200.9974): matched all 8 exact 8×2 references and rejected all 8 wrong references per build/adapter.tests/bidi_controls_check.py,tests/docs_links_check.py, andgit diff --check origin/main..HEADpassed.#3514's 5-PR ready cap.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T09:59:32Z.
Review: APPROVED
Reviewed
d65f3c79(draft) by reading the diff and running an offline pixel census of this PR alone; not otherwise built or run.Verdict: approve. A one- or two-armed region that joins with
s_wqmis lowered with helper lanes kept at their entry values until whole-quad mode resumes, and every shape outside that proof keeps its refusal. No MUST.Census,
f365f125+ this PR alone, same capture as #3814 (6,436 pixel stages): 272 translate on both builds, none lost, but no stage changes its first refusal. The W5 shape in that capture is not one of the three accepted joins. The skip lands ons_wqm_b64 sW, sPfollowed bys_and_b64 exec, sW, sX(WQM of the saved mask, ANDed with another pair: 42 + 7 of the W5 sample in #3814), not ons_mov_b64 exec, sW. SHOULD: accept that AND form too, if the second pair can be proven to be entry coverage, or the W5 count stays at 0 on real stages.gfx1013_direct_graphics.inl, mostly inpixel_readonly_arms.gfx1013_direct_graphics.inl:788):s_wqm exec, sP,s_mov exec, sP; s_wqm exec, execands_wqm sW, sP; s_mov exec, sWonly. No edge may enter between the narrowing and the end of the restore, and no backward edge is allowed (:870). At the join (:2346),sPmust carry a saved entry tag (0or1), VCC is cleared when entering from exact mode, and SCC and any scratch pair are cleared.:2527). The THEN bit is ANDed with entry coverage, and the ELSE branch also skips helper lanes (:3262). So a helper's VGPRs still hold what the guest helper holds whens_wqmre-activates it for later derivatives.:1161) and a restore that is a WQM pair, so the two passes cannot both take one region.Tests:
_controls(19 translations, 23 refusals) is in theprfilter. The 8 draws per adapter ran only locally.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-12-02T20:26:33Z.
Review: APPROVED
Re-review on
02bdd8c9(rebased on5770f14e; the WQM-join conditions are merged with main'ss_or_b64restores and the mask-chain source check).Verdict: approve.
Census, same capture and method as before (6,436 distinct pixel stages), main
5770f14evs this head:Same as the earlier head: no W5 stage in this capture reaches the re-entered WQM first, so the fixtures carry the proof.
Checked:
wqm_join_only) before the ordinary read-only arms, and the WQM-capture path now skips their lane branches and split restores. No region is claimed twice.s_mov+s_wqm, either order).0or1). The join drops SCC, the pre-WQM VCC and the arm writes, then sets whole-quad mode.s_add_u32and scalar loads are the only extra scalar work allowed in a WQM arm. SCC froms_add_u32expires at the join.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-02T23:20:58Z.
Merged
main(67862ee4) into this branch. The reviewed commit is unchanged, and no follow-up fix was needed. It keeps whole-quad re-entry and main's plain CMPX restore to saved coverage.Tests, Windows 11 26200 with RTX 5080 and WARP. The filter was
native_pixel_|native_graphics_|native_direct_containerplus this PR's own tests. There were 0 failures and 0 skips, with 15 WARP and 12 RTX 5080 tests per configuration. A full Debug build of every target, including the C++17native_compute_pack_refusal_check, succeeded.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T01:37:54Z.
Merged
main(f3ab02fe, which includes #3847's live-mask lowering) into this branch. The reviewed commit is unchanged.native_pixel_|native_graphics_|native_direct_containerpassed 47/47 in Debug and 47/47 in Release, with 0 failures and 0 skips (18 WARP and 15 RTX 5080 tests per configuration). The PR preset passed 1/1. A full Debug build of every target, including the C++17native_compute_pack_refusal_check, succeeded.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T04:14:13Z.
Merged
main(41a83a9a) into this branch. The conflict with main's varying-VCCZ save/restore handling keeps both sides.native_pixel_|native_graphics_|native_direct_containerpassed 53/53 in Debug and 53/53 in Release, with 0 skips (20 WARP and 17 RTX 5080 tests per configuration). The PR preset passed 1/1. A full Debug build of every target, including the C++17native_compute_pack_refusal_check, succeeded. Marked Ready for review, keeping within 5 non-draft PRs per #3514.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T04:50:26Z.
Review: COMMENTED
I trial-merged
34228064ontomain9dfe168a. There are three source hunks and one docs hunk. A local resolution kept both docs entries, main'sflattened_op/expire_armshelpers before the WQM-only matcher, and main's compare-mask invalidation before thewqm_arm_movesearly return. Formove_exec, it accepts a WQM anchor or the full current-main save condition. WQM anchors still refuseexact_after_wqmor a nonemptygraphics_predicate, and the normal-main path still requires an emptygraphics_predicate. This keeps the WQM join and #3840/#3834's mask behavior in the same tree.That trial tree
5b794cef790b1a4828210b47bfd6a113acbc6ca9built and passedctest --preset dev --no-tests=error -j 1 --output-on-failure -R '^native_pixel_(w5_wqm_reentry|masked_region_alu|exec_writelane_vcc|varying_vcc_branch|loop_readfirstlane)_(controls|warp|hardware)$'(15/15, no skips). Windows build 26300, WARP 10.0.26100.9818, RTX 4060 Laptop 32.0.16.1656, D3D12 debug layer enabled for readbacks. Please update the branch with both sides of those hunks. No branch changes were pushed from the trial.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T06:16:32Z.
Merged
main(8a2f84d1) into this branch after #3834 and #3840 landed. The resolution keeps this PR's whole-quad re-entry alongside main's compare-mask cleanup and EXEC-save guards. The diff againstmaincontains only this PR's five files.native_pixel_|native_graphics_|native_direct_containerpassed 62/62 in Debug and 62/62 in Release, with 0 skips (23 WARP and 20 RTX 5080 tests per configuration). The PR preset passed, and a full Debug build including the C++17native_compute_pack_refusal_checksucceeded.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T06:33:21Z.
I checked
b01743b6againstmainafter #3849 landed (09ff8edec). Git reports conflicts insrc/gfx1013_direct_graphics.inlanddocs/experiments.md. Please keep both the structured CMPX edge proof from #3849 and this PR’s whole-quad re-entry when you update the branch. I’ll rerun the whole-quad readback and the structured-branch regression together on the resolved head.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T07:31:26Z.
Thanks @R0Y00. Merged
main(66d97a71) into this branch (01718bd5) after #3849 landed. The resolution keeps #3849's structured CMPX edge proof and mask invalidation alongside this PR's whole-quad re-entry. The diff againstmaincontains only this PR's five files.native_pixel_|native_graphics_|native_direct_containerpassed 65/65 in Debug and 65/65 in Release, with 0 skips. That includes thenative_pixel_branch_masked_region_*and W5 whole-quad readbacks on WARP and the RTX 5080. Both PR-preset controls passed, and a full Debug build including the C++17native_compute_pack_refusal_checksucceeded.Imported from R0Y00/Xbox2Windows. Originally posted by timbot103 on 2026-12-03T07:44:27Z.
Updated again after #3850 landed.
58e1bbf4mergesmainf9b112b9, keeping #3850's read-only CMPX if/else handling and #3849's structured CMPX edge proof alongside this PR's whole-quad re-entry. The diff againstmainis still only this PR's five files. The pixel filter passed 68/68 in Debug and 68/68 in Release, with 0 skips, including the w7_cmpx_ifelse, branch_masked_region and W5 readbacks on WARP and the RTX 5080. All three PR-preset controls passed.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T07:56:42Z.
Review: APPROVED
Independently reviewed
58e1bbf4against mainf9b112b9. The WQM join remains separate from the structured CMPX readers and masks; the split restore rejects bypass edges, and pre-WQM arms preserve helper VGPRs and drop stale mask state at reconvergence. MSVC Debug, Windows 11 build 26300: W5 WQM re-entry, W7 CMPX if/else, masked branches and varying VCC controls and GPU tests passed 12/12, no skips. W5 matched eight exact 8x2 draws and rejected eight wrong references per backend on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, debug layer enabled. Source-built fixtures only.