D3D12.X: publish driver cache blobs from private staging files #714
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!714
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/714/head"
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?
@Prime1997 on GitHub · 2026-11-24 03:59 UTC · original
Prime1997:contrib/driver-cache-atomic-publish→main· +65 −2 · 1 files · 1 commits · merged 2026-11-24 13:31 UTCTwo workers saving a driver blob for the same compute pipeline could open the same temporary file. One worker could publish it while the other still held a writable handle. A subsequent write through the older handle changed the bytes readers saw even after the save had succeeded. This affects the disk cache introduced in #634.
What is in it
Tested
Windows 11 build 26200, Intel Core i5-10400, NVIDIA GeForce RTX 3060 Ti (Windows driver 32.0.16.1714), Rust 1.100.0, debug and release builds. These filesystem regressions run on the CPU.
The overlapping-writer test failed on official
f4ce27cwith the old publication behavior. A successful save ofcomplete second blobwas subsequently read back asoldplete second blob.On
2cc79fb,cargo test --locked -p xcl --lib hle::d3d12x::real::driver_cache::tests -- --nocapturepassed all 4 tests with 0 failures and 0 ignored.The release workspace built on
2cc79fb. Two full runs ofcargo test --locked --workspace --no-fail-fast -- --test-threads=4 --nocaptureon the RTX 3060 Ti each reported 700 passed, 3 failed and 41 ignored. Two wave64 cases reported hardware skips within the passing count. The first failure was the shared video-memory total inplaced_title_textures_share_vram_and_preserve_pixels. Its panic poisoned the lock used by two later tests. Each of the three passed when run individually in fresh processes. The separate test correction is tracked in #447.An independent run on pristine main at
f4ce27cproduced the same three failures, with 698 passed and 41 ignored. Both new regression tests account for the two additional passes on this PR.Regression run
Both 60-second runs used the same local title, adapter and compiler. Each started with a separate empty XCL profile and shader cache. The NVIDIA driver managed its own cache across the two runs. Neither run used menu input.
Main
PR
The PR showed 324 frames against 405 on main (80.0%, the project threshold), with 14 MB higher peak commit. Both runs exited cleanly. These short runs created no driver-cache files, so they measure startup only. The overlapping-writer test exercises the corruption directly.
Not tested
The Windows test reproduces file corruption directly. Its effect on retail loading time or stability is unverified.
AI use
I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord
@MesshM on GitHub · 2026-11-24 04:27 UTC · original
Test run of
2cc79fb11140adaccfac198853fb00db6dfda6a8on AMD RDNA4. I merged it onto currentmain64b3f35locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 703 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 662 passed, 0 failed, 21 ignoredSKIPPED;an_abandoned_staging_file_is_skipped_and_preservedand the otherdriver_cachetests pass.Review: Each save opens its own staging file with
create_newand a per-process counter in the name, so two workers can no longer hold one writable handle, and a name that already exists is skipped rather than truncated. I found nothing to change.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@raylitebull on GitHub · 2026-11-24 10:40 UTC · original
Code/CI review only (not independently runtime-tested by me): clean merge with both checks green (
Build and test+PR description). Publishing compute PSO driver cache blobs from private temp staging files cleanly avoids concurrent write races. Recommend merging, @ivall.