Repository navigation
D3D12.X: persist slow driver blobs past the RAM cache cap (#1833) - #2574
razormontana wants to merge 1 commit into
Conversation
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
|
Test run on exact head Tested
Regression run (60 s, default settings, a retail title) main: this PR: No crash or device removal; frames 101 % of Not tested
AI use
|
|
Independent NVIDIA (wave32) full-suite + retail smoke test report on exact PR head Tested
Regression run Not tested
AI use
|
|
Wine/NVIDIA cross-check of the focused tests — all pass. Head
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: |
…nvalidation (port upstream xcl-dev#2574 + xcl-dev#2614) (cherry picked from commit a37262db59ac82c615618b034d149e7c54a23ff6)
Capture and persist the exact successful uncached pipeline result whose driver build crossed the slow threshold, even when bounded RAM-cache admission fails. Same-key builders reserve capture/publication, and disk-path turns prevent distinct RAM identities from racing one pathname. Publish disk before RAM visibility, remember cap-refused persisted keys, clear that marker on cached-blob rejection, and preserve exact-generation invalidation plus AMD default-off policy. Adapted from xcl-dev#2574 after prerequisites xcl-dev#2577 and xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem and driver execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
|
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. |
Capture and persist the exact successful uncached pipeline result whose driver build crossed the slow threshold, even when bounded RAM-cache admission fails. Same-key builders reserve capture/publication, and disk-path turns prevent distinct RAM identities from racing one pathname. Publish disk before RAM visibility, remember cap-refused persisted keys, clear that marker on cached-blob rejection, and preserve exact-generation invalidation plus AMD default-off policy. Adapted from xcl-dev#2574 after prerequisites xcl-dev#2577 and xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem and driver execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
gut0to
left a comment
There was a problem hiding this comment.
AI-assisted review (OpenAI GPT-6). I inspected the changed cache path and verified the lock sequence; I did not run tests.
| let mut guard = cache.lock().unwrap(); | ||
| let (map, total) = guard.get_or_insert_with(|| (HashMap::new(), 0)); | ||
| if blob.len() <= limit.saturating_sub(*total) { | ||
| *total += blob.len(); |
There was a problem hiding this comment.
Could this recheck map.get(&key) while holding guard before incrementing total? Two concurrent builds for the same cache key can both observe existing == None at line 4777, read their blobs, then serialize here and each add its length even though the second insert replaces 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).
Save an eligible driver blob even when the bounded in-memory cache cannot retain it. The RAM caps, disk identities and eligibility stay. Recheck cache insertion under the lock so overlapping builds of a single key retain and charge only the first blob. Regression tests cover both a full cache and an interleaved pair of misses. Assisted-by: Codex (GPT-6.2 Astra) Assisted-by: Codex GPT-6.2
e2aae0e to
c00f347
Compare
|
Independent desktop NVIDIA verification of PR #2574 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib a_slow_pipeline_is_saved_for_the_next_run_after_the_memory_cache_fills -- --nocapture |
1 passed; 0 failed; 0 ignored; 1344 filtered out (0.00s) |
cargo test --release -p xcl --lib overlapping_builds_charge_a_driver_blob_only_once -- --nocapture |
1 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 -- --nocapture |
1 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 xcl |
Clean build (1m 12s, exit 0) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (e120925e3abc9956a8b9bae631969d32e8ccd43c, cached baseline on the same machine):
xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13979 MB
PR #2574 (c00f3476dff7702dc076a783206f289d1f6a720e):
xcl-smoke v1
commit: c00f3476dff7702dc076a783206f289d1f6a720e
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1603 (PresentX 1603)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14010 MB
Runtime log observations (xcl.log)
9221log lines,0[ERROR]/ device-removal / panic lines.- Disk driver-blob reuse observed live:
D3D12.X: 1 pipelines made from the driver's blob of an earlier run (kept on disk). - Final draw/memory telemetry in log:
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
- Full-RAM-cache disk persistence, overlapping-build single charging, and size/time thresholds were verified through the 3 new
driver_cache::testsand 3×hle::d3d12x::real::runs (66/0/0). - The 60 s retail smoke ran on the warm shader/driver cache and did not saturate the in-memory driver-blob cache cap (
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).
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.