Shader: a descriptor spilled to VGPR lanes and spilled again in a loop is refused as "neither loaded nor built" (309 shaders) #404
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#404
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 16:49 UTC · original
What happens
309 shaders in my corpus are refused as "a descriptor neither loaded nor built": 305 compute and 4 vertex. 117 of them were bound in a world run here.
In all 309, every dword of the descriptor is a
v_readlane_b32of a constant lane. The compiler spilled the descriptor's SGPRs to VGPR lanes withv_writelane_b32and reads them back. The tracer already follows spills (Tracer::restored). It fails here because the VGPR is a loop phi: the program restores the descriptor in the loop and spills it again, so the phi's two edges spill different values that hold the same dwords.Tracer::spilledcompares the values themselves, finds two, and gives up.Proposed change
Compare the phi's edges by their origin in the copy propagation, as
propagate_copiesalready does for SGPR phis. A copy keeps every bit, so two values with one origin hold the same descriptor.Measured offline
Corpus of 21,556 shaders from one run (M5 Pro, 48 GB), main
b998bb65against the change,tools/corpus/compare.sh:So this is the first of several steps for these compute shaders. I'll open a PR for this step with a test.
@lautarocherro on GitHub · 2026-11-27 16:49 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-27 16:49 UTC · original
Claimed by @lautarocherro. Open a draft pull request with
Refs #400in its description within 24 hours, or the claim expires.@gagarinyury on GitHub · 2026-11-27 20:07 UTC · original
Data from a run of
preview/graphics-2026-11-28(b3c1a1b0) on a base M5 (32 GB, Series S, headless): 28 world compute programs are refused as "a descriptor's address or format read as data: an image's dwords 5 to 7". A local probe ofLower::descriptor_data(not committed) shows that those dwords are read by the image instructions themselves (image_sample_lz,image_sample_l,image_load,image_storeand others) and byv_writelane_b32, so the descriptor is spilled to VGPR lanes, as in this issue. With #422 (75c5b97a) cherry-picked onto the same preview commit, all 28 are still refused for the same reason, so this looks like a spill form #422 does not cover.Hashes: 0773bcf7de0c2997 0e117205dde09753 15120460b1c6f21f 298d1554f2d4bf85 3907b6685fb84910 3ea378b7dc709d53 419eb951e8537e34 425bc81ad7a027ff 509799cdba3d218f 64cdd17cf0656202 6ac3b1f42aaeb188 6bbb2ad7b3bf1e85 7327c76efb33252d 797314080ff19b66 7bc776ad7536135c a0b1a5cab583622d a45ddc5bf29fa1ed a732bebdfdd99a92 aaae8623ea233691 acdc4c1be303610f bf7f7f6c81b53d25 c9fa549201bccd2f ca60999fc1d0ac9b cd4e49742135ce3b dcd8aac5399e2230 e487768c1c93ecf7 f8a6001b812d76b0 ff52f621d7f3d942
github-bot referenced this issue2026-11-28 03:00:25 +00:00
@github-actions[bot] on GitHub · 2026-11-28 18:59 UTC · original
The claim by @lautarocherro has expired: no pull request referenced it within 24 hours. This issue is free to claim.
@lautarocherro on GitHub · 2026-11-28 19:50 UTC · original
/claim
@github-actions[bot] on GitHub · 2026-11-28 19:50 UTC · original
Claimed by @lautarocherro. Open a draft pull request with
Refs #400in its description within 24 hours, or the claim expires.