Repository navigation
compute: lower s_andn2_wrexec_b64 in the narrow wave64 model - #3335
Merged
Merged
Conversation
A guest wave64 request of at most 32 threads runs on the wave32 model, where EXEC_HI starts at zero. s_andn2_wrexec_b64 is now lowered there as in full wave64: D = S0 & ~EXEC and EXEC = D on both words. A V_CMPX that writes EXEC also writes 0 to EXEC_HI in that model, since the guest has no upper lanes.
Leyukaka
force-pushed
the
compute-wave64-wrexec-same-reg
branch
from
November 28, 2026 11:06
8c2aaf8 to
d62f93a
Compare
tedin7
reviewed
Nov 28, 2026
tedin7
left a comment
Collaborator
There was a problem hiding this comment.
Review of head 7c5ecc3b (the PR's own change is unchanged; the new head only merges current main). 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.- Tests
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. - No other open PR covers this slice.
Commands run:
- Linux:
git diff --check origin/main...HEADclean,python3 -m py_compile tests/native_scalar_mask64_check.pyok. - Windows Server 2025, D3D12 WARP 1.0.22,
-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. - Mutation 1 (the EXEC_HI zeroing after V_CMPX removed):
native_scalar_mask64_controlsandnative_scalar_mask64_hardwarefail (thecmpxcase). - Mutation 2 (wrexec no longer accepted in the narrow model): both fail with
unsupported wave64 scalar operation.
No blocking findings. The receipt follows in a separate comment.
AI-assisted; commands listed were executed locally.
Collaborator
|
Win2025 WARP receipt for head 7c5ecc3 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(): compute: forget EXEC symbols after 64-bit saveexec and wrexec #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.