shader: join wave64 lane masks with data by each lane's bit #120

Manually merged
github merged 1 commit from github-bot/gh-120 into main 2026-11-26 18:09:26 +00:00 AGit
Owner

@⁠Olima34 on GitHub · 2026-11-26 17:30 UTC · original
Olima34:fix/shader-wave64-mask-data-join → main · +117 −5 · 4 files · 1 commits · merged 2026-11-26 18:09 UTC

One of the #4 shapes, "a lane-mask join of an untracked mask" (14 refusals in your latest run). This is a lowering for wave64 programs. What it still refuses now names its cause.

Why. At a uniform join with console lanes, a lane mask joined with data (Val::I32) became each lane's bit of the number, as Atom::Opaque already does. That only worked in wave32 programs (number required !wave64), so wave64 ones were refused.

What.

  • RDNA2 rule: bit i of a 64-bit mask (EXEC/VCC pair) is lane i.
  • A wave64 lane now takes its bit of the pair. Below lane 32 it reads the low dword; from lane 32 it reads the high dword.
  • The high dword is the high register's join on the same edge: pair_high gives the phi of the next SGPR in the same block, so the edge index matches.
  • This still applies only at a uniform join and with console lanes, as before. If the high dword is not known, the join is refused.
  • What stays refused now names its cause after the old text: data on the host's lanes, data at a join of several edges, data whose high dword is not known, a value the translation could not make, an SCC or lane bit, or no value on that edge.

Tests.

  • mask_tests::a_wave64_mask_joined_with_data_at_a_uniform_loop_is_its_number (a wave64 uniform loop, lowered with wave32_host false and true). On main it fails with exactly "a lane-mask join of an untracked mask" at 0x20.
  • addr_tests::a_wave64_mask_joined_with_data_takes_each_lanes_bit_on_the_gpu (victory-gpu, runs on Metal with the host's options: one console wave as two host waves). The mask starts as lanes below 40, then each back edge shifts it right by 4 and passes it through VGPRs as data. Every lane stores its bit of the last pass's number, and the test checks all 64 lanes: 1 below lane 36, 0 above. Lanes 32 to 35 take their bit from the high dword. It fails on main (the shader is refused).

The #110 Series S log has this refusal in three compute programs (2e4e36ee0ffdebee @⁠0xcf8, 7a06a5d322dce725 @⁠0x2270, c5f6d57e0092dc99 @⁠0x8b0). Whether they take the wave64 form is not known; if not, the new messages will say which form they do take.

victory-shader (242) and victory-gpu (arm64) tests, Windows clippy and cargo xtask policy pass.

**@⁠Olima34** on GitHub · 2026-11-26 17:30 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/120) `Olima34:fix/shader-wave64-mask-data-join` → `main` · +117 −5 · 4 files · 1 commits · merged 2026-11-26 18:09 UTC One of the #4 shapes, "a lane-mask join of an untracked mask" (14 refusals in your latest run). This is a lowering for wave64 programs. What it still refuses now names its cause. **Why.** At a uniform join with console lanes, a lane mask joined with data (`Val::I32`) became each lane's bit of the number, as `Atom::Opaque` already does. That only worked in wave32 programs (`number` required `!wave64`), so wave64 ones were refused. **What.** - RDNA2 rule: bit i of a 64-bit mask (EXEC/VCC pair) is lane i. - A wave64 lane now takes its bit of the pair. Below lane 32 it reads the low dword; from lane 32 it reads the high dword. - The high dword is the high register's join on the same edge: `pair_high` gives the phi of the next SGPR in the same block, so the edge index matches. - This still applies only at a uniform join and with console lanes, as before. If the high dword is not known, the join is refused. - What stays refused now names its cause after the old text: data on the host's lanes, data at a join of several edges, data whose high dword is not known, a value the translation could not make, an SCC or lane bit, or no value on that edge. **Tests.** - `mask_tests::a_wave64_mask_joined_with_data_at_a_uniform_loop_is_its_number` (a wave64 uniform loop, lowered with `wave32_host` false and true). On main it fails with exactly "a lane-mask join of an untracked mask" at 0x20. - `addr_tests::a_wave64_mask_joined_with_data_takes_each_lanes_bit_on_the_gpu` (victory-gpu, runs on Metal with the host's options: one console wave as two host waves). The mask starts as lanes below 40, then each back edge shifts it right by 4 and passes it through VGPRs as data. Every lane stores its bit of the last pass's number, and the test checks all 64 lanes: 1 below lane 36, 0 above. Lanes 32 to 35 take their bit from the high dword. It fails on main (the shader is refused). The #110 Series S log has this refusal in three compute programs (2e4e36ee0ffdebee @⁠0xcf8, 7a06a5d322dce725 @⁠0x2270, c5f6d57e0092dc99 @⁠0x8b0). Whether they take the wave64 form is not known; if not, the new messages will say which form they do take. victory-shader (242) and victory-gpu (arm64) tests, Windows clippy and `cargo xtask policy` pass.
A lane mask joined with data at a uniform join took each lane's bit of the number only in wave32 programs; wave64 ones were refused as "a lane-mask join of an untracked mask". Lane i of a 64-bit mask is its bit i, so a wave64 lane now reads the low dword below lane 32 and the high dword (the high register's join on the same edge) above. What stays refused now names its cause after the same text.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:32:18 +00:00
github-bot force-pushed github-bot/gh-120 from 31d26e5139 to 2cfc7be5e9 2026-11-26 17:37:39 +00:00 Compare
github-bot force-pushed github-bot/gh-120 from 2cfc7be5e9 to 81f038fcb3 2026-11-26 17:43:03 +00:00 Compare
github manually merged commit db875522aa into main 2026-11-26 18:09:26 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 18:09 UTC · original

Merged, thanks. Wave64 mask/data joins now take each lane's bit, and the GPU test passes.

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 18:09 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/120#issuecomment-7200127068) Merged, thanks. Wave64 mask/data joins now take each lane's bit, and the GPU test passes.
This discussion has been locked. Commenting is limited to contributors.
No description provided.