D3D12.X: persist slow driver blobs past the RAM cache cap (#1833) #2564
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2574"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by razormontana on 2026-11-25T23:19:36Z.
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.rsuses 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.mddocuments that disk saves can continue when the RAM budget is full.Tested
hle::d3d12x::real::driver_cache::testspassed. The new regression failed before the fix when the same key was charged twice and prevented an unrelated blob from fitting. The saturated-cache test still checks disk persistence.c00f3476,cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputreported 1,445 passed, 0 failed and 47 ignored. The pass count includes 26 explicit GPU skip notices.cargo build --offline --locked --release -p xclsucceeded.Regression run
Both release builds ran the same retail title offline for 60 seconds on the RTX 3070. Both used the Series S profile, direct DXIL and copies of the same starting cache. This pair uses
e120925, the preceding main commit. At8b957be, smoke reached its startup deadline during #2555 shader preparation. The PR merges cleanly into8b957be; the combined retail run remains unverified. The initial pair showed 703 frames on main and 408 on the PR. For this repeat, both started from copies of the cache left by the first main run, after builds completed.Main
PR head
Not tested
Retail cache saturation, cold compile times and other GPU vendors remain unmeasured. The isolated cache tests control the size and timing inputs.
AI use
Codex GPT-6.2 wrote and reviewed the code and tests, rebased the branch, ran the checks, and updated this description.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T23:45:31Z.
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
Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-26T00:01:57Z.
Test run on exact head
e2aae0e(e2aae0e87df1499ddc393bec6b7b3d39adb24006, on its basee1d84b7), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1425 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo)cargo test -p xcl --lib a_slow_pipeline_is_saved: 1 passed, 0 faileda_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills: okstoring_a_pipeline_still_observes_the_size_and_time_thresholds: okRegression run (60 s, default settings, a retail title)
main:
this PR:
No crash or device removal; frames 101 % of
main's, peak commit 100 %. Themainrun is on currentmain(08db802), newer than this PR's base.Not tested
main(tested on its own base; it merges into08db802without conflicts)AI use
Imported from ivall/xcl. Originally posted by ramon-victor on 2026-11-26T00:05:26Z.
Independent NVIDIA (wave32) full-suite + retail smoke test report on exact PR head
e2aae0e87df1499ddc393bec6b7b3d39adb24006(clean detached checkout, no local changes).Tested
x86_64-pc-windows-msvc), DXC/DXIL 1.8.2502.11 (Windows SDK 10.0.26100.0); debug tests, release smoke.cargo test -p xcl --lib driver_cache::tests): 6 passed, 0 failed (including the 2 new testsa_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fillsandstoring_a_pipeline_still_observes_the_size_and_time_thresholds)..\scripts\test.ps1): 1425 passed, 0 failed, 46 ignored (25 GPU skips expected on this wave32 adapter: 21no wave64, 1no heap windows, 3 wave32 per-lane refused for#1426f16/f32 semantics).cargo build --release -p xcl) and 60 s retail smoke run (XCL_NETWORK=0, compared againstmain @ 08db802baseline on the same machine today:1605frames,15009 MBpeak commit,0crashes,0device removals):Regression run
Not tested
XCL_SAMPLE_*tests (unset).AI use
Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-26T04:42:55Z.
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, freshCompiling 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 newa_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 unchangeda_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).Imported from ivall/xcl. Originally posted by throny on 2026-11-26T13:38:27Z.
Two contributors checked independently and found that #2740 solves the same problem (for #1833) in a different way: #1607, group D127. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T15:50:55Z.
Review: COMMENTED
AI-assisted review (OpenAI GPT-6). I inspected the changed cache path and verified the lock sequence; I did not run tests.
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-26T15:50:55Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 4786Could this recheck
map.get(&key)while holdingguardbefore incrementingtotal? Two concurrent builds for the same cache key can both observeexisting == Noneat line 4777, read their blobs, then serialize here and each add its length even though the secondinsertreplaces the first entry. That overcounts the RAM budget and can reject unrelated blobs before the cache actually reaches its limit. I traced both lock scopes; I did not run tests. AI-assisted review (OpenAI GPT-6).Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T22:33:38Z.
Independent desktop NVIDIA verification of PR #2574 at head
c00f3476dff7702dc076a783206f289d1f6a720e(1commit; exact parent & merge-base:e120925e3abc9956a8b9bae631969d32e8ccd43c, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
c00f3476)cargo test --release -p xcl --lib a_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills -- --nocapture1 passed; 0 failed; 0 ignored; 1344 filtered out(0.00s)cargo test --release -p xcl --lib overlapping_builds_charge_a_driver_blob_only_once -- --nocapture1 passed; 0 failed; 0 ignored; 1344 filtered out(0.00s)cargo test --release -p xcl --lib storing_a_pipeline_still_observes_the_size_and_time_thresholds -- --nocapture1 passed; 0 failed; 0 ignored; 1344 filtered out(0.00s)cargo test --release -p xcl --lib hle::d3d12x::real::(3 consecutive runs)66 passed; 0 failed; 0 ignored; 1279 filtered out× 3 (0.39s,0.36s,0.36s)cargo build --release -p xcl --bin xcl1m 12s, exit0)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
e120925e3abc9956a8b9bae631969d32e8ccd43c, cached baseline on the same machine):PR #2574 (
c00f3476dff7702dc076a783206f289d1f6a720e):Runtime log observations (
xcl.log)9221log lines,0[ERROR]/ device-removal / panic lines.D3D12.X: 1 pipelines made from the driver's blob of an earlier run (kept on disk).19471 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14009 MB committed by the process; video memory 6116 MB local, 4683 MB non-local.Limits of coverage
driver_cache::testsand 3×hle::d3d12x::real::runs (66/0/0).XCL_DRIVER_CACHE_MB), so it serves as an end-to-end non-regression check ontitle: 29640639rather than a cold cache-overflow stress test.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:36:05Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:24:12Z.
Triage (#1607) – head
c00f347This change is already on main:
665f72f("D3D12.X: persist slow driver blobs past the RAM cap", adapted from this PR) makeskeep_driver_blobwrite a slow build's blob to the disk cache even when the RAM cache refuses it, for compute, two-pass and graphics pipelines, and adds the README line. #2740 (same problem, compute only) is covered by the same commit.Recommendation: close (superseded by main commit
665f72f).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:54:12Z.
Closing as superseded: this change is already on
main(665f72fc). main real.rs persists slow driver blobs past the RAM cap (665f72fcadapted from #2574); same behaviour as the PR (compute and graphics), README line includedTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, 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