Shaders: read EXEC as data in the entry block #3940

Open
kotekompotek wants to merge 1 commit from upstream-pr/3940 into main
kotekompotek commented 2026-12-01 18:24:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-12-01T18:24:08Z.


Summary

Programs that read the EXEC registers (SGPRs 126/127 in the flattened numbering) as data in their entry block were refused with "a hardware SGPR input". The execution mask on entry is provable: every lane the wave launched with is on.

This emits the concrete lane mask instead of refusing: u32::MAX for the low dword, u32::MAX for the high dword on wave64 and 0 on wave32 (which has no EXEC high half). The mask machinery's Missing("a lane mask") path stays for phi joins, where EXEC is genuinely varying.

Evidence

A corpus scan of the title's shader archive (26 503 containers, translate --list with word-level tracing) counted ~30 000 entry-block EXEC reads across pixel (initialized_sgprs=19) and compute (9, 14) programs — the largest single refusal class observed after the FSPX root-type fix. Program inputs for Reg::S(EXEC) are already marked Bool::TRUE in structure.rs's mask tracking.

Test plan

  • cargo check -p victory-shader clean
  • Corpus scan re-run pending (counts verified before the change; the arm intercepts the same match site)

Generated with Devin.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5591859524 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3940). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-12-01T18:24:08Z. --- ## Summary Programs that read the EXEC registers (SGPRs 126/127 in the flattened numbering) as data in their entry block were refused with "a hardware SGPR input". The execution mask on entry is provable: every lane the wave launched with is on. This emits the concrete lane mask instead of refusing: `u32::MAX` for the low dword, `u32::MAX` for the high dword on wave64 and `0` on wave32 (which has no EXEC high half). The mask machinery's `Missing("a lane mask")` path stays for phi joins, where EXEC is genuinely varying. ## Evidence A corpus scan of the title's shader archive (26 503 containers, `translate --list` with word-level tracing) counted ~30 000 entry-block EXEC reads across pixel (initialized_sgprs=19) and compute (9, 14) programs — the largest single refusal class observed after the FSPX root-type fix. Program inputs for `Reg::S(EXEC)` are already marked `Bool::TRUE` in `structure.rs`'s mask tracking. ## Test plan - [x] `cargo check -p victory-shader` clean - [ ] Corpus scan re-run pending (counts verified before the change; the arm intercepts the same match site) Generated with Devin.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3940:upstream-pr/3940'
git switch 'upstream-pr/3940'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3940'
git switch 'upstream-pr/3940'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3940'
git switch 'upstream-pr/3940'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3940'
git switch 'main'
git merge --squash 'upstream-pr/3940'
git switch 'main'
git merge --ff-only 'upstream-pr/3940'
git switch 'main'
git merge 'upstream-pr/3940'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!3940
No description provided.