Shaders: keep literal select mask bits when lowering local half-waves #277

Open
github-bot wants to merge 1 commit from github-bot/gh-277 into main AGit
Owner

@⁠fluffyflattershy-afk on GitHub · 2026-11-24 23:09 UTC · original
fluffyflattershy-afk:pr/literal-mask-half-wave → main · +57 −5 · 2 files · 1 commits · open

Change

A v_cndmask_b32 using a literal 64-bit scalar mask was refused in local half-wave lowering. When console lanes are already mapped, both host waves can use the literal and select the bit at their console lane index. This select requires no group exchange. Computed mask pairs still use the existing refusal.

Verification

  • A synthetic 64-thread compute shader selects 0 in lanes 0–31 and 1 in lanes 32–63. Before the change, lowering refused the select. With the patch, DXIL validation passed and all 64 outputs matched on a Windows 11 RTX 5070 Ti Laptop GPU.
  • All six emit::wave64_tests passed. cargo clippy --locked --offline -p victory-shader --all-targets -- -D warnings and cargo xtask policy passed.
  • This covers literal mask pairs. The tiled-shadow program discussed in #190 still fails to lower in the local check.

AI-assisted with Codex. The test uses only synthetic inputs.

**@⁠fluffyflattershy-afk** on GitHub · 2026-11-24 23:09 UTC · [original](https://github.com/fxceless/victory-fork/pull/277) `fluffyflattershy-afk:pr/literal-mask-half-wave` → `main` · +57 −5 · 2 files · 1 commits · open ## Change A `v_cndmask_b32` using a literal 64-bit scalar mask was refused in local half-wave lowering. When console lanes are already mapped, both host waves can use the literal and select the bit at their console lane index. This select requires no group exchange. Computed mask pairs still use the existing refusal. ## Verification - A synthetic 64-thread compute shader selects 0 in lanes 0–31 and 1 in lanes 32–63. Before the change, lowering refused the select. With the patch, DXIL validation passed and all 64 outputs matched on a Windows 11 RTX 5070 Ti Laptop GPU. - All six `emit::wave64_tests` passed. `cargo clippy --locked --offline -p victory-shader --all-targets -- -D warnings` and `cargo xtask policy` passed. - This covers literal mask pairs. The tiled-shadow program discussed in #190 still fails to lower in the local check. AI-assisted with Codex. The test uses only synthetic inputs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:43 +00:00
Author
Owner

@⁠HAL9000RELOADED on GitHub · 2026-11-25 19:29 UTC · original

RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main d510ee4: the new test local_waves_select_their_console_bits_from_a_constant_mask passes on the card with this PR, and fails with the test alone on the base. No other test changed. Run table: #129 (#129).

**@⁠HAL9000RELOADED** on GitHub · 2026-11-25 19:29 UTC · [original](https://github.com/fxceless/victory-fork/pull/277#issuecomment-7172376346) RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main `d510ee4`: the new test `local_waves_select_their_console_bits_from_a_constant_mask` passes on the card with this PR, and fails with the test alone on the base. No other test changed. Run table: #129 (https://git.gtahub.st/github/fxceless--victory-fork/pulls/129).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/277/head:github-bot/gh-277'
git switch 'github-bot/gh-277'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-277'
git switch 'github-bot/gh-277'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-277'
git switch 'github-bot/gh-277'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-277'
git switch 'main'
git merge --squash 'github-bot/gh-277'
git switch 'main'
git merge --ff-only 'github-bot/gh-277'
git switch 'main'
git merge 'github-bot/gh-277'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.