Recompiler: revert the select() form of pixel-shader rla() (#1452) #2930

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

@⁠SergeAx on GitHub · 2026-11-27 00:33 UTC · original
SergeAx:recomp-revert-2247-rla → main · +6 −127 · 1 files · 1 commits · closed without merging

Reverts #2247 (5081dc8b). Part of #1452.

Since #2247 a retail title loses the device (0x887a0005) at its world load on an RTX 5080. The bisect in #1452 found #2247's merge to be the first bad point of main's merges 568e7db..b49be18, and reverting only its commit on b49be18 (with #1435) took the removal from 6 of 7 runs to 0 of 5. Both forms of rla() compute the same values, and the debug layer calls the removal DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT, so the NVIDIA driver most likely trips over the new DXIL. Which of the three rewrites does it is not known, so this restores the old form whole until a narrower change that keeps the local-array win is tested.

The branch is on b49be18, the main the bisect ended on. It merges into today's main without conflicts. On main after #2555, both builds would first have to prepare the title's 26,503 shaders, and the revert changes the HLSL of every one of them (each includes PRELUDE).

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs: PRELUDE::rla() goes back to ?:, if and xcl_lv[min(h >> 5, 3u)]. #2247's three tests go with it: two check for the select() form, and the GPU one compares rla() with the form it has again.

Tested

  • NVIDIA GeForce RTX 5080, driver 621.14; AMD Ryzen 5 3500X; Windows 10 Pro 22H2 (19045.6466), D3D12 Agility SDK 1.620.2; Rust 1.100.0
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 at 4e008ce5, debug: 1427 passed, 5 failed, 47 ignored. The 5 are known on main: #1905 (fuzz_validate_and_gpu_0.._3) and vram::tests::d32s8_targets_take_their_own_size_of_video_memory (#2588).
  • SKIPPED (25): 21 × no wave64; 3 × wave32 per-lane form refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32); heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
  • The title (retail 1.0.2.1), release, unattended 240 s runs with XCL_PRESS_A_AT=20,24,…,140 XCL_DRED=1 XCL_NETWORK=0, both trees with #1435's 14c8a2d for the earlier crash of #662: on b49be18 the device was removed after the world-load step in 6 of 7 runs; on this branch (c55ea7e7 = this commit + #1435) in 0 of 5, all of which passed the step at 93–108 s and ran to 240 s.

Regression run

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5080
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1396 (PresentX 1396)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15823 MB

this PR:

xcl-smoke v1
commit: 4e008ce538c1371e7563e08772d81a5d1cffb28e
gpu: NVIDIA GeForce RTX 5080
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1424 (PresentX 1424)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17128 MB

Not tested

  • AMD and Intel GPUs, other NVIDIA drivers, Windows 11
  • On today's main (8b957bec): neither the title runs nor the smoke runs
  • Which of #2247's three rewrites the driver trips over, and in which pixel shader
  • The smoke runs press nothing, so they stay in the menus up to the player picker; the removal and its absence are from the title runs above
  • #2247's gain (no local arrays or branches in rla()'s DXIL) is lost; I have not measured what that costs in a title

AI use

  • Claude Code (Claude Opus 5.5) ran the bisect, the title runs, the tests and the smoke runs, made the revert, and wrote this description.
**@⁠SergeAx** on GitHub · 2026-11-27 00:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2930) `SergeAx:recomp-revert-2247-rla` → `main` · +6 −127 · 1 files · 1 commits · closed without merging Reverts #2247 (`5081dc8b`). Part of #1452. Since #2247 a retail title loses the device (`0x887a0005`) at its world load on an RTX 5080. [The bisect in #1452](https://git.gtahub.st/github/xcl-dev--xcl/issues/1452) found #2247's merge to be the first bad point of `main`'s merges `568e7db`..`b49be18`, and reverting only its commit on `b49be18` (with #1435) took the removal from 6 of 7 runs to 0 of 5. Both forms of `rla()` compute the same values, and the debug layer calls the removal `DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT`, so the NVIDIA driver most likely trips over the new DXIL. Which of the three rewrites does it is not known, so this restores the old form whole until a narrower change that keeps the local-array win is tested. The branch is on `b49be18`, the `main` the bisect ended on. It merges into today's `main` without conflicts. On `main` after #2555, both builds would first have to prepare the title's 26,503 shaders, and the revert changes the HLSL of every one of them (each includes `PRELUDE`). **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: `PRELUDE::rla()` goes back to `?:`, `if` and `xcl_lv[min(h >> 5, 3u)]`. #2247's three tests go with it: two check for the `select()` form, and the GPU one compares `rla()` with the form it has again. **Tested** - NVIDIA GeForce RTX 5080, driver 621.14; AMD Ryzen 5 3500X; Windows 10 Pro 22H2 (19045.6466), D3D12 Agility SDK 1.620.2; Rust 1.100.0 - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` at `4e008ce5`, debug: 1427 passed, 5 failed, 47 ignored. The 5 are known on `main`: #1905 (`fuzz_validate_and_gpu_0`..`_3`) and `vram::tests::d32s8_targets_take_their_own_size_of_video_memory` (#2588). - SKIPPED (25): 21 × no wave64; 3 × wave32 per-lane form refused (`V_MUL_F16`, `V_PK_MUL_F16`, `V_CVT_F16_F32`); `heap_window_out_of_memory_falls_back_to_the_switch_form`: no heap windows - The title (retail 1.0.2.1), release, unattended 240 s runs with `XCL_PRESS_A_AT=20,24,…,140 XCL_DRED=1 XCL_NETWORK=0`, both trees with #1435's `14c8a2d` for the earlier crash of #662: on `b49be18` the device was removed after the world-load step in 6 of 7 runs; on this branch (`c55ea7e7` = this commit + #1435) in 0 of 5, all of which passed the step at 93–108 s and ran to 240 s. **Regression run** main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 5080 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1396 (PresentX 1396) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15823 MB ``` this PR: ``` xcl-smoke v1 commit: 4e008ce538c1371e7563e08772d81a5d1cffb28e gpu: NVIDIA GeForce RTX 5080 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1424 (PresentX 1424) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17128 MB ``` **Not tested** - AMD and Intel GPUs, other NVIDIA drivers, Windows 11 - On today's `main` (`8b957bec`): neither the title runs nor the smoke runs - Which of #2247's three rewrites the driver trips over, and in which pixel shader - The smoke runs press nothing, so they stay in the menus up to the player picker; the removal and its absence are from the title runs above - #2247's gain (no local arrays or branches in `rla()`'s DXIL) is lost; I have not measured what that costs in a title **AI use** - Claude Code (Claude Opus 5.5) ran the bisect, the title runs, the tests and the smoke runs, made the revert, and wrote this description.
This reverts 5081dc8b (#2247). Since that change a retail title loses
the device (0x887a0005) at its world load on an RTX 5080 (driver
621.14, Windows 10): a bisect of main's merges 568e7db..b49be18 found
#2257 good in 4 runs and #2247's merge the first bad point, and on
b49be18 with #1435 the device was removed in 6 of 7 runs, against 0 of
5 with this revert. The new rla() computes the same values and the
debug layer calls the removal DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT, so
the driver likely trips over the new DXIL; which of the three rewrites
does it is not known.

The change's tests go with it: two check for the select() form, and
the GPU one compares rla() with the form it now has again.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:16:32 +00:00
github-bot closed this pull request 2026-11-27 01:16:32 +00:00
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-27 00:47 UTC · original

AMD run (listed as untested), with an RTX 3060 in the same PC: the revert changes nothing else in the gpu:: suite on either card. (#2929 has a byte-identical diff, so this covers it too.)

Tested: pass, head 4e008ce applied on main 8b957be, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17, XCL_DIRECT_DXIL unset (the HLSL path, where rla() lives), card picked with XCL_ADAPTER.
cargo test -p xcl --lib -- gpu:: --test-threads=4 --nocapture, main and this PR one after the other on each card:

  • AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010: main 708 passed, 2 failed, 6 SKIPPED; this PR 705 passed, 2 failed, 6 SKIPPED. The 2 failures are fuzz_validate_and_gpu_1 and _3 (#2115), the same on main.
  • NVIDIA RTX 3060, driver 32.0.16.1088: main 710 passed, 0 failed, 24 SKIPPED; this PR 707 passed, 0 failed, 24 SKIPPED.

On both cards the only differences are the three #2247 tests the revert removes (rla_pixel_helper_avoids_runtime_vector_indexing_and_branches, rla_pixel_shader_compiles_without_local_arrays, gpu_rla_pixel_shader_matches_reference_including_helper_lanes), which pass on main. The SKIPPED sets are the same.

This only says the revert breaks no other unit or GPU test here. It doesn't touch the Blackwell world-load removal the PR is about; I have no RTX 50 card.

Not tested: a title run, an RTX 50 / Blackwell card, Windows 10, release, Intel.

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

**@⁠DarkPanda69** on GitHub · 2026-11-27 00:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/2930#issuecomment-7206757770) AMD run (listed as untested), with an RTX 3060 in the same PC: the revert changes nothing else in the `gpu::` suite on either card. (#2929 has a byte-identical diff, so this covers it too.) **Tested:** pass, head `4e008ce` applied on `main` `8b957be`, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17, `XCL_DIRECT_DXIL` unset (the HLSL path, where `rla()` lives), card picked with `XCL_ADAPTER`. `cargo test -p xcl --lib -- gpu:: --test-threads=4 --nocapture`, `main` and this PR one after the other on each card: - AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010: `main` 708 passed, 2 failed, 6 SKIPPED; this PR 705 passed, 2 failed, 6 SKIPPED. The 2 failures are `fuzz_validate_and_gpu_1` and `_3` (#2115), the same on `main`. - NVIDIA RTX 3060, driver 32.0.16.1088: `main` 710 passed, 0 failed, 24 SKIPPED; this PR 707 passed, 0 failed, 24 SKIPPED. On both cards the only differences are the three #2247 tests the revert removes (`rla_pixel_helper_avoids_runtime_vector_indexing_and_branches`, `rla_pixel_shader_compiles_without_local_arrays`, `gpu_rla_pixel_shader_matches_reference_including_helper_lanes`), which pass on `main`. The SKIPPED sets are the same. This only says the revert breaks no other unit or GPU test here. It doesn't touch the Blackwell world-load removal the PR is about; I have no RTX 50 card. **Not tested:** a title run, an RTX 50 / Blackwell card, Windows 10, release, Intel. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠SergeAx on GitHub · 2026-11-27 00:48 UTC · original

Closing as a duplicate of #2929, which reverts the same commit with the same diff and was opened 3 minutes earlier. I'll post the RTX 5080 world-load runs there.

**@⁠SergeAx** on GitHub · 2026-11-27 00:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/2930#issuecomment-7206762856) Closing as a duplicate of #2929, which reverts the same commit with the same diff and was opened 3 minutes earlier. I'll post the RTX 5080 world-load runs there.

Pull request closed

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