Shader: 78 compute programs are refused as "a program input" when a mask is spilled to a VGPR lane and read back #578
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#578
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?
@ShadyUnderLight on GitHub · 2026-11-28 05:45 UTC · original
Measured, and the message is wrong: the value it names is never a program input. Refs #4.
Where.
Lower::mask_number(crates/victory-shader/src/emit/lower.rs) refuses when the value whose bits are wanted has no writing instruction (def_block.get(&lo)). The message said "a program input", which sent this issue after the SGPRs the title passes in.What it actually is. Dump of one headless run at
2f4d81e0(M5 Max, Series X, 480 s, 2,816 frames): 1,554 refused containers; 209 of them refuse with this message (207 compute, 2 pixel), and the run logged it for 84 unique compute hashes. Every failure point was disassembled: 197 of 207 stop ats_cbranch_execz, the other 10 atv_writelane_b32/s_cbranch_scc0. A temporary trace inmask_numberrecorded 19,558 refusals, every one from a joining value with no writing instruction — never a live-in.The console compiler spills the mask to a VGPR lane and reads it back, and the read-back joins the loop register.
compute daff9d66adf677aaat0x9edc:Why #304's proof does not reach these joins. Of 5,883 distinct (block, register) joins refused here: 3,102 sit in blocks with no EXEC join at all, so
exec_copies_at_joinsnever looks at them; 2,780 have an edge whose argument neither equals nor implies that edge's EXEC mask; 1 is read through another join. Two strengthenings were implemented and swept — the join⊆the block's entry EXEC, and each edge's argument⊆that edge's EXEC argument — and no program newly translates. That is semantic: these registers hold "lanes still looping", so at the join they include lanes that are not running; a ballot there drops exactly those bits, which is whymask_dwordballots only the active mask.What lands now. The wording, only.
Lower::unwritten_masknames which of the three shapes a program has — a mask spilled to a VGPR lane and read back and joined where no instruction writes it (206 of 209), a join with no writer that no spill is found for (3), or a program input (a value inProgram::inputs; none in this corpus). What is accepted and refused, and the code emitted, do not change. Tests:mask_tests::a_mask_spilled_to_a_vgpr_lane_and_read_back_says_so(fails on2f4d81e0: it reports "a program input") andmask_tests::a_join_of_two_compares_is_no_spilled_mask(a look-alike that stays refused). Sweep of the dump before and after: 0 newly translated, 0 outputs changed, 0 regressions, the 209 reason texts the only difference.What the translation itself needs, and why it waits. Of the 209 containers, 176 then refuse at "an image descriptor's dwords 5 to 7" (#544) and 15 at "a buffer's dword 1" (#411); of the run's 84, 65 and 13. Making this branch translate adds no translation before those two land, so it is parked behind them.
@ShadyUnderLight on GitHub · 2026-11-28 05:46 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-28 05:46 UTC · original
Claimed by @ShadyUnderLight. Open a draft pull request with
Refs #574in its description within 24 hours, or the claim expires.@ShadyUnderLight on GitHub · 2026-11-28 06:19 UTC · original
Measured, and the shape is none of the three above: the message is wrong again.
Dump of one headless run at
2f4d81e0(M5 Max, Series X, 480 s, 2,816 frames): 1,554 refused containers. Swept, 209 of them still refuse with this message (207 compute, 2 pixel); the run itself logged it for 84 unique compute hashes.Where they stop. Disassembled every failure point: 197 of 207 stop at
s_cbranch_execz, the other 10 atv_writelane_b32/s_cbranch_scc0. None is a program input: a temporary trace inmask_numberrecorded 19,558 refusals, every one from a joining value with no writing instruction (a phi), never from a live-in.The mask is spilled into a VGPR lane, read back and joined.
compute daff9d66adf677aaat0x9edc:Why #304's proof does not reach them. Of 5,883 distinct (block, register) joins refused here: 3,102 sit in blocks with no EXEC join at all, so
exec_copies_at_joinsnever looks at them; 2,780 have an edge whose argument mask neither equals nor implies that edge's EXEC mask; 1 is read through another join. Two strengthenings were implemented and swept — the join's merged mask⊆the block's entry EXEC, and each edge's argument⊆that edge's EXEC argument — and no program newly translates.That is semantic, not a missing rule: these registers hold "lanes still looping", so at the join they include lanes that are not running (
s_mov_b32 exec_lo, s102puts them back later). A ballot there drops exactly those bits, which is whymask_dwordballots only the active mask.What this refusal is worth on its own: nothing yet. Of the 209 containers, 176 then refuse at "an image descriptor's dwords 5 to 7" (#544) and 15 at "a buffer's dword 1" (#411); of the run's 84, 65 and 13. This branch cannot add a translation before #544 and #411 land, so it is parked behind them.
What should change now: the message. "a program input" sent this issue down the wrong path for a day; it should name the spilled-mask shape ("a lane mask spilled to a VGPR lane and read back, at a join with no writing instruction"), which is a diagnostics change only, with a test that pins the wording.
Shader: 78 compute programs read a program-input lane mask as datato Shader: 78 compute programs are refused as "a program input" when a mask is spilled to a VGPR lane and read back@github-actions[bot] on GitHub · 2026-11-29 08:50 UTC · original
The claim by @ShadyUnderLight has expired: no pull request referenced it within 24 hours. This issue is free to claim.