Recompiler: key rerouted DXIL by compact nesting policy #2257

Manually merged
github merged 1 commit from gh-pr/2257/head into gh-pr/2257/base 2026-11-26 05:24:49 +00:00
Owner

@⁠ettehn on GitHub · 2026-11-25 11:39 UTC · original
ettehn:codex/rerouted-compact-nest-cache → main · +67 −12 · 1 files · 1 commits · merged 2026-11-25 18:46 UTC

When XCL automatically reroutes an enormous HLSL compute shader to Direct DXIL (#2120), its translated-cache key omits the compact nesting setting (#2174). A warm cache can return flat-dispatch DXIL after the setting changes to grouped dispatch. Part of #2088.

What is in it

  • Include the existing nesting tag in the automatic reroute cache identity. Ordinary HLSL entries retain their existing identity.
  • Add a regression for separate flat and grouped DXIL entries and reuse of ordinary HLSL across settings.

Tested

  • The rebased release build at f5494de4 was tested with one local compute record above the reroute threshold. Main reused the flat entry with nesting set to four. The patch wrote three separate entries for flat/split, nested/split, and nested/unsplit. A new process reused each entry with no additional writes. On the earlier base afc5ee86, the new process-level synthetic regression failed on unpatched main and passed after the fix, with 21 focused cache tests passing.
  • On the rebased commit, cargo test --offline --locked --release -p xcl --lib shader_cache_tests -- --test-threads=1: 21 passed, 0 failed, 0 ignored.

Earlier validation on 75dff2c:

  • Windows 11, MSVC debug, DXC/DXIL 1.8.2502.11. The synthetic regression reproduced the alias with the original identity. The gpu::recomp::pso::shader_cache_tests group passed on 75dff2c: 21 passed, 0 failed, 0 ignored, using WARP and a fresh writable XCL_DXIL_CACHE.
  • CPU-only A/B on 426a5a7 and clean 75dff2c through console_to_dxil_in, with one local compute record above the HLSL reroute threshold, XCL_DIRECT_DXIL unset and XCL_DIRECT_COMPACT=1. The baseline group-of-four request reused warm flat DXIL (1,291,352 bytes); a cold grouped request generated 1,310,308 bytes. The patch generated both outputs independently and hit the matching entry on each repeat. All returned DXIL passed validation. Details in #2088.
  • Independent full-suite verification by itsSio on the same clean head: RTX 5080 and RTX 2080 SUPER, each 1,244 passed, 0 failed, 46 ignored with cargo test --workspace --locked -j 4 --no-fail-fast -- --test-threads=4 --nocapture. The report lists 25 and 27 runtime skips, respectively, and all 21 focused cache tests ran on each machine without skips.

Regression run

Same retail title, 20 seconds each, separate initially empty XCL data and DXIL caches, networking off, one DXC thread, no scripted input. Scope: startup only.

Main:

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: NVIDIA GeForce RTX 5070 Ti Laptop GPU
title: RetailTitle
seconds: 20
exit: 0x0
frames shown: 93 (PresentX 93)
presents per 2 s (last 3): 0 1 0
device removals: 0
crashes: 0
peak commit: 11476 MB

PR head:

xcl-smoke v1
commit: f5494de4a049a0673af3b58ee9ce564eaedb5224
gpu: NVIDIA GeForce RTX 5070 Ti Laptop GPU
title: RetailTitle
seconds: 20
exit: 0x0
frames shown: 97 (PresentX 97)
presents per 2 s (last 3): 0 0 1
device removals: 0
crashes: 0
peak commit: 11476 MB

Not tested

  • The full hardware workspace suite on the rebased head.
  • AMD hardware, driver pipeline creation for the outlier, and gameplay. The smoke runs cover startup and rendered frames.

AI use
OpenAI Codex (GPT-6.2 Sol) assisted with the change, regression tests, and Windows verification.

**@⁠ettehn** on GitHub · 2026-11-25 11:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2257) `ettehn:codex/rerouted-compact-nest-cache` → `main` · +67 −12 · 1 files · 1 commits · merged 2026-11-25 18:46 UTC When XCL automatically reroutes an enormous HLSL compute shader to Direct DXIL (#2120), its translated-cache key omits the compact nesting setting (#2174). A warm cache can return flat-dispatch DXIL after the setting changes to grouped dispatch. Part of #2088. **What is in it** - Include the existing nesting tag in the automatic reroute cache identity. Ordinary HLSL entries retain their existing identity. - Add a regression for separate flat and grouped DXIL entries and reuse of ordinary HLSL across settings. **Tested** - The rebased release build at `f5494de4` was tested with one local compute record above the reroute threshold. Main reused the flat entry with nesting set to four. The patch wrote three separate entries for flat/split, nested/split, and nested/unsplit. A new process reused each entry with no additional writes. On the earlier base `afc5ee86`, the new process-level synthetic regression failed on unpatched main and passed after the fix, with 21 focused cache tests passing. - On the rebased commit, `cargo test --offline --locked --release -p xcl --lib shader_cache_tests -- --test-threads=1`: 21 passed, 0 failed, 0 ignored. Earlier validation on `75dff2c`: - Windows 11, MSVC debug, DXC/DXIL 1.8.2502.11. The synthetic regression reproduced the alias with the original identity. The `gpu::recomp::pso::shader_cache_tests` group passed on `75dff2c`: 21 passed, 0 failed, 0 ignored, using WARP and a fresh writable `XCL_DXIL_CACHE`. - CPU-only A/B on `426a5a7` and clean `75dff2c` through `console_to_dxil_in`, with one local compute record above the HLSL reroute threshold, `XCL_DIRECT_DXIL` unset and `XCL_DIRECT_COMPACT=1`. The baseline group-of-four request reused warm flat DXIL (1,291,352 bytes); a cold grouped request generated 1,310,308 bytes. The patch generated both outputs independently and hit the matching entry on each repeat. All returned DXIL passed validation. [Details in #2088](https://git.gtahub.st/github/xcl-dev--xcl/issues/2088). - [Independent full-suite verification by itsSio](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2257) on the same clean head: RTX 5080 and RTX 2080 SUPER, each 1,244 passed, 0 failed, 46 ignored with `cargo test --workspace --locked -j 4 --no-fail-fast -- --test-threads=4 --nocapture`. The report lists 25 and 27 runtime skips, respectively, and all 21 focused cache tests ran on each machine without skips. **Regression run** Same retail title, 20 seconds each, separate initially empty XCL data and DXIL caches, networking off, one DXC thread, no scripted input. Scope: startup only. Main: ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: NVIDIA GeForce RTX 5070 Ti Laptop GPU title: RetailTitle seconds: 20 exit: 0x0 frames shown: 93 (PresentX 93) presents per 2 s (last 3): 0 1 0 device removals: 0 crashes: 0 peak commit: 11476 MB ``` PR head: ``` xcl-smoke v1 commit: f5494de4a049a0673af3b58ee9ce564eaedb5224 gpu: NVIDIA GeForce RTX 5070 Ti Laptop GPU title: RetailTitle seconds: 20 exit: 0x0 frames shown: 97 (PresentX 97) presents per 2 s (last 3): 0 0 1 device removals: 0 crashes: 0 peak commit: 11476 MB ``` **Not tested** - The full hardware workspace suite on the rebased head. - AMD hardware, driver pipeline creation for the outlier, and gameplay. The smoke runs cover startup and rendered frames. **AI use** OpenAI Codex (GPT-6.2 Sol) assisted with the change, regression tests, and Windows verification.
Automatic Direct DXIL reroutes previously shared a translated-cache identity across explicit nesting policies. Include the nesting tag in the rerouted identity and cover separate hits while preserving the HLSL namespace.

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:24:47 +00:00
github manually merged commit f5494de4a0 into gh-pr/2257/base 2026-11-26 05:24:49 +00:00
Author
Owner

@⁠itsSio on GitHub · 2026-11-25 11:52 UTC · original

Tested

Independent Windows hardware runs on clean head 75dff2c9485617dd992fc2915d674f3b5b898b2f. Both: Windows 11 Pro build 26200, NVIDIA 610.88, debug MSVC, explicit NVIDIA adapter and fresh writable XCL DXIL cache.

  • RTX 5080 16 GB, Ryzen 7 9800X3D, 32 GiB, Rust 1.97.0, DXC 1.9.2609.5.
  • RTX 2080 SUPER 8 GB, Ryzen 5 5600X, 16 GiB, Rust 1.99.1, DXC 1.8.2502.11.

On both machines cargo build --workspace --locked -j 4 passed; cargo test -p xcl --lib --locked -j 4 gpu::recomp::pso::shader_cache_tests -- --test-threads=1 --nocapture was 21 passed, 0 failed, 0 ignored, 0 runtime skips, including rerouted_disk_entries_follow_compact_nesting_policy.

cargo test --workspace --locked -j 4 --no-fail-fast -- --test-threads=4 --nocapture reported 1244 passed, 0 failed, 46 ignored on each. RTX 5080: 25 runtime skips (20 no native wave64, three unsupported per-lane cases, no heap windows, cache-disable unavailable). RTX 2080 SUPER: 27 runtime skips (same plus two missing D3D12 debug-layer cases).

Not tested: Retail smoke, the original large record, or driver compile time for the rerouted shader. The focused cache test verifies distinct reroute entries and ordinary HLSL reuse; it is not a hardware timing test.

AI use

Ran via Samaritan:

  • OpenCode (GPT-6.2 Sol): planned, ran, and audited the two Windows runs and drafted the report.
**@⁠itsSio** on GitHub · 2026-11-25 11:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/2257#issuecomment-7161622277) **Tested** Independent Windows hardware runs on clean head `75dff2c9485617dd992fc2915d674f3b5b898b2f`. Both: Windows 11 Pro build 26200, NVIDIA 610.88, debug MSVC, explicit NVIDIA adapter and fresh writable XCL DXIL cache. - RTX 5080 16 GB, Ryzen 7 9800X3D, 32 GiB, Rust 1.97.0, DXC 1.9.2609.5. - RTX 2080 SUPER 8 GB, Ryzen 5 5600X, 16 GiB, Rust 1.99.1, DXC 1.8.2502.11. On both machines `cargo build --workspace --locked -j 4` passed; `cargo test -p xcl --lib --locked -j 4 gpu::recomp::pso::shader_cache_tests -- --test-threads=1 --nocapture` was **21 passed, 0 failed, 0 ignored, 0 runtime skips**, including `rerouted_disk_entries_follow_compact_nesting_policy`. `cargo test --workspace --locked -j 4 --no-fail-fast -- --test-threads=4 --nocapture` reported **1244 passed, 0 failed, 46 ignored** on each. RTX 5080: **25 runtime skips** (20 no native wave64, three unsupported per-lane cases, no heap windows, cache-disable unavailable). RTX 2080 SUPER: **27 runtime skips** (same plus two missing D3D12 debug-layer cases). **Not tested:** Retail smoke, the original large record, or driver compile time for the rerouted shader. The focused cache test verifies distinct reroute entries and ordinary HLSL reuse; it is not a hardware timing test. **AI use** Ran via Samaritan: - OpenCode (GPT-6.2 Sol): planned, ran, and audited the two Windows runs and drafted the report.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 12:58 UTC · original

Test report: AMD Radeon RX 7800 XT (RDNA3, native wave64) for head 75dff2c9485617dd992fc2915d674f3b5b898b2f.

Setup: RX 7800 XT, driver 32.0.31035.1003, Windows 11 Pro 10.0.26200, rustc/cargo 1.100.0, debug build, DXC 1.9.0.5512 (dxc on PATH). Detached checkout of the PR head, which does not include ea088a5. I did not merge it with current main. I read the diff (pso.rs only) before running it.

Targeted (cargo test -p xcl --lib -- rerouted_disk_entries_follow_compact_nesting_policy --nocapture --test-threads=1): 1 passed, 0 failed, 0 ignored. This is a CPU-side cache-identity test, so the GPU is not involved.

Full suite (cargo test --workspace --no-fail-fast -- --test-threads=4): 1242 passed, 2 failed, 46 ignored.

  • Failures, both in the lib:
    • gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: the known RDNA3 failure on main.
    • gpu::recomp::tests::gpu_image_get_resinfo_past_last_level: this PR's base predates ea088a5, which fixes it. The PR does not touch image code.
  • 7 SKIPPED lines: 6 in lower_dxil::tests (f16 / f32 conversion programs refused) and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows). These are not coverage.

Not tested: retail title or scripts/smoke.ps1 (this is a runtime change, so the on-disk cache behaviour with a real title is unchecked), NVIDIA, Intel, Wine/vkd3d, this PR merged with current main.

AI use: this report was run and written by Claude Code (Claude Sonnet 5.5). I read the diff but did not change any code.

**@⁠oni-swr** on GitHub · 2026-11-25 12:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/2257#issuecomment-7163120646) **Test report: AMD Radeon RX 7800 XT (RDNA3, native wave64)** for head `75dff2c9485617dd992fc2915d674f3b5b898b2f`. **Setup:** RX 7800 XT, driver 32.0.31035.1003, Windows 11 Pro 10.0.26200, rustc/cargo 1.100.0, debug build, DXC 1.9.0.5512 (`dxc` on PATH). Detached checkout of the PR head, which does not include `ea088a5`. I did not merge it with current `main`. I read the diff (`pso.rs` only) before running it. **Targeted** (`cargo test -p xcl --lib -- rerouted_disk_entries_follow_compact_nesting_policy --nocapture --test-threads=1`): **1 passed, 0 failed, 0 ignored.** This is a CPU-side cache-identity test, so the GPU is not involved. **Full suite** (`cargo test --workspace --no-fail-fast -- --test-threads=4`): **1242 passed, 2 failed, 46 ignored.** - Failures, both in the lib: - `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: the known RDNA3 failure on `main`. - `gpu::recomp::tests::gpu_image_get_resinfo_past_last_level`: this PR's base predates `ea088a5`, which fixes it. The PR does not touch image code. - 7 `SKIPPED` lines: 6 in `lower_dxil::tests` (f16 / f32 conversion programs refused) and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). These are not coverage. **Not tested:** retail title or `scripts/smoke.ps1` (this is a runtime change, so the on-disk cache behaviour with a real title is unchecked), NVIDIA, Intel, Wine/vkd3d, this PR merged with current `main`. **AI use:** this report was run and written by Claude Code (Claude Sonnet 5.5). I read the diff but did not change any code.
Author
Owner

@⁠jennydeth on GitHub · 2026-11-25 14:32 UTC · original

NVIDIA run.

Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head f5494de.

Result: cargo test --workspace -- --test-threads=4: 1266 passed, 0 failed, 46 ignored. SKIPPED: 19 GPU tests for no wave64 (expected on this card) and the usual per-lane / heap-window / driver-cache skips.

Not tested: native wave64; a title run.

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

**@⁠jennydeth** on GitHub · 2026-11-25 14:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2257#issuecomment-7165442645) NVIDIA run. Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head f5494de. Result: cargo test --workspace -- --test-threads=4: 1266 passed, 0 failed, 46 ignored. SKIPPED: 19 GPU tests for no wave64 (expected on this card) and the usual per-lane / heap-window / driver-cache skips. Not tested: native wave64; a title run. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-25 15:21 UTC · original

Independent Windows check of f5494de4a049a0673af3b58ee9ce564eaedb5224. Rerouted cache entries stayed separate for distinct nesting settings and were reused for equivalent settings. Ordinary HLSL kept reusing the same entry.

Tested

  • Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, Rust 1.100.0 x64 MSVC, unoptimized test profile. These are synthetic cache checks without GPU execution.
  • Clean head, cargo test --locked -p xcl --lib shader_cache_tests -- --nocapture --test-threads=1: 21 passed, 0 failed, 0 ignored, and no logged skips.
  • Added nine child-process cases temporarily to the existing disk-cache fixture. cargo test --locked -p xcl --lib rerouted_disk_entries_follow_compact_nesting_policy -- --nocapture --test-threads=1 reported 1 passed, 0 failed, 0 ignored, and no logged skips. Groups of 2 and 65,536 got separate entries. 02 reused the group-of-2 entry, and whitespace/case variations plus invalid sizes 3 and 65,537 reused the matching flat or auto entries. The fixture checked ordinary HLSL reuse throughout. Restored the clean worktree afterward.

Not tested

Parent revision, a real oversized shader or GPU pipeline creation, retail titles, or the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) prepared and ran the tests, verified the results, and wrote this report.

**@⁠nnonno91** on GitHub · 2026-11-25 15:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/2257#issuecomment-7166720611) Independent Windows check of `f5494de4a049a0673af3b58ee9ce564eaedb5224`. Rerouted cache entries stayed separate for distinct nesting settings and were reused for equivalent settings. Ordinary HLSL kept reusing the same entry. **Tested** - Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, Rust 1.100.0 x64 MSVC, unoptimized test profile. These are synthetic cache checks without GPU execution. - Clean head, `cargo test --locked -p xcl --lib shader_cache_tests -- --nocapture --test-threads=1`: 21 passed, 0 failed, 0 ignored, and no logged skips. - Added nine child-process cases temporarily to the existing disk-cache fixture. `cargo test --locked -p xcl --lib rerouted_disk_entries_follow_compact_nesting_policy -- --nocapture --test-threads=1` reported 1 passed, 0 failed, 0 ignored, and no logged skips. Groups of 2 and 65,536 got separate entries. `02` reused the group-of-2 entry, and whitespace/case variations plus invalid sizes 3 and 65,537 reused the matching flat or auto entries. The fixture checked ordinary HLSL reuse throughout. Restored the clean worktree afterward. **Not tested** Parent revision, a real oversized shader or GPU pipeline creation, retail titles, or the full workspace suite. **AI use** OpenAI Codex (GPT-6.2 Sol) prepared and ran the tests, verified the results, and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 16:53 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 16:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2257#issuecomment-7168687273) 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

@⁠raylitebull on GitHub · 2026-11-25 18:40 UTC · original

Diff review (f5494de) and green CI look clean, with exact-head NVIDIA verification in place. Holding merge solely for an exact-head f5494de AMD test report (the earlier RX 7800 XT run was on pre-rebase 75dff2c).

**@⁠raylitebull** on GitHub · 2026-11-25 18:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2257#issuecomment-7171245561) Diff review (`f5494de`) and green CI look clean, with exact-head NVIDIA verification in place. Holding merge solely for an exact-head `f5494de` AMD test report (the earlier RX 7800 XT run was on pre-rebase `75dff2c`).
Author
Owner

@⁠ivall on GitHub · 2026-11-25 18:46 UTC · original

Merging at f5494de: the rerouted cache identity now carries the nesting tag and the split limit, and plain HLSL entries keep theirs. The new test passes here.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, on main 3f27770 with #2420, #2257, #2408, #2247, #2338, #2097 and #2372 merged locally: cargo test --workspace --no-fail-fast -- --test-threads=4: 1367 passed, 2 failed, 46 ignored, 7 SKIPPED lines. main alone, same command: 1354 passed, 3 failed, 46 ignored. Both failures left (fuzz_validate_and_gpu_1 seed 722, _3 seed 1599) fail the same way on main. No title was run on the merged tree.

AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests and wrote this on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 18:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2257#issuecomment-7171385322) Merging at `f5494de`: the rerouted cache identity now carries the nesting tag and the split limit, and plain HLSL entries keep theirs. The new test passes here. Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, on `main` `3f27770` with #2420, #2257, #2408, #2247, #2338, #2097 and #2372 merged locally: `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1367 passed, 2 failed, 46 ignored, 7 SKIPPED lines. `main` alone, same command: 1354 passed, 3 failed, 46 ignored. Both failures left (`fuzz_validate_and_gpu_1` seed 722, `_3` seed 1599) fail the same way on `main`. No title was run on the merged tree. AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests and wrote this on the maintainer's behalf.
This discussion has been locked. Commenting is limited to contributors.
No description provided.