Direct DXIL: scratch address calculation ignores SVE and treats SADDR and ADDR as mutually exclusive #2400
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#2400
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?
@ahmetbagci8 on GitHub · 2026-11-25 17:48 UTC · original
Summary
In
crates/xcl/src/gpu/dxil/lower_mem.rs(scratch, lines 2354-2359):In RDNA2
ENC_FLAT_SCRATCH,SVE(Scratch VGPR Enable) independently controls whetherVADDR(ADDR) is included in the address, andSADDR != 0x7Findependently controls whetherSGPR[SADDR]is included. Treating them as mutually exclusive without checkingSVEcauses two bugs:SADDR != 0x7FandSVE == 1(indexed scratch access with a base SGPR + per-lane VGPR offset),vreg(ADDR)is completely dropped.SADDR == 0x7FandSVE == 0(immediate-only scratch offset),vreg(ADDR)is erroneously used as the base instead of0.Suggested fix
Not tested
082944135cd2b96288470a595861fa608eee08dcwithout a new runtime test.AI use
lower_mem.rsand drafted this report; the author reviewed it before posting.@oni-swr on GitHub · 2026-11-25 20:49 UTC · original
Claiming this issue: fixing RDNA2 Direct DXIL scratch() address calculation to handle SVE and combined SADDR + ADDR, with regression tests.
AI use: Claude Code (Claude Opus 5.5).