Pixel programs that copy their primitive mask through a VGPR are refused as "a hardware SGPR input" (6 shaders) #457
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS#457
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@lautarocherro on GitHub · 2026-11-27 20:19 UTC · original
What happens
7 pixel programs of a 21,579-shader corpus (Series X, main
b998bb65) are refused as "a hardware SGPR input". It is s17, their primitive mask. The register image confirms it:USER_SGPRis 17 in their images (#436, #455). One of them,8cb18f43378f99c9, was bound in a world run here.The mask only reaches M0 for
v_interp, butPrimMaskUses::is_prim_mask_onlydoes not see that:v_mov_b32and reads it back withv_readfirstlane_b32into a loop phi of s17. The rule follows copies,v_writelane/v_readlanespills and phis, but not this round trip, so thev_mov_b32stops it.s_buffer_load_dword. I have not looked at that one yet.Plan
Follow a VGPR copy of the mask (
v_mov_b32, VGPR phis, VGPR to VGPR copies) back to SGPRs throughv_readfirstlane_b32andv_readlane_b32. Any other read of the copy still refuses, as for spills. The code invites this: "extend the recognised scalar operations if a new compiler pattern still uses the value only for M0". Test and by-output corpus sweep with the PR. Counts and ids only.@lautarocherro on GitHub · 2026-11-27 20:19 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-27 20:19 UTC · original
Claimed by @lautarocherro. Open a draft pull request with
Refs #453in its description within 24 hours, or the claim expires.@lautarocherro on GitHub · 2026-11-27 20:27 UTC · original
Update: the plan above doesn't work.
Following the VGPR copy (
v_mov_b32, thenv_readfirstlane_b32) is not enough. In all 7 programs the copy also reaches VGPR phis that join it with other data, because the register is reused on another path, and arithmetic reads those phis (v_add_f32,v_cndmask_b32...). So "the mask only reaches M0" can't be proven from the code. A local change that follows the copy gains none of the 7 on the corpus.A sounder route: described programs already take the SGPR after the user SGPRs as the primitive mask without that proof. With #455, the register image gives a guessed pixel program's user SGPR count (17 for all 7), so the mask's place is known, not guessed. Lowering could then treat these programs like described ones. That needs the count to reach lowering, so it builds on #455. I'll wait for #455's review before doing it.
@github-actions[bot] on GitHub · 2026-11-29 00:42 UTC · original
The claim by @lautarocherro has expired: no pull request referenced it within 24 hours. This issue is free to claim.