Recompiler: scratch with SADDR 0x7F addresses the offset alone (#1361) #1365
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!1365
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1365"
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?
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:16 UTC · original
tiagonogueiraa-bit:scratch-st-mode→main· +51 −6 · 2 files · 1 commits · openOn GFX10.3, FLAT scratch with SADDR
0x7D(NULL) addresses VADDR + offset, and with SADDR0x7F(ST mode) the offset alone.Em::scratchtreated0x7Fas VADDR too, so a constant-offset spill addedv0(ADDR 0) to its address, and its reload read another slot oncev0had changed. Fixes #1361.The encodings come from
llvm-mc -mcpu=gfx1030:scratch_load_dword v1, v2, offgivesSADDR=0x7d, ADDR=2, andscratch_load_dword v1, off, off offset:16givesSADDR=0x7f, ADDR=0.What is in it
crates/xcl/src/gpu/recomp/emit.rs(scratch):0x7F→ base0u,0x7D→ VADDR, otherwise the SGPR.crates/xcl/src/gpu/recomp/tests.rs:gpu_more_atomics_sub_dword_scratch_valumeant VADDR + offset, and is now encoded with0x7D, as LLVM does.scratch_st_mode_takes_the_offset_alone_hlsl(CPU only) checks both address forms in the HLSL.gpu_scratch_st_mode_spill_survives_v0spills in ST mode, changesv0, then reloads in ST mode and through VADDR 0.Tested
cargo check -p xcl --lib --tests --target x86_64-pc-windows-msvchas no errors (C code stubbed, nothing linked).gpu::recompfrommainand from this branch.mainaddresses the ST-mode store asv0 + 0x00000010u; this branch as0u + 0x00000010u.mainthe reloads read0, 0; on this branch they read7, 7, as the test expects.ff76dbb(RTX 5070 Ti, Windows MSVC build under Wine + vkd3d-proton):gpu_scratch_st_mode_spill_survives_v0(on the GPU) andscratch_st_mode_takes_the_offset_alone_hlslpass.gpu_more_atomics_sub_dword_scratch_valutimes out on its GPU fence on both this head and930e8b4in that Wine setup. (report)ff76dbb:cargo test --workspace --locked --no-fail-fast -- --test-threads=4gives 753 passed, 0 failed, 41 ignored, against 751 / 0 / 41 on930e8b4. Both new tests fail when copied ontomain:v0is added to the ST-mode offset, and lane 0 reads(0, 0).gpu_more_atomics_sub_dword_scratch_valupasses natively. (report)main:cargo test -p xcl --lib, all passed, 0 failed, about 21 ignored. (report)Regression run
@eizispark ran a 60 s pair on
930e8b4and this head. It shows no removal or crash, 1679 frames against 1667, and the same peak commit (report). The blocks are not copied here because theirtitleline names the game (it is the folder name). A rerun with a neutral folder name would let them go in unedited.Not tested
AI use
🤖 Generated with Claude Code
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@vitor127wt on GitHub · 2026-11-24 15:22 UTC · original
Focused test report on RTX 5070 Ti under Wine
Following up on #1243. I tested the clean PR head
ff76dbb9c19303a4111f54a3cc32ce83ff4867b7. Both new ST-mode scratch tests passed.Tested
7.3.5-2-cachyos, Wine 11.22, DXVKv2.7.1-498-ga6764047e587178, vkd3d-proton from Proton-CachyOS (0bb64c56c8f0dcc), and DXC 1.9.2609.5. Rust 1.100.0, cargo-xwin 0.24.1, Windows MSVC debug target.cargo xwin test --offline --locked --target x86_64-pc-windows-msvc -p xcl --lib scratch_st_mode -- --nocapture --test-threads=1rangpu_scratch_st_mode_spill_survives_v0on the RTX 5070 Ti andscratch_st_mode_takes_the_offset_alone_hlslon the CPU. 2 passed, 0 failed, 0 ignored, 0 skipped.gpu_more_atomics_sub_dword_scratch_valuin isolation on the head, with the same Cargo command and that test name as the filter. It failed waiting for the GPU fence after 10,000 ms. I ran the same test binary filter on the exact parent930e8b49c1c2ec683d22c724a398b39111cd0e56under the same Wine setup and observed the same fence timeout. Each of those runs reported 0 passed, 1 failed, 0 ignored and 0 skipped.Not tested
Native Windows, the full workspace suite, and retail-title smoke runs.
AI use
Codex (GPT-6, exact variant unavailable) cross-built and ran the tests, checked the parent result, and drafted this report.
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:23 UTC · original
Thank you, @vitor127wt! I added both passing tests to Tested, together with the fence timeout of the existing test, which happens on the base too under that Wine setup. Marked ready for review.
Written with Claude Code (Claude Opus 5.5).
@eizispark on GitHub · 2026-11-24 15:43 UTC · original
Hardware test report — commit
ff76dbbVerified clean merge with
main(930e8b4) onff76dbb9c19303a4111f54a3cc32ce83ff4867b7: pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace --no-fail-fast -- --test-threads=4:753 passed, 0 failed, 41 ignored(GPU tests skipped on this adapter:none)gpu::recomp::tests::scratch_st_mode_takes_the_offset_alone_hlsl,gpu::recomp::tests::gpu_scratch_st_mode_spill_survives_v0, andgpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu(SADDR=0x7DVADDR + offset) all pass on native Windows D3D12Regression run
main(930e8b4):PR (
ff76dbb):Not tested
XCL_D3D12_DEBUG=1; gameplay past the menusAI use
@nnonno91 on GitHub · 2026-11-24 15:44 UTC · original
Native Windows test report for
ff76dbbTested
x86_64-pc-windows-msvc), DXC 1.8.2502.11, debug/test profiles. Selected the RTX 5090 withXCL_ADAPTER.cargo build --workspace --lockedandcargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputpassed on both clean commits. Cargo reported 753 passed, 0 failed, 41 ignored onff76dbb9c19303a4111f54a3cc32ce83ff4867b7and 751 passed, 0 failed, 41 ignored on930e8b49c1c2ec683d22c724a398b39111cd0e56. Both totals include two GPU skips for lack of native wave64:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware. The synthetic end-to-end title passed on both commits.cargo test --locked -p xcl --lib scratch_st_mode -- --test-threads=1passed both new tests on the PR head. I copied just those two test functions tomainand reran the filter. Both failed as expected. The HLSL test showedv0added to the ST-mode offset, and the GPU test read(0, 0)on lane 0 where it expected(7, 7).cargo test --locked -p xcl --lib gpu_more_atomics_sub_dword_scratch_valu -- --nocapture --test-threads=1passed on the PR head. This is the test that timed out in the earlier Wine run.Not tested
AI use
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:45 UTC · original
Thank you, @nnonno91 and @eizispark! Both runs are in Tested now. nnonno91's check that the new tests fail on
mainis especially useful.@eizispark, a small request: your smoke blocks'
title:line is the game folder's name, which names the game, and the maintainer asks that it stay out of PRs. Blocks can't be edited by hand, so I linked your pair instead of pasting it. If you rerun with the folder renamed to something neutral (e.g.game), I'll paste both blocks as they are.Written with Claude Code (Claude Opus 5.5).
@DavidM1911 on GitHub · 2026-11-24 16:33 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.Thanks!
@tiagonogueiraa-bit on GitHub · 2026-11-24 20:14 UTC · original
Thank you @DavidM1911, the run merged with current
mainis in Tested. This PR now only lacks anxcl-smokepair onff76dbb(with the title folder namedgame).@Mischief8713 on GitHub · 2026-11-24 20:36 UTC · original
GPU run of
ff76dbbon Windows (NVIDIA GTX 1660 Ti, Turing): 709 passed, 0 failed, 21 ignoredTested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4; build exit 0, test exit 0gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64)main(9039900). It was run as it is.gpu::recomp::tests::gpu_scratch_st_mode_spill_survives_v0ran on the GPU and passed.scratch_st_mode_takes_the_offset_alone_hlslpassed.Not tested
scripts/smoke.ps1run, so no regression runAI use
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.