Repository navigation
rdna2spirv: fix wave64 s_cmp_eq_u64 / s_cmp_lg_u64 on split half-mask SGPR pairs - #3305
SweatierKey wants to merge 1 commit into
Conversation
|
GPU check of 55da541 on an RX 9060 XT (RDNA4, GFX1200), RADV Mesa 27.0.0-devel, Nobara Linux (Fedora 44): pass The description says the change is CPU-checked only, so I wrote a small wave64 compute probe and ran it through
Each
The PR's words are the same natively (subgroup 64, Also run:
AI-assisted (Claude Code). |
|
Tested I took the PR's own
All values are uniform across the 64 lanes. Also: One side note: a simpler version that built the pair with |
|
Tested 55da541 on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073: pass.
AI-assisted (OpenCode). |
|
Tested 55da541 on Windows 11, AMD Radeon iGPU gfx1036 (driver 26.10.1, subgroup 32..64) and RTX 5080 (driver 616.92, subgroup 32): translator checks plus the GPU suite against a
AI-assisted. |
|
Tested The fixed case on hardware. No GPU fixture in the PR covers a split pair, so I wrote a local one (not pushed) from your semantic test's case: one full wave64,
On Regressions: CPU: AI-assisted. |
|
The corpus side, which the hardware runs above don't cover: 55da541 against its base 1628210 with my own 1.0.2.1 translation (counts only). Windows 11 Pro 10.0.26300, SPIRV-Tools v2026.4.
AI-assisted (Claude Code); no game data in this comment. |
|
Tested 55da541 on AMD Radeon RX 7900 XTX (RDNA3, Navi 31; native wave32 and wave64), AMD driver 26.11.2, Vulkan 1.4.359, Windows 11: pass.
Tools: llvm-mc 21.1.8 (WSL), Vulkan SDK 1.4.363.0, MSVC 14.44. |
|
Closing: now covered on |
Fixes wave64
s_cmp_eq_u64ands_cmp_lg_u64when comparing a split lane-mask SGPR pairs[r:r+1](whose low/high halves were written independently, e.g.s_mov_b64 s[12:13], vcc; s_mov_b32 s12, 0) against0,exec,vcc, or another mask SGPR pair.Claimed on #3232 (#3232 (comment)).
Root cause
On
main(16282101),s_cmp_eq_u64/s_cmp_lg_u64'suse_votefast path bypassedmask_srcand loaded both raw dwords(s[r], s[r+1])in every lane, comparing both against(0, 0)or(exec, exec). When a wave64 pair's low and high dwords differ across halves, lanes 0..31 compared the stale high dword and lanes 32..63 compared the stale low dword, yieldingSCC = 0even when the 64-bit masks were equal.Fix
tools/rdna2spirv.py: on theuse_votepath ofs_cmp_eq_u64/s_cmp_lg_u64, read each mask operand viaself.mask_src(s)(which selectss[r]for lanes 0..31 ands[r+1]for lanes 32..63 in wave64) and compare each lane's single bit once beforewave_equal. Keeps the fastOpGroupNonUniformAllpath (noOpGroupNonUniformBitwiseOr) and leaves non-mask 64-bit pointer/data comparisons unchanged.tests/semantic/test_wave64_scmp_masks.py: addedWave64SplitPairU64CompareTestscovering split pairs vs0, vsexec, and split-pair vs split-pair, plusspirv-val --target-env vulkan1.2(native and--wave64-emulate).docs/design.md: updated theWave64 mask ballotrow.Verification (CPU, synthetic tests only, no game files)
tests/semantic/test_wave64_scmp_masks.py: 18/18 OK (incl.spirv-valnative &--wave64-emulate)test_loop_ballot_barrier(15/15),test_wave64_vcc_half_write(2/2),test_salu64_bitwise_data(11/11),test_text_write_line_endings(2/2),test_docs_design_rows(2/2),test_docs_repo_paths(2/2) — all PASStools/cf_diff.py --programs 50 --wave both --spirv-val: 100 pass, 0 mismatch, 0 skipped, 0 harness errorsAI-assisted.
Checklist
docs/design.mdwith verification status (CPU-checked, not yet GPU-verified).