Shaders: a select or carry-in on an untracked mask tests this lane's bit #2539

Open
github-bot wants to merge 2 commits from github-bot/gh-2539 into main AGit
Owner

@⁠kais7654 on GitHub · 2026-11-25 15:30 UTC · original
kais7654:shader/untracked-mask-lane-bit → main · +124 −42 · 2 files · 2 commits · open

Rebases #1084 by @⁠undeadhuman37 onto main (940d32f), with the authorship
preserved. Its merge had grown conflicts with the stride-heap work and the
lane-aware mask detection main already carries; this picks the commit onto
main and resolves them per the integration discussed on the PR.

What it does: v_cndmask_b32 and v_add_co_ci_u32 / v_sub_co_ci_u32 /
v_subrev_co_ci_u32 were refused when their scalar mask was not one
structure followed (a plain SGPR number — "a select on an untracked
mask", "a carry-in from an untracked mask"). In compute with console
lanes, the lane now tests its own bit of the mask register (the high pair
in wave64). Inline 0 and -1 masks are constants. The detection main
already has for these opcodes now leads to accepted lowering instead of a
refusal. Kept from #585's mask part (closed in favor of #1084); the
descriptor-dimension hunk stays with the resource work.

Offline corpus (per the original PR, 26148 programs): "a select on an
untracked mask" 288 -> 0, no new refusal text; those programs stop at
later refusals, and compute programs emitted 1441 -> 1443. The synthetic
test runs and passes on hardware (WARP cannot pin a wave size, so the
test skips it): fails before, passes after.

Local check on this rebase: clippy clean with -D warnings, and the
victory-shader suite passes the mask test on an RTX.

**@⁠kais7654** on GitHub · 2026-11-25 15:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2539) `kais7654:shader/untracked-mask-lane-bit` → `main` · +124 −42 · 2 files · 2 commits · open Rebases #1084 by @⁠undeadhuman37 onto main (940d32f), with the authorship preserved. Its merge had grown conflicts with the stride-heap work and the lane-aware mask detection main already carries; this picks the commit onto main and resolves them per the integration discussed on the PR. What it does: `v_cndmask_b32` and `v_add_co_ci_u32` / `v_sub_co_ci_u32` / `v_subrev_co_ci_u32` were refused when their scalar mask was not one `structure` followed (a plain SGPR number — "a select on an untracked mask", "a carry-in from an untracked mask"). In compute with console lanes, the lane now tests its own bit of the mask register (the high pair in wave64). Inline 0 and -1 masks are constants. The detection main already has for these opcodes now leads to accepted lowering instead of a refusal. Kept from #585's mask part (closed in favor of #1084); the descriptor-dimension hunk stays with the resource work. Offline corpus (per the original PR, 26148 programs): "a select on an untracked mask" 288 -> 0, no new refusal text; those programs stop at later refusals, and compute programs emitted 1441 -> 1443. The synthetic test runs and passes on hardware (WARP cannot pin a wave size, so the test skips it): fails before, passes after. Local check on this rebase: clippy clean with -D warnings, and the victory-shader suite passes the mask test on an RTX.
v_cndmask_b32 and v_*_co_ci_u32 refused when their scalar mask was not one
structure followed (a plain SGPR number). In compute with console lanes the
lane now tests its own bit of the register (pair in wave64); inline 0 and -1
masks are constants. Taken from upstream PR #585 (mask part only; its
descriptor-dimension hunk is left to the resource work).

Offline corpus (26148 programs): "a select on an untracked mask" 288 -> 0, no
new refusal text; those programs now stop at later refusals (descriptor read
as data +205, unknown stride +32, descriptor address/format +33), so compute
programs emitted only 1441 -> 1443. Synthetic test on hardware: fails before,
passes after. WARP cannot pin a wave size, so the test skips it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The CI runner has no hardware adapter, so the hardware-only lane-bit
test found no device and its ran count assert failed every run. The
test now skips when there is no hardware device, as the permute check
does (WARP cannot pin a wave size, which the lane-aware programs ask
for).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:08:39 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 18:33 UTC · original · edited 2026-11-25 22:23 UTC

Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main (conflict in crates/victory-shader/src/emit/valu_tests.rs). It will be reviewed again once it is rebased.

From the earlier needs-work note, still open: green CI, agree with #1084 which PR carries the change, use the same mask lookup in console_lanes and mask_cond, refuse a missing high dword in wave64, and test several lanes with differing mask bits.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 18:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2539#issuecomment-7171071271) · edited 2026-11-25 22:23 UTC <!-- victory-triage v1 head=caa4f495112c835d98d1e15806f8f938d38322e7 verdict=needs-rebase at=2026-11-25T22:33:35Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main` (conflict in `crates/victory-shader/src/emit/valu_tests.rs`). It will be reviewed again once it is rebased. From the earlier needs-work note, still open: green CI, agree with #1084 which PR carries the change, use the same mask lookup in `console_lanes` and `mask_cond`, refuse a missing high dword in wave64, and test several lanes with differing mask bits. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/valu_tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2539'
git switch 'github-bot/gh-2539'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2539'
git switch 'github-bot/gh-2539'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2539'
git switch 'main'
git merge --squash 'github-bot/gh-2539'
git switch 'main'
git merge --ff-only 'github-bot/gh-2539'
git switch 'main'
git merge 'github-bot/gh-2539'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2539
No description provided.