shader: accept the s_mov_b64 close of an s_and_saveexec_b64 masked region #1321
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1328"
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 MasterDomino on 2026-11-24T08:12:27Z.
Refs #1315 (Stage A only; the else transition stays for a later review)
An
s_and_saveexec_b64masked region may now close withs_mov_b64 exec, s[a:b], the copy of its exact saved pair. Until now that close was only accepted after av_cmpxopener (#957). Precompiled pixel programs close every such region this way: in the local input measured on #1315, none of 77,129 simple regions closes withs_or_b64.Behaviour (
tools/pixel_aot.py)s_mov_b64 exec, s[a:b]for both openers.close_regionstill requires the exact saved pair. Inside the region EXEC is a subset of the saved entry mask, so the copy restores the same mask ass_or_b64 exec, exec, s[a:b]and emits the same per-lane selects.s_cbranch_execzdirectly after the opener must land on the close of the same pair, which may now be either form.s_mov_b64does not write SCC. Buts_and_saveexec_b64has already written SCC from the new EXEC, which the profile does not track. So SCC is not observable after either close, and a reader still rejects. In thev_cmpxprofile SCC is tracked through the region, andcmpx_observables(#957) already draws it surviving the MOV close.s_andn2_b64 exec, s[a:b], execelse transition and nesting still reject.Tests (
tests/pixel_aot_check.py)masked_region,masked_skip,masked_skip_asmandmasked_complementarynow take the close as a parameter (MASKED_OR_RESTORE/MASKED_MOV_RESTORE).draw-exec-regionsdraws all three with each close.check_masked_mov_close_controls:Unexpected execution mask restoreUnsupported execution maskUnsupported execution maskExecution skip does not target the matching restores_andn2_b64 exec, s[60:61], execbefore the closeInstruction cannot run in a masked regions_mov_b32 exec_lo, s60before the closeInstruction cannot run in a masked regionConditional move requires a tracked SCC. An SCC written after the close is tracked again.check_cmpx_controlsasserted thats_mov_b64 exec, s[60:61]cannot close ans_and_saveexec_b64region. That is the rule this PR changes. It now asserts that the MOV close lowers identically to the OR close, and that a copy of a different pair still rejects withUnexpected execution mask restore.Results
Environment: Windows 11 26H2 (build 26300.9974),
devpreset, DXC 1.8.2502.11. Python 3.13.1. LLVM 15.0.7 (LLVM-C.dll,llvm-mc,llvm-objcopy).tests/rdna2_tools_check.py(with LLVM, 1 existing skip),form_coverage_check,shader_census_check,shader_corpus_report_check,pso_readiness_check,docs_links_checkandbidi_controls_checkalso pass.Negative control: with
tools/pixel_aot.pyrestored to main,check_masked_mov_close_controlsand the updatedcheck_cmpx_controlsfail on the MOV close, withInstruction cannot run in a masked region: s_mov_b64 exec, s[60:61]. The MOV-closed skip program is refused withExecution skip does not target the matching restore.Not measured
#1314 shows that the shader scan's translator verdict stops at unbound entry registers. So the number of local records that now pass this region close is not measured. The structural counts on #1315 are shape counts only (22,511 wave64 if-only regions in 4,523 records). These draws pin the translator's model on desktop adapters; they are not evidence for gfx1013 hardware.
docs/experiments.md: the region paragraph now names both closes and records these results.AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:16:13Z.
Review: COMMENTED
Reviewed at commit
8ce2a03778010e425583eb918a21bde5d36fffbf.Code Review
tools/pixel_aot.py: cleanly extends the region gate,s_mov_b64 exec, s[a:b]close handler, ands_cbranch_execzskip target validation tos_and_saveexec_b64regions while preservingclose_regionexact-pair matching,sccuntrackedness afters_and_saveexec_b64, and rejection ofs_andn2_b64/ wave32s_mov_b32.tests/pixel_aot_check.py: parameterizesmasked_region,masked_skip,masked_skip_asm, andmasked_complementaryoverMASKED_OR_RESTORE/MASKED_MOV_RESTORE, addscheck_masked_mov_close_controls(covering equivalence, wrong-pair / no-open-region / second-close / skip-target / else-transition / wave32 / SCC negative controls), updatescheck_cmpx_controls, and adds both closes tocheck_masked_drawandcheck_binary.Verification
Linux (LLVM 19):
git diff --check origin/main...HEAD: cleanpython -B tests/docs_links_check.py: passed (16 Markdown files, 291 links)python -B tests/bidi_controls_check.py: passed (1099 files)LLVM_LIB=/usr/lib/llvm-19/lib/libLLVM-19.so python -B tests/pixel_aot_check.py: passedtests/pixel_aot_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.sostopped earlier incheck_f16_cvt_int16_binaryon an unrelated LLVM 19 literal encoding difference (v_cvt_f16_i16_e32 v1, 0xfff0->ffa2027ef0ff0000).Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
python -B tests/pixel_aot_check.py: passed (12.89s)--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6(4.43s) +ctest --preset dev -R '^pixel_aot_(exec|cmpx|region)_.*_warp$' --parallel 4 --no-tests=error --output-on-failure: 6/6 passed (3.46s)/O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6(2.29s) +ctest --preset release -R '^pixel_aot_(exec|cmpx|region)_.*_warp$' --parallel 4 --no-tests=error --output-on-failure: 6/6 passed (3.99s)