Skip to content

Recompiler: key rerouted DXIL by compact nesting policy - #2257

Open
ettehn wants to merge 1 commit into
xcl-dev:mainfrom
ettehn:codex/rerouted-compact-nest-cache
Open

ettehn wants to merge 1 commit into
xcl-dev:mainfrom
ettehn:codex/rerouted-compact-nest-cache

Conversation

@ettehn

@ettehn ettehn commented Nov 25, 2026 •

Copy link
Copy Markdown

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.

@itsSio

itsSio commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

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.

@ettehn
ettehn marked this pull request as ready for review November 25, 2026 11:54
@oni-swr

oni-swr commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

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.

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)
@ettehn
ettehn force-pushed the codex/rerouted-compact-nest-cache branch from 75dff2c to f5494de Compare November 25, 2026 14:17
@jennydeth

Copy link
Copy Markdown

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.

@nnonno91

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants