diff options
| author | hugo <63666848+hugo0024@users.noreply.github.com> | 2026-11-24 23:39:03 +0800 |
|---|---|---|
| committer | Man Alin <whoalin414@gmail.com> | 2026-11-30 22:22:44 +0000 |
| commit | 28944c192131c4053a64fa0141625b52da62d7cd (patch) | |
| tree | 3848c4017aa4e052db040d237be9a136382e7e64 /runtime/test/queue_proxy_test.cpp | |
| parent | b3cc3770200c8701c01b492edae3f20793924287 (diff) | |
rdna2spirv: the wave mask gather is stored before it is read, so every lane runs it (SHADER-WAVEMASK-EAGER)
A register holds this lane's bit of a lane mask; v_mbcnt, s_bcnt1 and
s_ff1 gather the other lanes' bits with a subgroup operation
(Gen.wave_mask). v_mbcnt writes a VGPR, so its result is selected on the
lane's EXEC, and MoltenVK's SPIRV-Cross inlined the single-use gather
into the taken arm of that ternary:
v6 = active ? popcount(simd_or(mine ? bit : 0) & below) + acc : v6;
A lane that is off never ran the gather, so its bit was missing from
every other lane's count. Gen.wave_mask now stores the gather to a
variable of its own with Gen.eager, as SHADER-529 did for DPP's ballot
and shuffle.
On an Apple M5 (MoltenVK 1.4.2), tools/crosslane_fuzz.py with wave 32,
native and no maskdata goes from 92 of 100 programs matching to 100 of
100, and from 193 to 200 of 200 with DPP at seed 7.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: SWE-2.1 Max <noreply@google.com>
Diffstat (limited to 'runtime/test/queue_proxy_test.cpp')
0 files changed, 0 insertions, 0 deletions