Recompiler: the rerouted shader cache checks fresh DXIL and chain pieces #2535

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

@⁠xpatfussy69x on GitHub · 2026-11-25 21:54 UTC · original
xpatfussy69x:recompiler/rerouted-cache-validation → main · +46 −1 · 1 files · 1 commits · open

Part of #2463 (item 3; items 1 and 2 are not in this change). cached_in refuses freshly translated DXIL that is not a container, but cached_rerouted, the path of compute programs too big for the HLSL path (pso::enormous), handed it on and wrote it to disk. store_in checked only the main DXIL, so a split program with a bad dispatch-chain piece was written although load_in always refuses it. Both now use valid_containers, which checks the DXIL and every piece, as load_in does.

Item 3's other half (direct_output() without compact_nest_tag()) is already fixed on main: direct_output_identity takes the nest tag.

What is in it

  • crates/xcl/src/gpu/recomp/pso.rs: translated::valid_containers; store_in and cached_rerouted's fresh output use it (the latter returns the same error cached_in gives)
  • crates/xcl/src/gpu/recomp/pso.rs: rerouted_cache_validates_fresh_dxil_and_chain_pieces: invalid fresh DXIL and a split program with one bad piece are both refused by cached_rerouted and nothing reaches the disk; store_in skips the bad split program and writes a valid one. Fails without the fix (invalid fresh DXIL comes back Ok)

Tested

  • NVIDIA GeForce RTX 3060 (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0, debug build for the tests, release for the smoke runs
  • cargo test --workspace -- --test-threads=4: 1424 passed, 0 failed, 46 ignored
  • SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (on main too; #2182 removes them)
  • cargo test -p xcl --lib gpu::recomp::pso: 25 passed, 0 failed, 1 ignored

Regression run

main:

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1130 (PresentX 1130)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14808 MB

PR:

xcl-smoke v1
commit: 1e4a2c787a074b1aa541465bc709801d45babb18
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1088 (PresentX 1088)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14811 MB

Not tested

  • Whether the title sends a shader down the rerouted path in this run: a regression check only
  • The main run is on 6d12f58, this branch's base is e1d84b7 (both commits of main)
  • AMD / native wave64

AI use

  • Claude Code, Claude Opus 5.5: wrote the fix, the test and this description, ran the tests and the PR's smoke run on the hardware above (the main run is from earlier today on the same machine and title)
**@⁠xpatfussy69x** on GitHub · 2026-11-25 21:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/2535) `xpatfussy69x:recompiler/rerouted-cache-validation` → `main` · +46 −1 · 1 files · 1 commits · open Part of #2463 (item 3; items 1 and 2 are not in this change). `cached_in` refuses freshly translated DXIL that is not a container, but `cached_rerouted`, the path of compute programs too big for the HLSL path (`pso::enormous`), handed it on and wrote it to disk. `store_in` checked only the main DXIL, so a split program with a bad dispatch-chain piece was written although `load_in` always refuses it. Both now use `valid_containers`, which checks the DXIL and every piece, as `load_in` does. Item 3's other half (`direct_output()` without `compact_nest_tag()`) is already fixed on `main`: `direct_output_identity` takes the nest tag. **What is in it** - `crates/xcl/src/gpu/recomp/pso.rs`: `translated::valid_containers`; `store_in` and `cached_rerouted`'s fresh output use it (the latter returns the same error `cached_in` gives) - `crates/xcl/src/gpu/recomp/pso.rs`: `rerouted_cache_validates_fresh_dxil_and_chain_pieces`: invalid fresh DXIL and a split program with one bad piece are both refused by `cached_rerouted` and nothing reaches the disk; `store_in` skips the bad split program and writes a valid one. Fails without the fix (invalid fresh DXIL comes back `Ok`) **Tested** - NVIDIA GeForce RTX 3060 (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0, debug build for the tests, release for the smoke runs - `cargo test --workspace -- --test-threads=4`: 1424 passed, 0 failed, 46 ignored - SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused `V_MUL_F16` / `V_PK_MUL_F16` / `V_CVT_F16_F32` (on `main` too; #2182 removes them) - `cargo test -p xcl --lib gpu::recomp::pso`: 25 passed, 0 failed, 1 ignored **Regression run** main: ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1130 (PresentX 1130) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14808 MB ``` PR: ``` xcl-smoke v1 commit: 1e4a2c787a074b1aa541465bc709801d45babb18 gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1088 (PresentX 1088) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14811 MB ``` **Not tested** - Whether the title sends a shader down the rerouted path in this run: a regression check only - The main run is on `6d12f58`, this branch's base is `e1d84b7` (both commits of `main`) - AMD / native wave64 **AI use** - Claude Code, Claude Opus 5.5: wrote the fix, the test and this description, ran the tests and the PR's smoke run on the hardware above (the main run is from earlier today on the same machine and title)
cached_in refuses freshly translated DXIL that is not a container, but
cached_rerouted (the path of compute programs too big for the HLSL path,
#2463 item 3) handed it on and wrote it. store_in checked only the main
DXIL, so a split program with a bad piece was written although load_in
always refuses it.

valid_containers checks the DXIL and every dispatch-chain piece, as
load_in does; store_in and cached_rerouted's fresh output use it. The
issue's other half (direct_output without compact_nest_tag) is already
fixed on main.

Test: invalid fresh DXIL and a split program with one bad piece are both
refused by cached_rerouted and nothing reaches the disk; store_in skips
the bad split program and writes a valid one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:33:11 +00:00
Author
Owner

@⁠emirduran707 on GitHub · 2026-11-25 22:10 UTC · original

Independent AMD RDNA4 (native wave64) test report on exact head 1e4a2c787a074b1aa541465bc709801d45babb18 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1422 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • The PR's test passed: gpu::recomp::pso::shader_cache_tests::rerouted_cache_validates_fresh_dxil_and_chain_pieces.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 1e4a2c787a074b1aa541465bc709801d45babb18
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1609 (PresentX 1609)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13931 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
**@⁠emirduran707** on GitHub · 2026-11-25 22:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2535#issuecomment-7176025326) Independent AMD RDNA4 (native wave64) test report on exact head `1e4a2c787a074b1aa541465bc709801d45babb18` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1422 passed, 2 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - The PR's test passed: `gpu::recomp::pso::shader_cache_tests::rerouted_cache_validates_fresh_dxil_and_chain_pieces`. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 1e4a2c787a074b1aa541465bc709801d45babb18 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1609 (PresentX 1609) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13931 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 22:17 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 22:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2535#issuecomment-7176183649) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 23:07 UTC · original

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of rerouted_cache_validates_fresh_dxil_and_chain_pieces: passed.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-25 23:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/2535#issuecomment-7177183953) **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of `rerouted_cache_validates_fresh_dxil_and_chain_pieces`: passed. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
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/2535/head:github-bot/gh-2535'
git switch 'github-bot/gh-2535'

Merge

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