Skip to content

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

Open
razormontana wants to merge 1 commit into
xcl-dev:mainfrom
razormontana:d3d12x/persist-driver-blobs-past-ram-cap
Open

razormontana wants to merge 1 commit into
xcl-dev:mainfrom
razormontana:d3d12x/persist-driver-blobs-past-ram-cap

Conversation

@razormontana

Copy link
Copy Markdown
Contributor

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

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)
@razormontana
razormontana marked this pull request as ready for review November 25, 2026 23:24
@DavidM1911

Copy link
Copy Markdown
Contributor

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

@xpatfussy69x

Copy link
Copy Markdown

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.

@ramon-victor

Copy link
Copy Markdown
Contributor

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.

@pickles976

Copy link
Copy Markdown

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).

rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
…nvalidation (port upstream xcl-dev#2574 + xcl-dev#2614)

(cherry picked from commit a37262db59ac82c615618b034d149e7c54a23ff6)
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