compute: forget EXEC symbols after 64-bit saveexec and wrexec #3314
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3314"
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 Leyukaka on 2026-11-28T08:38:00Z.
Part of #2935. Target branch
main. Follow-up to my review on #3297.Problem.
transfer()(src/gfx1013_compute_native.cpp) records a symbol for EXEC ins[126]/s[127], for example a constant afters_mov_b64 exec, <literal>. The wave32 saveexec/wrexec branch clearss[126]. The 64-bit*_saveexec_b64and*_wrexec_b64instead fell into the generic SOP1 branch, which clears only the destination pair, so the old EXEC constant survived them.s_mov_b32 sN, exec_lothen copied that constant into sN, and the constant-sampler path could fold a value the program no longer had. I have not seen this in a real shader; it is a soundness gap.*_saveexec_b64(two added by #3297),s_andn1_wrexec_b64(#3297) ands_andn2_wrexec_b64(my #3247).Change. Compute SOP1 ops whose name ends in
_saveexec_b64or_wrexec_b64now clear the destination pair and both EXEC words. Nothing else changes.Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on
mainc6f23813plus this commit.native_exec_symbol_b64_controlsbuilds a wave64 program that takes a sampler word fromexec_lo:s_and_saveexec_b64ors_andn2_wrexec_b64with an unknown source, it is refused with "nonconstant sampler".main'scompile_dxil, both the saveexec and the wrexec case compile, because the stale constant is folded. With this commit both are refused with "nonconstant sampler".native_direct_containertests pass, 11 of 11.ctest -R "native_|startup_compute|compile_dxil|salu"passes 526 of 527.native_scalar_lds_hardwarefails as onmain.The test reads only
exec_lo, so thes[127]clear is not covered, and I did not run a mutation that keeps one EXEC word. The results onmaincover removing the fix entirely.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T11:00:54Z.
Review: COMMENTED
Review of head
2814bec1(the PR's own change is unchanged from4c8513e0; the new head only merges currentmain).What I checked:
src/gfx1013_compute_native.cpp,transfer(): the new branch covers the 64-bit*_saveexec_b64and*_wrexec_b64SOP1 forms, clears the destination pair plus both EXEC words (126/127) and is limited to the non-graphics path. The wave32 branch above it is untouched. The name suffix tests are length-safe.native_exec_symbol_b64_controlsbuilds a wave64 container, copies EXEC into a sampler word afters_and_saveexec_b64/s_andn2_wrexec_b64, and requires the translator to refuse the now non-constant sampler (the constant-EXEC control still compiles). It guards the behavior the caller sees (compile result and message).Commands run:
python3 tests/docs_links_check.pyok,python3 tests/bidi_controls_check.pyok,git diff --check origin/main...HEADclean,python3 -m py_compile tests/native_exec_symbol_b64_check.pyok.-R '^native_(exec_symbol_b64_controls|direct_container|salu64_controls|compute_clear)$': dev 4/4 passed, release 4/4 passed.set(126, {})in the new branch):native_exec_symbol_b64_controlsfails at thesaveexeccase.native_exec_symbol_b64_controlsfails at thewrexeccase.No blocking findings. The receipt follows in a separate comment.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T11:00:56Z.
Win2025 WARP receipt for head
2814bec1after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
2814bec1b312728c2be3d1bbbe8b0cc57416e4c9:--preset dev):cmake --build --preset dev --target compile_dxil native_store_replay -- -j 3):8.07s(configure2.38s)ctest --preset dev -R '^native_(exec_symbol_b64_controls|direct_container|salu64_controls|compute_clear)$' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (17.28s:native_salu64_controls0.22s,native_exec_symbol_b64_controls0.28s,native_compute_clear0.33s,native_direct_container16.74s)/O2(--preset release):cmake --build --preset release --target compile_dxil native_store_replay -- -j 3):46.35s(configure6.48s)ctest --preset release -R '^native_(exec_symbol_b64_controls|direct_container|salu64_controls|compute_clear)$' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (12.48s:native_salu64_controls0.21s,native_exec_symbol_b64_controls0.25s,native_compute_clear0.30s,native_direct_container11.98s)sccache: 192/251 hits; wall74.4sAI-assisted; commands listed were executed locally.