D3D12.X: the driver's blob of a slow graphics pipeline is kept on disk #896

Closed
mastrr9 wants to merge 1 commit from upstream-pr/902 into main
mastrr9 commented 2026-11-24 08:00:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T08:00:07Z.


Extends XCL's on-disk driver PSO blob cache (crates/xcl/src/hle/d3d12x/real.rs) to slow translated graphics pipelines (previously only compute pipeline blobs were persisted on disk):

  • translated_graphics_pso loads any matching cached driver blob via CachedPSO and persists blobs for graphics compiles taking >= 250 ms (keyed on all shader stage bytes, root signature / static samplers, fixed-function state, input layout, formats, sample desc, node mask, and flags; stream-output pipelines skipped).
  • Automatically deletes and recompiles corrupt or driver-incompatible cached blobs; controllable via XCL_PSO_DISK_CACHE=0.
  • Eliminates 10–17 s repeat-run driver compiles for large translated graphics pipelines on NVIDIA GPUs.

Tested

  • Hardware/OS: NVIDIA RTX 5080 (driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC debug, DXC Windows SDK 10.0.26100.0, d3d12SDKLayers.dll installed
  • Commit tested: 433d7eed0acb34123d480c13754d11aca224b041 (HEAD 8427cedf280d2cfd006897811421729a4f60f11f has an identical tree; only commit author metadata was updated after GitHub account rename)
  • cargo build --workspace: clean (no new warnings; only pre-existing fetch_update deprecation warning)
  • cargo test --workspace -- --test-threads=4: 717 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

Not tested

  • Retail title regression run (scripts/smoke.ps1) not yet run (no retail title available in this clean-room environment); opened as Draft pending a smoke run.

AI use

  • Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5).
<!-- greyfinch-sync:ivall/xcl:issue:5468331453 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/902). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T08:00:07Z. --- Extends XCL's on-disk driver PSO blob cache (`crates/xcl/src/hle/d3d12x/real.rs`) to slow translated graphics pipelines (previously only compute pipeline blobs were persisted on disk): - `translated_graphics_pso` loads any matching cached driver blob via `CachedPSO` and persists blobs for graphics compiles taking `>= 250 ms` (keyed on all shader stage bytes, root signature / static samplers, fixed-function state, input layout, formats, sample desc, node mask, and flags; stream-output pipelines skipped). - Automatically deletes and recompiles corrupt or driver-incompatible cached blobs; controllable via `XCL_PSO_DISK_CACHE=0`. - Eliminates 10–17 s repeat-run driver compiles for large translated graphics pipelines on NVIDIA GPUs. **Tested** - Hardware/OS: NVIDIA RTX 5080 (driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC debug, DXC Windows SDK `10.0.26100.0`, `d3d12SDKLayers.dll` installed - Commit tested: `433d7eed0acb34123d480c13754d11aca224b041` (HEAD `8427cedf280d2cfd006897811421729a4f60f11f` has an identical tree; only commit author metadata was updated after GitHub account rename) - `cargo build --workspace`: clean (no new warnings; only pre-existing `fetch_update` deprecation warning) - `cargo test --workspace -- --test-threads=4`: **717 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` **Not tested** - Retail title regression run (`scripts/smoke.ps1`) not yet run (no retail title available in this clean-room environment); opened as Draft pending a smoke run. **AI use** - Authored with Claude Code (Claude Opus 5.5); reviewed, audited, and verified on native Windows/RTX 5080 hardware with Antigravity (Gemini 4 Neon + Claude Sonnet 5.5).
dcastell1 commented 2026-11-24 09:07:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T08:27:39Z.


Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean main@beaa245 (713 passed, 0 failed, 41 ignored on this box):

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
715 passed; 0 failed; 41 ignored   (exit 0)

Two more passing tests than main: keeping the driver's blob of a slow graphics pipeline is exercised here; nothing else changes verdict.

Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.

<!-- greyfinch-sync:ivall/xcl:comment:7126161483 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/902#issuecomment-7126161483). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-24T08:27:39Z. --- Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean `main@beaa245` (713 passed, 0 failed, 41 ignored on this box): ``` patch -p1 < this PR # clean, no fuzz cargo test --workspace -- --test-threads=4 715 passed; 0 failed; 41 ignored (exit 0) ``` Two more passing tests than main: keeping the driver's blob of a slow graphics pipeline is exercised here; nothing else changes verdict. Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
SlopTart commented 2026-11-24 10:04:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T09:34:29Z.


Linux / AMD RDNA3 datapoint.

Merged state: head 8427ced onto main 09940bb, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 711 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. driver blob-on-disk tests green.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

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

<!-- greyfinch-sync:ivall/xcl:comment:7127601067 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/902#issuecomment-7127601067). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T09:34:29Z. --- Linux / AMD RDNA3 datapoint. **Merged state:** head `8427ced` onto main `09940bb`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **711 passed, 7 failed, 41 ignored**; failures are the known Wine-lane set from my #42 rows. driver blob-on-disk tests green. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
mastrr9 commented 2026-11-24 15:05:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T14:38:10Z.


Rebased cleanly onto current main (930e8b4, PR head 68b5f98664988827f999648a86c0388245ac9c3f), preserving pub(crate) mod driver_cache and the new staging-file tests from main. Thanks @dcastell1 and @SlopTart for the RTX 5090 and RDNA3 reports!

<!-- greyfinch-sync:ivall/xcl:comment:7134698831 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/902#issuecomment-7134698831). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T14:38:10Z. --- Rebased cleanly onto current `main` (`930e8b4`, PR head `68b5f98664988827f999648a86c0388245ac9c3f`), preserving `pub(crate) mod driver_cache` and the new staging-file tests from `main`. Thanks @dcastell1 and @SlopTart for the RTX 5090 and RDNA3 reports!
mastrr9 commented 2026-11-24 15:06:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T14:54:49Z.


Verified rebased head 68b5f98664988827f999648a86c0388245ac9c3f on Windows 11 / NVIDIA RTX 5080 (cargo test --workspace -- --test-threads=4: 753 passed / 0 failed / 41 ignored, 0 new warnings).

<!-- greyfinch-sync:ivall/xcl:comment:7135152638 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/902#issuecomment-7135152638). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T14:54:49Z. --- Verified rebased head `68b5f98664988827f999648a86c0388245ac9c3f` on Windows 11 / NVIDIA RTX 5080 (`cargo test --workspace -- --test-threads=4`: **753 passed / 0 failed / 41 ignored**, 0 new warnings).
Toons29 commented 2026-11-25 04:10:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:07:55Z.


Regression run of 90d70031 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 90d70031f179d405e8b34aaed20a9dede57c3c5d
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1632 (PresentX 1632)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14815 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7151619942 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/902#issuecomment-7151619942). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:07:55Z. --- Regression run of `90d70031` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 90d70031f179d405e8b34aaed20a9dede57c3c5d gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1632 (PresentX 1632) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14815 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
JJAutoCompare commented 2026-11-25 06:05:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:50:40Z.


Empirical test report (90d70031)

Verified commit 90d70031f179d405e8b34aaed20a9dede57c3c5d for xcl-dev/xcl PR #902.

Hardware / environment

  • Windows x64, kernel 10.0.26200.0. Host CPU identifier AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD.
  • Rust 1.100.0 (0ef1bc386 2026-11-09) and DXC 1.9.2609.5 (01b62ad47). Unoptimized test profile with debug info and incremental compilation disabled.
  • Both fixtures ran outside Invoke-ArcTest.ps1 with XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1.

Commands and results

  • cargo test --workspace --no-run exited 0 and built the workspace test binaries.
  • cargo test -p xcl --lib hle::d3d12x::real::driver_cache::tests::a_graphics_file_is_named_after_the_shaders_state_layout_and_samplers -- --exact exited 0 with 1 passed.
  • cargo test -p xcl --lib hle::d3d12x::real::driver_cache::tests::a_slow_build_is_made_from_its_kept_blob_the_next_time -- --exact exited 0 with 1 passed.
  • Focused totals from the two libtest summaries and the SKIPPED line count were 2 passed, 0 failed, 0 ignored, and 0 skipped.

Observed behavior

  • The descriptor fixture kept the same cache filename when identical shader bytes moved to a different address. Shader content, static samplers, render-target format, blend state, culling, stencil comparison, and input semantics changed the key. Stream output yielded no cache filename.
  • The disk fixture used simulated driver callbacks. A slow build saved a blob, the next call reused it without recompiling, and a deliberately damaged blob was rejected and replaced. A fast build left no cache file, and a failed build never requested a blob.

Not tested

The full GPU workspace suite and game smoke runs were omitted. Real D3D12 driver CachedPSO acceptance, graphics pipeline timings, and performance across game launches are outside this run's coverage.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr902-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7154192169 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/902#issuecomment-7154192169). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T05:50:40Z. --- ### Empirical test report (90d70031) Verified commit `90d70031f179d405e8b34aaed20a9dede57c3c5d` for xcl-dev/xcl PR #902. **Hardware / environment** - Windows x64, kernel `10.0.26200.0`. Host CPU identifier `AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD`. - Rust `1.100.0 (0ef1bc386 2026-11-09)` and DXC `1.9.2609.5 (01b62ad47)`. Unoptimized test profile with debug info and incremental compilation disabled. - Both fixtures ran outside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`. **Commands and results** - `cargo test --workspace --no-run` exited 0 and built the workspace test binaries. - `cargo test -p xcl --lib hle::d3d12x::real::driver_cache::tests::a_graphics_file_is_named_after_the_shaders_state_layout_and_samplers -- --exact` exited 0 with 1 passed. - `cargo test -p xcl --lib hle::d3d12x::real::driver_cache::tests::a_slow_build_is_made_from_its_kept_blob_the_next_time -- --exact` exited 0 with 1 passed. - Focused totals from the two libtest summaries and the `SKIPPED` line count were 2 passed, 0 failed, 0 ignored, and 0 skipped. **Observed behavior** - The descriptor fixture kept the same cache filename when identical shader bytes moved to a different address. Shader content, static samplers, render-target format, blend state, culling, stencil comparison, and input semantics changed the key. Stream output yielded no cache filename. - The disk fixture used simulated driver callbacks. A slow build saved a blob, the next call reused it without recompiling, and a deliberately damaged blob was rejected and replaced. A fast build left no cache file, and a failed build never requested a blob. **Not tested** The full GPU workspace suite and game smoke runs were omitted. Real D3D12 driver `CachedPSO` acceptance, graphics pipeline timings, and performance across game launches are outside this run's coverage. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr902-focused.log` and published.
DavidM1911 commented 2026-11-25 10:10:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:42:02Z.


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7158683691 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/902#issuecomment-7158683691). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T09:42:02Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Foniass commented 2026-12-01 04:27:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:27:40Z.


Triage (#1607) – head 90d7003

Main already keeps the driver's blob of translated graphics pipelines on disk. Commit 04f34ce6 (#1836) added it, and later commits refined it: driver_cache::graphics_name / graphics_path / graphics_file_hash in real.rs, keyed on the full state, the shader digest, the static samplers, the adapter identity and the memory windows, and used in the translated graphics create. That is the change this PR makes (graphics_name / graphics_path / build).
Recommendation: close (superseded by #1836).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300757351 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/902#issuecomment-7300757351). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:27:40Z. --- **Triage (#1607)** – head 90d7003 Main already keeps the driver's blob of translated graphics pipelines on disk. Commit 04f34ce6 (#1836) added it, and later commits refined it: `driver_cache::graphics_name` / `graphics_path` / `graphics_file_hash` in real.rs, keyed on the full state, the shader digest, the static samplers, the adapter identity and the memory windows, and used in the translated graphics create. That is the change this PR makes (`graphics_name` / `graphics_path` / `build`). Recommendation: close (superseded by #1836). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:41:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:41:00Z.


Closing as superseded: this change is already on main (04f34ce6). main real.rs has driver_cache::graphics_path/graphics_file_hash (04f34ce6) used at the graphics PSO build (real.rs ~8173) keeping slow translated graphics blobs on disk keyed on state/DXIL/samplers/adapter

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311494643 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/902#issuecomment-7311494643). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:41:00Z. --- Closing as superseded: this change is already on `main` (04f34ce6). main real.rs has driver_cache::graphics_path/graphics_file_hash (04f34ce6) used at the graphics PSO build (real.rs ~8173) keeping slow translated graphics blobs on disk keyed on state/DXIL/samplers/adapter Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!896
No description provided.