Skip to content

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

Draft
timbot103 wants to merge 1 commit into
R0Y00:mainfrom
timbot103:shader/pixel-acyclic-exec-masks
Draft

timbot103 wants to merge 1 commit into
R0Y00:mainfrom
timbot103:shader/pixel-acyclic-exec-masks

Conversation

@timbot103

Copy link
Copy Markdown
Contributor

Part of #3814.

Change

E1 tracks the first refusal undefined graphics register 126. The census
reported 175 remaining stages after #3834 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 #3918 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 #3918 (L2); whichever lands second will be reconciled.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant