Recompiler: treat GFX10.30 scratch ST mode (SADDR 0x7F) as immediate-only (#1361) #1377

Closed
github-bot wants to merge 1 commit from gh-pr/1377/head into gh-pr/1377/base
Owner

@⁠hajduzsolt on GitHub · 2026-11-24 15:24 UTC · original
hajduzsolt:fix/recomp-scratch-st-mode → main · +41 −6 · 2 files · 1 commits · closed without merging

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs: split SADDR == 0x7F from 0x7D in Em::scratch so that 0x7F uses 0u as the base address without referencing v0, while 0x7D preserves VADDR mode using v[ADDR].
  • crates/xcl/src/gpu/recomp/tests.rs: add scratch_address_modes_st_vaddr_and_saddr verifying that ST mode (0x7F) emits 0u + offset with no v0 reference, VADDR mode (0x7D) emits v3 + offset, and SADDR mode (4) emits s4 + offset. Update gpu_more_atomics_sub_dword_scratch_valu to use 0x7D for VADDR mode and add an ST mode (0x7F) test with non-zero v0.

Tested

  • Hardware: AMD Radeon RX 9070 XT 16GB (native Wave64), AMD Ryzen 7 9800X3D, Windows 11 x64, rustc 1.98.1 (48a229cea 2026-09-01), DXC 1.8.2502.11, debug
  • cargo test --workspace -- --test-threads=4: 748 passed, 0 failed, 37 ignored (SKIPPED GPU tests: none)
  • cargo test -p xcl --lib recomp::tests::scratch_address_modes_st_vaddr_and_saddr -- --nocapture: 1 passed, 0 failed
  • cargo test -p xcl --lib recomp::tests::gpu_more_atomics_sub_dword_scratch_valu -- --nocapture: 1 passed, 0 failed

Regression run

main:

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: AMD Radeon RX 9070 XT
title: A newer retail game
seconds: 60
exit: 0x0
frames shown: 1675 (PresentX 1675)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14837 MB

PR:

xcl-smoke v1
commit: d72a747381511b86c3f34442eaec3ffd105f40d2
gpu: AMD Radeon RX 9070 XT
title: A newer retail game
seconds: 60
exit: 0x0
frames shown: 1673 (PresentX 1673)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14839 MB

Not tested

  • Wave32 split-half mode on NVIDIA hardware (tested on native Wave64 AMD RDNA4).
  • Retail title game packages (tested via synthetic cargo test suite).

AI use

  • Antigravity (Gemini) wrote the code and unit tests, and drafted this description.
**@⁠hajduzsolt** on GitHub · 2026-11-24 15:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/1377) `hajduzsolt:fix/recomp-scratch-st-mode` → `main` · +41 −6 · 2 files · 1 commits · closed without merging **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: split `SADDR == 0x7F` from `0x7D` in `Em::scratch` so that `0x7F` uses `0u` as the base address without referencing `v0`, while `0x7D` preserves VADDR mode using `v[ADDR]`. - `crates/xcl/src/gpu/recomp/tests.rs`: add `scratch_address_modes_st_vaddr_and_saddr` verifying that ST mode (`0x7F`) emits `0u + offset` with no `v0` reference, VADDR mode (`0x7D`) emits `v3 + offset`, and SADDR mode (`4`) emits `s4 + offset`. Update `gpu_more_atomics_sub_dword_scratch_valu` to use `0x7D` for VADDR mode and add an ST mode (`0x7F`) test with non-zero `v0`. **Tested** - Hardware: AMD Radeon RX 9070 XT 16GB (native Wave64), AMD Ryzen 7 9800X3D, Windows 11 x64, rustc 1.98.1 (48a229cea 2026-09-01), DXC 1.8.2502.11, debug - `cargo test --workspace -- --test-threads=4`: 748 passed, 0 failed, 37 ignored (SKIPPED GPU tests: none) - `cargo test -p xcl --lib recomp::tests::scratch_address_modes_st_vaddr_and_saddr -- --nocapture`: 1 passed, 0 failed - `cargo test -p xcl --lib recomp::tests::gpu_more_atomics_sub_dword_scratch_valu -- --nocapture`: 1 passed, 0 failed **Regression run** main: ``` xcl-smoke v1 commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7 gpu: AMD Radeon RX 9070 XT title: A newer retail game seconds: 60 exit: 0x0 frames shown: 1675 (PresentX 1675) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14837 MB ``` PR: ``` xcl-smoke v1 commit: d72a747381511b86c3f34442eaec3ffd105f40d2 gpu: AMD Radeon RX 9070 XT title: A newer retail game seconds: 60 exit: 0x0 frames shown: 1673 (PresentX 1673) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14839 MB ``` **Not tested** - Wave32 split-half mode on NVIDIA hardware (tested on native Wave64 AMD RDNA4). - Retail title game packages (tested via synthetic cargo test suite). **AI use** - Antigravity (Gemini) wrote the code and unit tests, and drafted this description.
On RDNA2 / GFX10.30, scratch operations with SADDR == 0x7F select ST
(scratch top / immediate offset only) mode where both SADDR and VADDR
are disabled and the base address is 0. Em::scratch previously handled
0x7F together with 0x7D, emitting v0 as the base address.

Split SADDR == 0x7F from 0x7D in Em::scratch so that 0x7F uses 0u as
the base address without referencing v0, while 0x7D preserves VADDR
mode using v[ADDR]. Add a standalone unit test and update the scratch
GPU test to cover both ST and VADDR modes.

Fixes #1361
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:52:25 +00:00
github-bot closed this pull request 2026-11-26 04:52:25 +00:00
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-24 15:31 UTC · original

NVIDIA run (32-lane waves, so the split wave64 form), which this PR lists as not tested.

Tested: pass, head d72a747 applied on its base main 930e8b4, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17.
cargo test -p xcl --lib -- gpu::recomp --test-threads=4:

  • NVIDIA RTX 3060, driver 32.0.16.1088, waves 32 only: 190 passed, 0 failed, 18 ignored, 2 SKIPPED (no wave64). scratch_address_modes_st_vaddr_and_saddr ok.
  • AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, native wave64: 190 passed, 0 failed, 18 ignored, 0 SKIPPED.

Not tested: the whole workspace suite; a title.

AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

**@⁠DarkPanda69** on GitHub · 2026-11-24 15:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/1377#issuecomment-7136173049) NVIDIA run (32-lane waves, so the split wave64 form), which this PR lists as not tested. **Tested:** pass, head `d72a747` applied on its base `main` `930e8b4`, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17. `cargo test -p xcl --lib -- gpu::recomp --test-threads=4`: - NVIDIA RTX 3060, driver 32.0.16.1088, waves 32 only: 190 passed, 0 failed, 18 ignored, 2 SKIPPED (no wave64). `scratch_address_modes_st_vaddr_and_saddr` ok. - AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, native wave64: 190 passed, 0 failed, 18 ignored, 0 SKIPPED. **Not tested:** the whole workspace suite; a title. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 16:41 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!

**@⁠DavidM1911** on GitHub · 2026-11-24 16:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1377#issuecomment-7138069508) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. Thanks!
Author
Owner

@⁠throny on GitHub · 2026-11-24 20:15 UTC · original

Two contributors checked independently and found that this PR makes the same change as #1365 #1606 (for #1361): #1607, group D30. They suggest keeping #1365. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps.

This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-24 20:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1377#issuecomment-7143261441) <!-- xcl-1607-hint:D30 --> Two contributors checked independently and found that this PR makes the same change as #1365 #1606 (for #1361): #1607, group D30. They suggest keeping #1365. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps. This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

@⁠ivall on GitHub · 2026-11-24 20:44 UTC · original

Closing this as a duplicate: the contributors who checked groups D6 and D30 in #1607 agree that #1365 makes the same change (scratch with SADDR 0x7F addresses the offset alone) and suggest keeping #1365, which was opened first. Its description check still has to pass before it can be merged; if its author does not get to it, I'll reopen this one.

This says nothing about the quality of the code here. If this PR covers a case #1365 does not, or #1365 is closed without being merged, say so and I'll reopen it.

Thank you for the work.

AI use: Claude Code (Claude Opus 5.5) wrote this comment; the decision is the maintainer's.

**@⁠ivall** on GitHub · 2026-11-24 20:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/1377#issuecomment-7144000614) Closing this as a duplicate: the contributors who checked groups D6 and D30 in #1607 agree that #1365 makes the same change (scratch with SADDR 0x7F addresses the offset alone) and suggest keeping #1365, which was opened first. Its description check still has to pass before it can be merged; if its author does not get to it, I'll reopen this one. This says nothing about the quality of the code here. If this PR covers a case #1365 does not, or #1365 is closed without being merged, say so and I'll reopen it. Thank you for the work. AI use: Claude Code (Claude Opus 5.5) wrote this comment; the decision is the maintainer's.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.