shader: lower EXEC mask snapshots in acyclic pixel shaders (Part of #3814) #3928

Manually merged
github merged 4 commits from github-bot/gh-3926 into gh-pr/3926/base 2026-12-03 13:03:52 +00:00 AGit
Owner

@⁠timbot103 on GitHub · 2026-12-03 10:53 UTC · original
timbot103:shader/pixel-acyclic-exec-masks → main · +340 −15 · 6 files · 4 commits · merged 2026-12-03 13:01 UTC

Part of #3816.

Change

E1 tracks the first refusal undefined graphics register 126. The census
reported 175 remaining stages after #3836 advanced 49. It identified
s_cselect_b64 s[lo:hi], exec, 0 and s_mov_b64 s[lo:hi], exec outside
loops. This branch is based directly on origin/main and uses the existing
acyclic mask and EXEC region proofs.
An integration check against #3920 found adjacent edits in
src/gfx1013_direct_graphics.inl and docs/experiments.md to reconcile
when the branches meet.

In a wave64 pixel shader, accept an EXEC copy at a proven exact-coverage
tail or outside matched read-only mask regions. Accept the EXEC-or-zero
select with a reaching scalar comparison and wave-uniform SCC. The
invocation bit can feed CNDMASK, a proven AND, or a one-armed AND_SAVEEXEC
ending in a matching s_mov_b64 exec, saved restore. A reaching
unmodified copy of the current base EXEC also supports a same-mode
restore.

Numeric EXEC and mask-word reads, unsupported select operands, unknown
SCC, clobbered pairs, missing definitions at joins, and unproved EXEC
changes still refuse.

Verification

Commit 5aa86473 on d2e6a4ed. Windows 11 Pro build
10.0.26200.9974, MSVC 19.44.35230, and DXC 1.9.2602.17
(21d28f727). WARP reported driver 10.0.26100.9818, the GeForce RTX
5080 reported 32.0.16.2140 (621.40), and the D3D12 debug layer was
unavailable.

The base compiler already accepted plain EXEC copies at entry and after an
SCC join. The fixture reproduced six undefined graphics register 126
refusals on the base compiler. The three SAVEEXEC cases refused during CFG
construction with graphics branch on a wave mask. The patch compiles all
nine cases and checks thirteen near-miss refusals. WARP and the RTX 5080
matched all 16 pixels in each of the nine draws in Debug and Release.
Every wrong reference produced the expected mismatch. All nine also compiled
through compile_dxil $DXC_BIN_DIR cache gfx1013-mesh86-ps fixture.ps86 fixture.cso
with a synthetic rootsig_1_1 sidecar declaring direct CBV/SRV/UAV and
sampler heap indexing. The effect on the private census is unmeasured.

cmake --build out/build/dev -- -j 6
cmake --build out/build/release --target compile_dxil offscreen_check native_pixel_ir_dump native_recording_check native_compute_ir_dump native_sampled_pixel_gpu startup_stream_consumer -- -j 6
ctest --preset pr --no-tests=error -V -R '^native_pixel_acyclic_exec_masks_controls$'
ctest --preset dev --no-tests=error -R '^native_compute_pack_refusals$'
ctest --preset dev --no-tests=error -j 1 -V -R '^native_pixel_acyclic_exec_masks_(warp|hardware)$'
ctest --preset dev --no-tests=error -j 1 -V -R 'native_pixel_|native_graphics_|native_direct_container'
ctest --preset release --no-tests=error -j 1 -V -R 'native_pixel_|native_graphics_|native_direct_container'
.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py
.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py
git diff --check origin/main...HEAD
Check Passed Failed Skipped
Debug pixel and graphics selection 71 0 0
Release pixel and graphics selection 71 0 0
PR preset controls 1 0 0
C++17 frontend refusal test 1 0 0
Focused Debug WARP and RTX 5080 readbacks 2 0 0
Base diagnostic controls 9 0 0
Bidirectional controls, docs links, and Git whitespace 3 0 0

The full Debug build and the selected Release target build completed.

To reproduce the base diagnostics, set $BASE_COMPILER to an executable
built from d2e6a4ed and $DXC_BIN_DIR to the SDK compiler directory.
The baseline mode expects all nine refusals and exits successfully if
each diagnostic matches.

Push-Location out
.\pe-env\Scripts\python.exe -B ..\tests\native_pixel_acyclic_exec_masks_check.py $BASE_COMPILER - $DXC_BIN_DIR baseline
Pop-Location

This touches the same graphics translator area as #3920 (L2); whichever lands second will be reconciled.

🤖 Generated with Claude Code

**@⁠timbot103** on GitHub · 2026-12-03 10:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3926) `timbot103:shader/pixel-acyclic-exec-masks` → `main` · +340 −15 · 6 files · 4 commits · merged 2026-12-03 13:01 UTC Part of #3816. ## Change E1 tracks the first refusal `undefined graphics register 126`. The census reported 175 remaining stages after #3836 advanced 49. It identified `s_cselect_b64 s[lo:hi], exec, 0` and `s_mov_b64 s[lo:hi], exec` outside loops. This branch is based directly on `origin/main` and uses the existing acyclic mask and EXEC region proofs. An integration check against #3920 found adjacent edits in `src/gfx1013_direct_graphics.inl` and `docs/experiments.md` to reconcile when the branches meet. In a wave64 pixel shader, accept an EXEC copy at a proven exact-coverage tail or outside matched read-only mask regions. Accept the EXEC-or-zero select with a reaching scalar comparison and wave-uniform SCC. The invocation bit can feed CNDMASK, a proven AND, or a one-armed AND_SAVEEXEC ending in a matching `s_mov_b64 exec, saved` restore. A reaching unmodified copy of the current base EXEC also supports a same-mode restore. Numeric EXEC and mask-word reads, unsupported select operands, unknown SCC, clobbered pairs, missing definitions at joins, and unproved EXEC changes still refuse. ## Verification Commit `5aa86473` on `d2e6a4ed`. Windows 11 Pro build `10.0.26200.9974`, MSVC `19.44.35230`, and DXC `1.9.2602.17` (`21d28f727`). WARP reported driver `10.0.26100.9818`, the GeForce RTX 5080 reported `32.0.16.2140` (`621.40`), and the D3D12 debug layer was unavailable. The base compiler already accepted plain EXEC copies at entry and after an SCC join. The fixture reproduced six `undefined graphics register 126` refusals on the base compiler. The three SAVEEXEC cases refused during CFG construction with `graphics branch on a wave mask`. The patch compiles all nine cases and checks thirteen near-miss refusals. WARP and the RTX 5080 matched all 16 pixels in each of the nine draws in Debug and Release. Every wrong reference produced the expected mismatch. All nine also compiled through `compile_dxil $DXC_BIN_DIR cache gfx1013-mesh86-ps fixture.ps86 fixture.cso` with a synthetic `rootsig_1_1` sidecar declaring direct CBV/SRV/UAV and sampler heap indexing. The effect on the private census is unmeasured. ```powershell cmake --build out/build/dev -- -j 6 cmake --build out/build/release --target compile_dxil offscreen_check native_pixel_ir_dump native_recording_check native_compute_ir_dump native_sampled_pixel_gpu startup_stream_consumer -- -j 6 ctest --preset pr --no-tests=error -V -R '^native_pixel_acyclic_exec_masks_controls$' ctest --preset dev --no-tests=error -R '^native_compute_pack_refusals$' ctest --preset dev --no-tests=error -j 1 -V -R '^native_pixel_acyclic_exec_masks_(warp|hardware)$' ctest --preset dev --no-tests=error -j 1 -V -R 'native_pixel_|native_graphics_|native_direct_container' ctest --preset release --no-tests=error -j 1 -V -R 'native_pixel_|native_graphics_|native_direct_container' .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py git diff --check origin/main...HEAD ``` | Check | Passed | Failed | Skipped | | --- | ---: | ---: | ---: | | Debug pixel and graphics selection | 71 | 0 | 0 | | Release pixel and graphics selection | 71 | 0 | 0 | | PR preset controls | 1 | 0 | 0 | | C++17 frontend refusal test | 1 | 0 | 0 | | Focused Debug WARP and RTX 5080 readbacks | 2 | 0 | 0 | | Base diagnostic controls | 9 | 0 | 0 | | Bidirectional controls, docs links, and Git whitespace | 3 | 0 | 0 | The full Debug build and the selected Release target build completed. To reproduce the base diagnostics, set `$BASE_COMPILER` to an executable built from `d2e6a4ed` and `$DXC_BIN_DIR` to the SDK compiler directory. The baseline mode expects all nine refusals and exits successfully if each diagnostic matches. ```powershell Push-Location out .\pe-env\Scripts\python.exe -B ..\tests\native_pixel_acyclic_exec_masks_check.py $BASE_COMPILER - $DXC_BIN_DIR baseline Pop-Location ``` This touches the same graphics translator area as #3920 (L2); whichever lands second will be reconciled. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 10:55:21 +00:00
Author
Owner

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

7b380775 makes the numeric-select refusal control pass both alone and together with #3920 (L2). With #3920, the selected EXEC pair is tracked symbolically, so the numeric read is refused earlier, with unbound numeric SGPR s20. The control accepts either message and still requires a nonzero exit and no DXIL. Results: this PR alone passed 71/71 in Debug and Release. Merged with #3920, it passed 74/74 in Debug. The PR-preset control passed on both trees. A combined build of all the open wave branches (#3919–#3926) also passed. The only textual overlap with #3920 is in the docs index and the state declarations.

**@⁠timbot103** on GitHub · 2026-12-03 12:20 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3926#issuecomment-7378043156) `7b380775` makes the `numeric-select` refusal control pass both alone and together with #3920 (L2). With #3920, the selected EXEC pair is tracked symbolically, so the numeric read is refused earlier, with `unbound numeric SGPR s20`. The control accepts either message and still requires a nonzero exit and no DXIL. Results: this PR alone passed 71/71 in Debug and Release. Merged with #3920, it passed 74/74 in Debug. The PR-preset control passed on both trees. A combined build of all the open wave branches (#3919–#3926) also passed. The only textual overlap with #3920 is in the docs index and the state declarations.
Author
Owner

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

Merged main after #3920 (L2) landed. The resolution keeps both the L2 loop lowering and this PR's acyclic EXEC-mask lowering. It also fixes the review nit on #3920: the L2 doc now links to the census table (comment 7368270349) instead of the claim. The pixel suite passed 74/74 in Debug and Release. The full PR preset had 334 passes, 0 failures and 8 capability skips, and the full Debug build succeeded. Marked Ready for review, keeping within 5 non-draft PRs per #3516.

**@⁠timbot103** on GitHub · 2026-12-03 12:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3926#issuecomment-7378814743) Merged `main` after #3920 (L2) landed. The resolution keeps both the L2 loop lowering and this PR's acyclic EXEC-mask lowering. It also fixes the review nit on #3920: the L2 doc now links to the census table (comment 7368270349) instead of the claim. The pixel suite passed 74/74 in Debug and Release. The full PR preset had 334 passes, 0 failures and 8 capability skips, and the full Debug build succeeded. Marked Ready for review, keeping within 5 non-draft PRs per #3516.
github-bot changed target branch from main to gh-pr/3926/base 2026-12-03 13:03:49 +00:00
github manually merged commit ec615aae8c into gh-pr/3926/base 2026-12-03 13:03:52 +00:00
Author
Owner

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

Independently reviewed ec615aae. Checked reaching SCC, exclusion of unproven regions, and invalidation of saved and selected EXEC tags on scalar overwrite. Windows MSVC Debug, Windows 11 build 26300, D3D12 debug layer enabled. ctest --preset dev --no-tests=error -j 1 -V -R '^native_pixel_acyclic_exec_masks_(controls|warp|hardware)$' passed 3/3. WARP 10.0.26100.9818 and RTX 4060 Laptop (32.0.16.1656) matched 16 pixels per draw and rejected the wrong reference. Disabling the new EXEC snapshot lowering made the scc-true control fail at +0x14 with undefined graphics register 126. The restored binary passed.

**@⁠R0Y00** on GitHub · 2026-12-03 13:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3926#pullrequestreview-6170301374) · **approved these changes** Independently reviewed ec615aae. Checked reaching SCC, exclusion of unproven regions, and invalidation of saved and selected EXEC tags on scalar overwrite. Windows MSVC Debug, Windows 11 build 26300, D3D12 debug layer enabled. `ctest --preset dev --no-tests=error -j 1 -V -R '^native_pixel_acyclic_exec_masks_(controls|warp|hardware)$'` passed 3/3. WARP 10.0.26100.9818 and RTX 4060 Laptop (32.0.16.1656) matched 16 pixels per draw and rejected the wrong reference. Disabling the new EXEC snapshot lowering made the scc-true control fail at +0x14 with undefined graphics register 126. The restored binary passed.
github-bot referenced this pull request from a commit 2026-12-03 15:01:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.