Recompiler: invalidate SGPR state on S_MOVRELSD_2_B32 in upper_lanes #1616

Open
github-bot wants to merge 1 commit from github-bot/gh-1616 into main AGit
Owner

@⁠OtavioTadeu on GitHub · 2026-11-24 18:15 UTC · original
OtavioTadeu:fix/recomp-upper-lanes-movrelsd2-1488 → main · +8 −1 · 1 files · 1 commits · open

What is in it

  • Addresses XCL-BT-037 (Part of #1488): invalidate SGPR abstract state in recomp::upper_lanes::step on S_MOVRELSD* instructions (matching S_MOVRELD*).
  • Add movrelsd2_invalidates_sgprs unit test verifying S_MOVRELSD_2_B32 prevents stale SGPR subset assumptions across whole-wave operations.

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce GTX 1660 SUPER (driver 32.0.16.1088, Turing wave32), AMD Ryzen 5 5600G, Windows 11 26200, rustc 1.100.0, debug
  • cargo test -p xcl --lib gpu::recomp::upper_lanes: 10 passed, 0 failed
  • cargo test --workspace -- --test-threads=4: 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask [no wave64], gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware [no wave64], heap_window_out_of_memory_falls_back_to_the_switch_form [no heap windows])

Regression run

  • scripts/smoke.ps1 -Game retail_title -Seconds 60 (main baseline vs PR head on NVIDIA GeForce GTX 1660 SUPER):

xcl-smoke v1

commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485

gpu: NVIDIA GeForce GTX 1660 SUPER

title: retail_title

seconds: 60

exit: 0x0

frames shown: 631 (PresentX 631)

presents per 2 s (last 3): 47 47 49

device removals: 0

crashes: 0

peak commit: 15199 MB


xcl-smoke v1

commit: fd75fde65eef0683e7a15f529f022db282df706a

gpu: NVIDIA GeForce GTX 1660 SUPER

title: retail_title

seconds: 60

exit: 0x0

frames shown: 699 (PresentX 700)

presents per 2 s (last 3): 51 55 54

device removals: 0

crashes: 0

peak commit: 15207 MB

Not tested

  • AMD / Intel / native wave64 GPUs, Linux/Wine, and extended gameplay past the 60 s smoke window

AI use

  • Antigravity (Gemini 4 Neon) implemented the upper_lanes fix, unit test, and commit message; human reviewed.
**@⁠OtavioTadeu** on GitHub · 2026-11-24 18:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1616) `OtavioTadeu:fix/recomp-upper-lanes-movrelsd2-1488` → `main` · +8 −1 · 1 files · 1 commits · open **What is in it** - Addresses `XCL-BT-037` (Part of #1488): invalidate SGPR abstract state in `recomp::upper_lanes::step` on `S_MOVRELSD*` instructions (matching `S_MOVRELD*`). - Add `movrelsd2_invalidates_sgprs` unit test verifying `S_MOVRELSD_2_B32` prevents stale SGPR subset assumptions across whole-wave operations. **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce GTX 1660 SUPER (driver 32.0.16.1088, Turing wave32), AMD Ryzen 5 5600G, Windows 11 26200, rustc 1.100.0, debug - `cargo test -p xcl --lib gpu::recomp::upper_lanes`: 10 passed, 0 failed - `cargo test --workspace -- --test-threads=4`: 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` [no wave64], `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` [no wave64], `heap_window_out_of_memory_falls_back_to_the_switch_form` [no heap windows]) **Regression run** - `scripts/smoke.ps1 -Game retail_title -Seconds 60` (`main` baseline vs PR head on NVIDIA GeForce GTX 1660 SUPER): ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce GTX 1660 SUPER title: retail_title seconds: 60 exit: 0x0 frames shown: 631 (PresentX 631) presents per 2 s (last 3): 47 47 49 device removals: 0 crashes: 0 peak commit: 15199 MB ``` ``` xcl-smoke v1 commit: fd75fde65eef0683e7a15f529f022db282df706a gpu: NVIDIA GeForce GTX 1660 SUPER title: retail_title seconds: 60 exit: 0x0 frames shown: 699 (PresentX 700) presents per 2 s (last 3): 51 55 54 device removals: 0 crashes: 0 peak commit: 15207 MB ``` **Not tested** - AMD / Intel / native wave64 GPUs, Linux/Wine, and extended gameplay past the 60 s smoke window **AI use** - Antigravity (Gemini 4 Neon) implemented the `upper_lanes` fix, unit test, and commit message; human reviewed.
In recomp::upper_lanes::step, S_MOVRELD* invalidated st.s because it
writes indirectly via s[dst + m0], while S_MOVRELSD_2_B32 was missed
and left stale SGPR abstract state across indirect SGPR writes
(XCL-BT-037 in #1488).

Match S_MOVRELSD alongside S_MOVRELD so S_MOVRELSD_2_B32 resets st.s
just like other indirect SGPR writes (preserving st.s[125] and exec_hi),
and add movrelsd2_invalidates_sgprs unit test coverage.

Verified locally with:
cargo test -p xcl --lib gpu::recomp::upper_lanes
(10 passed, 0 failed)

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:59:33 +00:00
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 18:23 UTC · original

Regression run for this PR: head fd75fde, based on main 9e3831e. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s, scripts/smoke.ps1 on a retail title for 60 s, back to back with the main run.

main 9e3831e:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1587 (PresentX 1588)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 99220 MB

this PR:

xcl-smoke v1
commit: fd75fde65eef0683e7a15f529f022db282df706a
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1551 (PresentX 1551)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 88711 MB

No device removals or crashes; 98 % of main's frames, 89 % of its peak commit.

Peak commit on this machine is mostly the pipeline preload's DXC compiles (#1035) and varies a lot from run to run, so it says little about this PR.

Not tested: the whole suite; whether the title reaches the changed code in these 60 s.

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-24 18:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/1616#issuecomment-7140579700) Regression run for this PR: head `fd75fde`, based on `main` `9e3831e`. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, `XCL_NETWORK=0`, A pressed every 4 s from 20 s, `scripts/smoke.ps1` on a retail title for 60 s, back to back with the `main` run. main `9e3831e`: ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1587 (PresentX 1588) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 99220 MB ``` this PR: ``` xcl-smoke v1 commit: fd75fde65eef0683e7a15f529f022db282df706a gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1551 (PresentX 1551) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 88711 MB ``` No device removals or crashes; 98 % of main's frames, 89 % of its peak commit. Peak commit on this machine is mostly the pipeline preload's DXC compiles (#1035) and varies a lot from run to run, so it says little about this PR. **Not tested:** the whole suite; whether the title reaches the changed code in these 60 s. Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 19:01 UTC · original

Full-suite run, since this PR has no test report yet. Tested exact head fd75fde (on its base 9e3831e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form: 776 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: movrelsd2_invalidates_sgprs.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 777 passed, 0 failed, 41 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • heap_window_out_of_memory_falls_back_to_the_switch_form was skipped with --skip. It fails on main 9e3831e too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWS unset). Reported as #1651.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 19:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1616#issuecomment-7141473222) Full-suite run, since this PR has no test report yet. Tested exact head `fd75fde` (on its base `9e3831e`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form`: **776 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `movrelsd2_invalidates_sgprs`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **777 passed, 0 failed, 41 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `heap_window_out_of_memory_falls_back_to_the_switch_form` was skipped with `--skip`. It fails on main `9e3831e` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (`XCL_HEAP_WINDOWS` unset). Reported as #1651. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 20:37 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 20:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1616#issuecomment-7143840355) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1616/head:github-bot/gh-1616'
git switch 'github-bot/gh-1616'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1616'
git switch 'github-bot/gh-1616'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1616'
git switch 'github-bot/gh-1616'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1616'
git switch 'main'
git merge --squash 'github-bot/gh-1616'
git switch 'main'
git merge --ff-only 'github-bot/gh-1616'
git switch 'main'
git merge 'github-bot/gh-1616'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.