Recompiler: align S_LOAD address components before addition #1230
No reviewers
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!1230
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1230"
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?
@rison1337 on GitHub · 2026-11-24 13:25 UTC · original
rison1337:codex/smem-component-alignment→main· +50 −4 · 3 files · 1 commits · openS_LOAD aligns the sum of its address components, allowing discarded low bits to carry into bit 2 and read the next dword. Align each component before addition, as specified by RDNA2 ISA 7.2.1, preserving signed negative immediates.
What is in it
gpu/recomp/emit.rs: correct single-window and multi-window S_LOAD addresses.gpu/recomp/tests.rs: synthetic GPU regression covering all five load widths, four base alignments, independent offsets, negative immediates and a null-offset control. It fails on unchanged main (0xCAFE0001 instead of 0xCAFE0000) and passes with the fix. README names the corrected rule.Tested
cargo build --locked --release --workspace --target x86_64-pc-windows-msvc -j4: succeeded.cargo test --locked --release --workspace --target x86_64-pc-windows-msvc -j4 --no-fail-fast -- --test-threads=4 --nocapture: 742 passed, 0 failed, 41 ignored. Four bodies reported SKIPPED: two native-wave64 tests and two requiring the absent D3D12 debug layer; these returns are included in Cargo's passed count.Regression run
Main:
This commit:
Not tested
AI use
@dcastell1 on GitHub · 2026-11-24 13:28 UTC · original
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@47efa2e(baseline 741 passed, 0 failed, 41 ignored on this box):One more passing test than the baseline; the S_LOAD address-component alignment rule ships its case and runs green.
Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@DavidM1911 on GitHub · 2026-11-24 13:39 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib recomp: 190 passed, 0 failed, 18 ignored (new GPU checks included).Thanks!
@bjarngard on GitHub · 2026-11-24 13:47 UTC · original
Test report for head
1a447e6(AMD, native wave64)Tested
XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPEDXCL_REQUIRE_GPU=wave64:gpu_smem_aligns_each_address_componentpassedNot tested: retail titles, RDNA3/RDNA4.
AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
@xpatfussy69x on GitHub · 2026-11-25 08:26 UTC · original
Test report for head
1a447e6as pushed (not merged onto currentmain) – NVIDIA, wave32.Tested
.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignoredgpu_smem_aligns_each_address_componentran and passedXCL_SAMPLE_*data set (game-data tests not run)Not tested
mainAI use
@DavidM1911 on GitHub · 2026-11-26 04:17 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@pvfreis on GitHub · 2026-11-24 14:41 UTC · original · reviewed
Review of
1a447e6(merge base47efa2e), by reading the code against AMD's RDNA2 ISA guide (section 7.2.1, scalar memory addressing); nothing was built or run here. Thes_loadchange matches that section, which has each address component (base, instruction offset, SGPR/M0 offset) drop its two low bits before they are added; the test checks fixed expected values. No defect in this PR.A question outside the PR: the same section describes
s_buffer_loaddifferently. There the instruction offset and SGPR offset are added as they are and only the final address is dword-aligned, which matches the unchanged branch, but the low two bits of the V# base are also ignored. Thes_buffer_loadbranch adds the V# base unmasked (({d0} + {t}_off) & ~3u,emit.rs:1497-1505; unchanged since the first commit). Is that deliberate, e.g. something a title relies on, or would masking{d0}first fit the spec? It only matters for a V# base with low bits set.Review by Claude Code (written by Claude Opus 5.5, checked against the ISA guide by Claude Opus 5.5); each point checked by a person before posting.
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.