shader: lower SCC-selected EXEC in pixel loops (Part of #3814) #3918
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3918"
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-03T10:32:48Z.
Part of #3814. Refs #3641.
Change
Target L2,
unsupported wave64 scalar mask operationfors_cselect_b64 s[lo:hi], exec, 0in a loop. The census reported 322 pixelstages at this first refusal, including the 24 pixel partners of the first
Mesh86 scene draws. The public census identifies the select and its operands.
The test consumers are source-built and the effect on census counts remains
unmeasured.
Accept an ordinary even SGPR pair, a wave-uniform reaching SCC proven after
loop phi dependencies resolve, and EXEC at raster entry coverage or entry
WQM. Preserve the invocation's selected mask bit for CNDMASK, copies, and
EXEC intersections. Use the wave-wide nonempty result for SCC and VCC tests
and for a bounded AND_SAVEEXEC arm with an EXECZ or SCC0 skip and matching
restore.
Other select operands, wave32, odd destinations, numeric reads of the mask
words, clobbered halves, varying SCC, and unproven EXEC changes or restores
still refuse.
Verification
Commit
993c8279ond2e6a4ed. Windows 11 Pro build10.0.26200.9974,MSVC
19.44.35230, and DXC1.9.2602.17(21d28f727). Microsoft WARPreported driver
10.0.26100.9818and the NVIDIA GeForce RTX 5080 reported32.0.16.2140(621.40). The D3D12 debug layer was unavailable on bothbackends.
The compiler built from base
d2e6a4edrefused the first positive fixture atthe select (
+0x20) withunsupported wave64 scalar mask operation.The PR-preset controls accepted all three positive variants and verified
eight refusals. WARP and the RTX 5080 matched all 21 pixels in all three
draws in both Debug and Release. Every wrong reference produced the
expected mismatch.
The same source-built variants also compiled through
compile_dxil $DXC_BIN_DIR cache gfx1013-mesh86-ps fixture.ps86 fixture.csowith a synthetic
rootsig_1_1sidecar declaring direct CBV/SRV/UAV andsampler heap indexing.
The full Debug build and the selected Release target build completed.
To reproduce the base refusal, build
compile_dxilfromd2e6a4edintoout/l2-base-buildand set$DXC_BIN_DIRto the same SDK compiler directory.The following negative control expects exit code 1 at the first fixture.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-12-03T11:27:26Z.
Reviewed
993c8279b3cf. Verdict: no MUST or SHOULD, one NIT.Checked on Linux (clang-cl cross build, run under Wine): controls give 3 translated and 8 refused, exit 0. Four source mutations turned them red; a fifth (the SCC write on the OR restore) stayed green here because only the GPU draw covers it. Not run: WARP or hardware draws, Release-build controls, the Windows C++17 refusal test.
Not a finding on the code: the question on #3814 about planned follow-ups and real loop shapes had no reply at review time.
AI-assisted review.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T12:15:28Z.
Review: APPROVED
Approved
993c8279. The matcher confines the select to entry coverage or entry WQM, checks reaching SCC after resolving loop phis, and keeps the wave-wide nonempty bit separate from the lane bit. Independent MSVC Debug and SDK DXC on Windows build 26300: all three translation positives and eight refusal controls passed. Exact VCC, WQM/EXECZ and WQM/SCC0 each matched 21 pixels on both inbox WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656, with the D3D12 debug layer enabled, no debug errors or capability skips.