Shaders: ds_permute_b32 scatters through a scratch in LDS #511
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!511
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-511"
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?
@pug205gti6 on GitHub · 2026-11-25 01:55 UTC · original
pug205gti6:pr/454-shaders-ds_permute→main· +95 −0 · 2 files · 1 commits · opends_permute_b32 was not lowered: it fell to the generic LDS path, which is not what the instruction does. Each active lane gives its data register to the lane its address plus the offset names in dwords, within the 32-lane half of the calling lane (the ISA confines the permute there in wave64). The console writes a scratch that starts at zero and each active destination lane reads a slot of its own, so a destination nobody targets reads zero.
The lowering zeroes the slot of the calling lane, runs a group barrier, has every lane write the slot its address names, runs another barrier, and reads the slot of the calling lane. The scratch holds a dword per lane of every console wave in the group, past the LDS of the program, addressed by the console thread, so the two host waves of a split console wave never hit the same slot. A barrier needs every lane: in a block some lanes leave, this refuses (a wave-wide structuring of the block would open it).
Two tests: a straight-line scatter lowers, and a scatter in a branch refuses. Written with DeepSeek V4 Pro (OpenCode).
Assisted-by: DeepSeek V4 Pro (OpenCode)
@Revens2 on GitHub · 2026-11-25 07:36 UTC · original
Duplicate of #454: @Melow-code opened this patch 53 minutes earlier, and
gh pr diffreturns the same bytes for both (+95/-0 on 2 file(s), same title).Please continue in #454 so the review history and any test data stay in one place.
Thanks.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.