Shaders: a scalar joining a lane mask and a number lowers in pixel and vertex programs #1073

Closed
github-bot wants to merge 1 commit from gh-pr/1073/head into gh-pr/1073/base
Owner

@⁠undeadhuman37 on GitHub · 2026-11-24 15:28 UTC · original
undeadhuman37:fix/mask-phi-ballot → main · +84 −2 · 2 files · 1 commits · closed without merging

A register can hold a compare result's high dword on one path and a loaded number on another. The join's mask side was refused as "a lane mask read as data". A pixel or vertex program now takes the mask's ballot as that incoming value (counts and zero tests mean the same on any wave size).

Known limit: the ballot is the host wave's, so a join read some other way would differ from the console.

Measured offline over the shader corpus (26148 programs):

  • "a lane mask read as data": 250 -> 212
  • vertex/pixel programs emitted: 12243 -> 12250 (the other 31 move on to descriptor / scalar-memory refusals)

Tests: a synthetic wave64 pixel program fails to lower before the change and lowers after. cargo clippy -p victory-shader --all-targets -- -D warnings is clean. Not run on a GPU, hence draft.

No game data. AI-assisted: written with Claude Code (Claude Sonnet 5.5).

🤖 Generated with Claude Code

**@⁠undeadhuman37** on GitHub · 2026-11-24 15:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/1073) `undeadhuman37:fix/mask-phi-ballot` → `main` · +84 −2 · 2 files · 1 commits · closed without merging A register can hold a compare result's high dword on one path and a loaded number on another. The join's mask side was refused as "a lane mask read as data". A pixel or vertex program now takes the mask's ballot as that incoming value (counts and zero tests mean the same on any wave size). Known limit: the ballot is the host wave's, so a join read some other way would differ from the console. Measured offline over the shader corpus (26148 programs): - "a lane mask read as data": 250 -> 212 - vertex/pixel programs emitted: 12243 -> 12250 (the other 31 move on to descriptor / scalar-memory refusals) Tests: a synthetic wave64 pixel program fails to lower before the change and lowers after. `cargo clippy -p victory-shader --all-targets -- -D warnings` is clean. Not run on a GPU, hence draft. No game data. AI-assisted: written with Claude Code (Claude Sonnet 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A register can hold a compare result's high dword on one path and a loaded
number on another; the compiler only reads it where the number is live. The
join's mask side was "a lane mask read as data", which refused the program.
A pixel or vertex program now takes the mask's ballot as that incoming value
(counts and zero tests mean the same on any wave size). shortcut: the ballot
is the host wave's, so a join read some other way would differ from the console.

Offline corpus: "a lane mask read as data" 250 -> 212, vertex/pixel programs
emitted 12243 -> 12250; the other 31 move on to descriptor/scalar-memory
refusals. Synthetic wave64 pixel program fails before, lowers after.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:19:02 +00:00
github-bot closed this pull request 2026-11-26 04:19:02 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:31 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Draft. A register joining a mask and a number in pixel/vertex programs: main resolves these joins by proving the mask edge dead or the join data (dead_on_edge, live_edges, joins_loaded; 0b35b7fe, a7fc47af), 250 to 4 programs, without taking a host-wave ballot as the console's number.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/1073#issuecomment-7148598452) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Draft. A register joining a mask and a number in pixel/vertex programs: main resolves these joins by proving the mask edge dead or the join data (dead_on_edge, live_edges, joins_loaded; 0b35b7fe, a7fc47af), 250 to 4 programs, without taking a host-wave ballot as the console's number. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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!1073
No description provided.