D3D12.X: persist slow driver blobs past the RAM cache cap (#1833) #2574

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

@⁠razormontana on GitHub · 2026-11-25 23:19 UTC · original
razormontana:d3d12x/persist-driver-blobs-past-ram-cap → main · +73 −40 · 2 files · 1 commits · open

Part of #1833. A slow translated pipeline could fail to leave a driver blob for the next run when XCL's in-memory blob cache was full. Save eligible blobs to disk independently of RAM admission so later sessions can reuse them.

What is in it

  • real.rs uses one captured blob for the RAM and disk paths covering translated compute, translated graphics and the compute pass of two-pass pipelines. It still uses the existing keys, memory limits, minimum DXIL size and disk-write eligibility. README.md documents that disk saves can continue when the RAM budget is full.
  • A synthetic test fills a small cache, verifies that its retained entries stay within budget, and reads the later blob from the disk path. A second test checks the existing size and time thresholds and empty or unreadable blobs.
  • #826 handles a separate duplicate RAM charge in the same cache code. #2515 changes offline and runtime cache key identity, and #2426 handles which driver failures invalidate cached blobs.

Tested

  • Windows 11 Pro (22631.5335), Core i7-10700K, NVIDIA GeForce RTX 3070 8 GB (driver 617.42), Rust 1.100.0 MSVC. Debug workspace tests, release retail smoke.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output on e2aae0e reported 1425 passes, 0 failures, and 46 ignored. There were 26 explicit runner skips within the pass count.
  • cargo test --offline --locked -p xcl --lib hle::d3d12x::real::driver_cache::tests:: -- --nocapture --test-threads=1 passed all six focused tests with no skips. With the previous admission rule, the saturated-cache test found no file after dropping the RAM map. The new rule recovered the late blob while keeping the first blob within the RAM cap.
  • cargo build --offline --locked --release -p xcl succeeded. scripts/smoke.ps1 ran the same title offline for 60 seconds per arm with direct DXIL and matching cache seeds.

Regression run

Main

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 3070
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 493 (PresentX 493)
presents per 2 s (last 3): 12 13 8
device removals: 0
crashes: 0
peak commit: 15495 MB

PR head

xcl-smoke v1
commit: e2aae0e87df1499ddc393bec6b7b3d39adb24006
gpu: NVIDIA GeForce RTX 3070
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 542 (PresentX 542)
presents per 2 s (last 3): 18 3 1
device removals: 0
crashes: 0
peak commit: 14457 MB

Not tested

  • Retail cache saturation and cold-compilation time. The isolated test controls the cache size and timing inputs. Other GPU vendors remain unmeasured.

AI use

Yes, Codex GPT-6.2 Astra implemented the change and ran the focused tests. Codex GPT-6.2 Sol reviewed the patch, ran workspace and retail checks, and prepared this description.

**@⁠razormontana** on GitHub · 2026-11-25 23:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/2574) `razormontana:d3d12x/persist-driver-blobs-past-ram-cap` → `main` · +73 −40 · 2 files · 1 commits · open Part of #1833. A slow translated pipeline could fail to leave a driver blob for the next run when XCL's in-memory blob cache was full. Save eligible blobs to disk independently of RAM admission so later sessions can reuse them. **What is in it** - `real.rs` uses one captured blob for the RAM and disk paths covering translated compute, translated graphics and the compute pass of two-pass pipelines. It still uses the existing keys, memory limits, minimum DXIL size and disk-write eligibility. `README.md` documents that disk saves can continue when the RAM budget is full. - A synthetic test fills a small cache, verifies that its retained entries stay within budget, and reads the later blob from the disk path. A second test checks the existing size and time thresholds and empty or unreadable blobs. - #826 handles a separate duplicate RAM charge in the same cache code. #2515 changes offline and runtime cache key identity, and #2426 handles which driver failures invalidate cached blobs. **Tested** - Windows 11 Pro (22631.5335), Core i7-10700K, NVIDIA GeForce RTX 3070 8 GB (driver 617.42), Rust 1.100.0 MSVC. Debug workspace tests, release retail smoke. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output` on `e2aae0e` reported 1425 passes, 0 failures, and 46 ignored. There were 26 explicit runner skips within the pass count. - `cargo test --offline --locked -p xcl --lib hle::d3d12x::real::driver_cache::tests:: -- --nocapture --test-threads=1` passed all six focused tests with no skips. With the previous admission rule, the saturated-cache test found no file after dropping the RAM map. The new rule recovered the late blob while keeping the first blob within the RAM cap. - `cargo build --offline --locked --release -p xcl` succeeded. `scripts/smoke.ps1` ran the same title offline for 60 seconds per arm with direct DXIL and matching cache seeds. **Regression run** Main ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 3070 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 493 (PresentX 493) presents per 2 s (last 3): 12 13 8 device removals: 0 crashes: 0 peak commit: 15495 MB ``` PR head ``` xcl-smoke v1 commit: e2aae0e87df1499ddc393bec6b7b3d39adb24006 gpu: NVIDIA GeForce RTX 3070 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 542 (PresentX 542) presents per 2 s (last 3): 18 3 1 device removals: 0 crashes: 0 peak commit: 14457 MB ``` **Not tested** - Retail cache saturation and cold-compilation time. The isolated test controls the cache size and timing inputs. Other GPU vendors remain unmeasured. **AI use** Yes, Codex GPT-6.2 Astra implemented the change and ran the focused tests. Codex GPT-6.2 Sol reviewed the patch, ran workspace and retail checks, and prepared this description.
Save an eligible driver blob even when the bounded in-memory cache
cannot retain it. The RAM caps, disk identities and eligibility stay.

The saturated-cache fixture recovers the late blob from disk after
dropping the in-memory cache.

Assisted-by: Codex (GPT-6.2 Astra)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:10 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 23:45 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.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-25 23:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2574#issuecomment-7178008001) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 26 ignored. Thanks! — Devin
Author
Owner

@⁠xpatfussy69x on GitHub · 2026-11-26 00:01 UTC · original

Test run on exact head e2aae0e (e2aae0e87df1499ddc393bec6b7b3d39adb24006, on its base e1d84b7), clean tree.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (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: 1425 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)
  • cargo test -p xcl --lib a_slow_pipeline_is_saved: 1 passed, 0 failed
  • This PR's new tests in the workspace run:
    • a_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills: ok
    • storing_a_pipeline_still_observes_the_size_and_time_thresholds: ok

Regression run (60 s, default settings, a retail title)

main:

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

this PR:

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

No crash or device removal; frames 101 % of main's, peak commit 100 %. The main run is on current main (08db802), newer than this PR's base.

Not tested

  • Whether the RAM cache cap was reached in this 60 s run, and the second-run startup time: a regression check only
  • The PR merged into current main (tested on its own base; it merges into 08db802 without conflicts)
  • AMD / native wave64

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
**@⁠xpatfussy69x** on GitHub · 2026-11-26 00:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2574#issuecomment-7178319804) Test run on exact head `e2aae0e` (`e2aae0e87df1499ddc393bec6b7b3d39adb24006`, on its base `e1d84b7`), clean tree. **Tested** - NVIDIA GeForce RTX 3060 12 GB (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`: 1425 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) - `cargo test -p xcl --lib a_slow_pipeline_is_saved`: 1 passed, 0 failed - This PR's new tests in the workspace run: - `a_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills`: ok - `storing_a_pipeline_still_observes_the_size_and_time_thresholds`: ok **Regression run** (60 s, default settings, a retail title) main: ``` xcl-smoke v1 commit: 08db8020d323bf478964fcc586152cce54959cfc gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1571 (PresentX 1571) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14042 MB ``` this PR: ``` xcl-smoke v1 commit: e2aae0e87df1499ddc393bec6b7b3d39adb24006 gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1582 (PresentX 1582) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14012 MB ``` No crash or device removal; frames 101 % of `main`'s, peak commit 100 %. The `main` run is on current `main` (`08db802`), newer than this PR's base. **Not tested** - Whether the RAM cache cap was reached in this 60 s run, and the second-run startup time: a regression check only - The PR merged into current `main` (tested on its own base; it merges into `08db802` without conflicts) - AMD / native wave64 **AI use** - Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
Author
Owner

@⁠ramon-victor on GitHub · 2026-11-26 00:05 UTC · original

Independent NVIDIA (wave32) full-suite + retail smoke test report on exact PR head e2aae0e87df1499ddc393bec6b7b3d39adb24006 (clean detached checkout, no local changes).

Tested

  • Hardware & toolchain: NVIDIA GeForce RTX 3070 8 GiB (wave32, driver 621.24), AMD Ryzen 7 5700X, 32 GiB RAM, Windows 11 Pro (build 26300), Rust 1.99.0 (x86_64-pc-windows-msvc), DXC/DXIL 1.8.2502.11 (Windows SDK 10.0.26100.0); debug tests, release smoke.
  • Targeted PR tests (cargo test -p xcl --lib driver_cache::tests): 6 passed, 0 failed (including the 2 new tests a_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills and storing_a_pipeline_still_observes_the_size_and_time_thresholds).
  • Full workspace (.\scripts\test.ps1): 1425 passed, 0 failed, 46 ignored (25 GPU skips expected on this wave32 adapter: 21 no wave64, 1 no heap windows, 3 wave32 per-lane refused for #1426 f16/f32 semantics).
  • Release build (cargo build --release -p xcl) and 60 s retail smoke run (XCL_NETWORK=0, compared against main @ 08db802 baseline on the same machine today: 1605 frames, 15009 MB peak commit, 0 crashes, 0 device removals):

Regression run

xcl-smoke v1
commit: e2aae0e87df1499ddc393bec6b7b3d39adb24006
gpu: NVIDIA GeForce RTX 3070
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1624 (PresentX 1625)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14972 MB

Not tested

  • AMD / Intel GPUs and wave64-only GPU tests (skipped on RTX 3070); XCL_SAMPLE_* tests (unset).

AI use

  • Antigravity (Gemini 4 Neon) ran the build, test suite, and smoke run and drafted this report.
**@⁠ramon-victor** on GitHub · 2026-11-26 00:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2574#issuecomment-7178383463) Independent NVIDIA (wave32) full-suite + retail smoke test report on exact PR head `e2aae0e87df1499ddc393bec6b7b3d39adb24006` (clean detached checkout, no local changes). **Tested** - Hardware & toolchain: NVIDIA GeForce RTX 3070 8 GiB (wave32, driver 621.24), AMD Ryzen 7 5700X, 32 GiB RAM, Windows 11 Pro (build 26300), Rust 1.99.0 (`x86_64-pc-windows-msvc`), DXC/DXIL 1.8.2502.11 (Windows SDK 10.0.26100.0); debug tests, release smoke. - Targeted PR tests (`cargo test -p xcl --lib driver_cache::tests`): **6 passed, 0 failed** (including the 2 new tests `a_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills` and `storing_a_pipeline_still_observes_the_size_and_time_thresholds`). - Full workspace (`.\scripts\test.ps1`): **1425 passed, 0 failed, 46 ignored** (25 GPU skips expected on this wave32 adapter: 21 `no wave64`, 1 `no heap windows`, 3 wave32 per-lane refused for `#1426` f16/f32 semantics). - Release build (`cargo build --release -p xcl`) and 60 s retail smoke run (`XCL_NETWORK=0`, compared against `main @ 08db802` baseline on the same machine today: `1605` frames, `15009 MB` peak commit, `0` crashes, `0` device removals): **Regression run** ``` xcl-smoke v1 commit: e2aae0e87df1499ddc393bec6b7b3d39adb24006 gpu: NVIDIA GeForce RTX 3070 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1624 (PresentX 1625) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14972 MB ``` **Not tested** - AMD / Intel GPUs and wave64-only GPU tests (skipped on RTX 3070); `XCL_SAMPLE_*` tests (unset). **AI use** - Antigravity (Gemini 4 Neon) ran the build, test suite, and smoke run and drafted this report.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-26 04:42 UTC · original

Wine/NVIDIA cross-check of the focused tests — all pass. Head e2aae0e87df1499ddc393bec6b7b3d39adb24006, Linux + Wine 11.0, vkd3d-proton 3.2.0 (2576c0b4adfae4a), NVIDIA 590.48.1, RTX 4060 Laptop GPU 8 GiB, --locked --target x86_64-pc-windows-msvc, one test thread, fresh Compiling xcl .../xcl-pr2574/... provenance, DXVK_CONFIG='dxgi.hideNvidiaGpu = False'.

cargo test --locked --target x86_64-pc-windows-msvc -p xcl --lib hle::d3d12x::real::driver_cache::tests:: -- --nocapture --test-threads=1 → 6/6 pass on the real adapter, including the new a_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills (the log shows the late blob recovered through the disk path after the RAM map is dropped: "2 driver blobs kept on disk for the next run (this one: 250 ms…)") and the unchanged a_kept_blob_is_read_back_and_a_refused_one_is_dropped (its kept-on-disk reload and the refused-foreign-adapter branch both behave). The four pre-existing tests pass unmodified.

Scope: synthetic fixtures with a small cache and controlled timing inputs — no retail cache saturation or cold-compile timing measured here, and no title run. On this 16 GiB host the change is relevant exactly as scoped: a saturated RAM blob cache no longer silently loses slow translated pipelines between sessions.

Log: .compat-xcl/logs/verify-pr2574-wine-blob-cache.log (local). AI-assisted verification and report (OpenAI Codex).

**@⁠pickles976** on GitHub · 2026-11-26 04:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/2574#issuecomment-7182837721) **Wine/NVIDIA cross-check of the focused tests — all pass.** Head `e2aae0e87df1499ddc393bec6b7b3d39adb24006`, Linux + Wine 11.0, vkd3d-proton 3.2.0 (`2576c0b4adfae4a`), NVIDIA 590.48.1, RTX 4060 Laptop GPU 8 GiB, `--locked --target x86_64-pc-windows-msvc`, one test thread, fresh `Compiling xcl .../xcl-pr2574/...` provenance, `DXVK_CONFIG='dxgi.hideNvidiaGpu = False'`. `cargo test --locked --target x86_64-pc-windows-msvc -p xcl --lib hle::d3d12x::real::driver_cache::tests:: -- --nocapture --test-threads=1` → **6/6 pass** on the real adapter, including the new `a_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills` (the log shows the late blob recovered through the disk path after the RAM map is dropped: "2 driver blobs kept on disk for the next run (this one: 250 ms…)") and the unchanged `a_kept_blob_is_read_back_and_a_refused_one_is_dropped` (its kept-on-disk reload and the refused-foreign-adapter branch both behave). The four pre-existing tests pass unmodified. Scope: synthetic fixtures with a small cache and controlled timing inputs — no retail cache saturation or cold-compile timing measured here, and no title run. On this 16 GiB host the change is relevant exactly as scoped: a saturated RAM blob cache no longer silently loses slow translated pipelines between sessions. Log: `.compat-xcl/logs/verify-pr2574-wine-blob-cache.log` (local). AI-assisted verification and report (OpenAI Codex).
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/2574/head:github-bot/gh-2574'
git switch 'github-bot/gh-2574'

Merge

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