feat(victory-shader): implement s_movrels_b32 and s_movreld_b32 lowering #608
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!608
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/608/head"
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?
@Amit89-beep on GitHub · 2026-11-24 05:29 UTC · original
Amit89-beep:fix/s-movrel-lowering→main· +233 −82 · 3 files · 2 commits · closed without mergingSummary
Implements IR lowering and DXIL emission support for GFX10 scalar relative-indexing move instructions (
s_movrels_b32ands_movreld_b32) invictory-shader, replacing the previousShaderError::Unsupportedpath.Changes
crates/victory-shader/src/ir.rs):s_movrels_b32(sdst = sgpr[src_base + m0]) for relative scalar source reads indexed byM0.s_movreld_b32(sgpr[dst_base + m0] = ssrc) for relative scalar destination writes indexed byM0.M0offsets cannot produce out-of-bounds SGPR accesses or invalid DXIL IR.M0offsets for boths_movrels_b32ands_movreld_b32, verifying round-trip register updates and DXIL emission/validation.Verification
cargo fmt --checkcargo clippy -p victory-shader --all-targetscargo test -p victory-shader@Lyrnc on GitHub · 2026-11-24 06:02 UTC · original
RDNA2 hardware check of the two rules: they match.
Setup. AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. A HIP kernel (assembled by the AMD driver's amd_comgr) fills
s20..s35with distinct values, sets M0, runs one instruction and reads all 16 back. RDNA2 desktop silicon, not the console's. No game data.s_movrels_b32 s22, s21s_movreld_b32 s22, s21So
sdst = s[src + M0]ands[dst + M0] = srcwith the whole M0, as here. Nothing else in the window changed.Out of range: with M0 =
0x00010000or0x41,s_movrels_b32read values that are none of the window's (0x057a9400,0x35a00002), ands_movreld_b32changed nothing in the window. So the hardware gives no defined result there, and your clamping is a choice rather than a semantic.In case a follow-up adds the 64-bit forms: in the same runs
s_movrels_b64/s_movreld_b64rounded the index down to even (M0 = 1 behaves as 0, 3 as 2).AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run.
@alexdeliu on GitHub · 2026-11-24 17:24 UTC · original
Merged onto
main@ffe310eb, this PR (cc6b6984) no longer compiles its tests.crates/victory-shader/src/emit/lower.rs:7443(and 7455, 7466, 7478, 7490) calls thelowers(&words)test helper. Since25b0f888it islowers(words, rsrc2); main's tests pass0. Clippy also flagshalf_shiftas an unused import atlower.rs:7031.Checked with CI's steps (both clippy runs with
-D warnings,cargo test --workspace) on Windows 11, AMD RX 9070. Every open PR: https://gist.github.com/alexdeliu/ef9ef0ebc1776ff104b5aa8eaea18e87@Marvisak on GitHub · 2026-11-25 00:26 UTC · original
Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed