Repository navigation
Conversation
RDNA ISA §8 ignores the two LSBs of the immediate offset and of soffset separately before they are summed. Adding first then shifting made soffset=3 offset:3 load dword 1 instead of dword 0.
Constant 3&!3 folded to 0, so 0+0 tripped -D clippy::identity_op on CI. Co-authored-by: Matsvey Makushenka <matvey.myown@gmail.com>
|
Verification — head Environment: Windows 11 Pro 10.0.26200, rustc/cargo 1.98.1, DXC/dxil 1.8.2502.11 (Windows Kits 10.0.26100.0 x64).
Read the full diff first: no process, network or filesystem code beyond what the PR describes; no game data, dumps, shader names or retail hashes involved. Verified by Claude Code (Claude Sonnet 5.5), an AI assistant; this is a test report, not a code review or approval. |
|
Duplicate check: #1939 (ashrafsdrop, opened 01:22Z, mergeable) makes the same change to Both mask the immediate offset and AI-assisted (Claude Code). Read from the two diffs against |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Truncating
s_buffer_loadoffset terms independently (& !3per term before adding) matches hardware semantics and passes live GPU readback tests. cargo test -p victory-shader s_buffer_load: 2/2 passed on RTX 5090, 2/2 passed on WARP (s_buffer_load_with_unaligned_soffset_and_offset_lowersands_buffer_load_truncates_offset_terms_independently).cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.
AI-assisted (Gemini 4 Neon).
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: merged into main 940d32f, cargo test -p victory-shader --locked on macOS arm64 — 145 passed, 0 failed, 2 ignored (Windows-gated hardware execution tests not run here). Approving — s_buffer_load offset terms truncated independently.
|
Verified the semantics against RDNA ISA §8: the two LSBs of |
|
Automated triage for the maintainers. Proposed close: duplicate of #1939. The lowering change in This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. Generated by Claude Code |
What
s_buffer_load_dword*on RDNA adds the immediate offset andsoffsetafter clearing each term's two LSBs (RDNA ISA guide §8, Scalar Memory Operations). Onmainthe terms were summed first, sosoffset = 3withoffset:3loaded dword 1 ((3+3)>>2) instead of dword 0.Tracked as VIC-BT-025 in #1249. Related open head #1939 (
triage: needs work) — this is a focused slice with the citation and distinguishingsoffset=3, offset:3case from that triage.Change
In
crates/victory-shader/src/emit/lower.rs, mask only the instruction operands (imm & !3,soffset & !3) before adding. Descriptorbase/ dynamicextrastay unmasked.Tests
cargo test -p victory-shader --locked --lib s_buffer_load_with_unaligned_soffset_and_offset_lowers— pass (Linux)s_buffer_load_truncates_offset_terms_independently(Windows GPU / WARP):soffset=3,offset:3→ dword 0;soffset=7,offset:7→ dword 2cargo clippy -p victory-shader --locked -- -D warnings— cleanNo game data used.