compute: lower s_andn2_wrexec_b64 in the narrow wave64 model #3335
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3335"
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-28T10:39:22Z.
Part of #3224. Follows #3314.
s_andn2_wrexec_b64was refused withunsupported wave64 scalar operationin a guest wave64 request of at most 32 threads. That request runs on the wave32 model (src/gfx1013_compute_native.cpp, the wave64 comment intranslate_program), and the b64 path only acceptedwrexecwith the full wave64 model.translate_programrecords the narrow model (!stage && direct_dxil && !request.wave32 && !wave64).s_andn2_wrexec_b64is lowered there as in full wave64: D = S0 & ~EXEC and EXEC = D, on both words, with SCC = D != 0. EXEC_HI starts at zero.transfer(): #3314 already clears the EXEC symbols after every_wrexec_b64. The V_CMPX branch now also drops the s127 symbol in the narrow model.Tests (Windows 11, RTX 5080, SDK 10.0.26100 DXC, Release,
main3f780716plus #3314 and this commit; after the rebase on7e5c378dthe 27 targeted tests pass again):native_scalar_mask64_controlscompiless_andn2_wrexec_b64 s[28:29], s[28:29]in a 32-thread wave64 request in three variants: EXEC_HI left at zero, set by a scalar move, and set by a scalar move then reset byv_cmpx_eq_u32 0, v0before the WREXEC (EXEC_HI 0, 0x40000009 and 0 before the WREXEC). It checks the twoand/xorwords, the EXEC stores and SCC. An odd destination stays refused. The test also keeps threes_bcnt1_i32_b64refusals that pass onmaintoo.mainthe three positive programs are refused withunsupported wave64 scalar operation.native_scalar_mask64_hardwarereplays the three variants and compares the lane stores, the destination words and SCC.ctest -R "native_|startup_compute|compile_dxil|salu": 528 of 529.native_scalar_lds_hardwarefails as onmain.compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests: 250 to 252. The added programs weigh 4,998 dispatches in that run. None is lost. Two programs that already compiled change only by the addedstore i32 0to EXEC_HI after a V_CMPX.Not covered: in the narrow model a V_CMP into an SGPR pair writes only the low word, so a WREXEC whose source pair comes from a V_CMP reads a stale high word (the same gap exists for
s_and_b64onmain). In the two programs added above, the source pair comes froms_and_saveexec_b64ors_mov_b64 ..., exec. No source mutations were run.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T11:20:54Z.
Review: COMMENTED
Review of head
7c5ecc3b(the PR's own change is unchanged; the new head only merges currentmain). The base #3314 is merged.What I checked:
src/gfx1013_compute_native.cpp: a newnarrow_wave64flag (guest wave64 request that runs on the wave32 model) is threaded throughparseandtransfer; the V_CMPX-into-EXEC carry/compare destination is treated as a 64-bit pair only in that model. Wave64 and wave32 behaviour is unchanged.src/gfx1013_direct_compute.inl:s_andn2_wrexec_b64is accepted in the narrow model (s_andn1_wrexec_b64stays wave64-only), and a V_CMPX into EXEC zeroes EXEC_HI in that model. The destination and source alignment limits are kept.native_scalar_mask64_controls(DXIL and refusals) andnative_scalar_mask64_hardware(real D3D12 readback on WARP, which ran and did not skip) check lanes, EXEC words and the stored pair against a CPU reference.Commands run:
git diff --check origin/main...HEADclean,python3 -m py_compile tests/native_scalar_mask64_check.pyok.-R '^native_(scalar_mask64_(controls|hardware)|exec_symbol_b64_controls|wave64_exec_salu_hardware|salu64_(controls|hardware))$': dev 6/6 passed, release 6/6 passed.native_scalar_mask64_controlsandnative_scalar_mask64_hardwarefail (thecmpxcase).unsupported wave64 scalar operation.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:20:55Z.
Win2025 WARP receipt for head
7c5ecc3bafter updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
7c5ecc3bc3694235066607f284032d31b5d31fbd:--preset dev):cmake --build --preset dev --target compile_dxil native_store_replay -- -j 6):6.87s(configure0.00s)ctest --preset dev -R '^native_(scalar_mask64_(controls|hardware)|exec_symbol_b64_controls|wave64_exec_salu_hardware|salu64_(controls|hardware))$' --parallel 6 --no-tests=error --output-on-failure): 6/6 passed (1.70s:native_salu64_controls0.22s,native_exec_symbol_b64_controls0.26s,native_scalar_mask64_hardware0.39s,native_scalar_mask64_controls0.55s,native_wave64_exec_salu_hardware1.11s,native_salu64_hardware1.34s)/O2(--preset release):cmake --build --preset release --target compile_dxil native_store_replay -- -j 6):33.98s(configure0.00s)ctest --preset release -R '^native_(scalar_mask64_(controls|hardware)|exec_symbol_b64_controls|wave64_exec_salu_hardware|salu64_(controls|hardware))$' --parallel 6 --no-tests=error --output-on-failure): 6/6 passed (1.37s:native_salu64_controls0.16s,native_exec_symbol_b64_controls0.20s,native_scalar_mask64_hardware0.30s,native_scalar_mask64_controls0.40s,native_wave64_exec_salu_hardware0.88s,native_salu64_hardware1.00s)sccache: 0/4 hits; wall39.6sAI-assisted; commands listed were executed locally.