Repository navigation
D3D12.X: publish driver cache blobs from private staging files - #714
Conversation
The per-process staging pathname was shared by concurrent writes of one key. A writer paused after opening it could resume after another writer renamed that file into the cache, changing successfully published bytes through its older handle. Create an exclusive sibling file for each invocation using the process ID and an atomic sequence. Skip occupied names left by an earlier process and clean up only a staging file this invocation actually created. A deterministic Windows regression holding the real staging helper's open handle fails with the old writer and passes with this change. Focused Cargo writer tests: 4 passed, 0 failed, 0 ignored. Full GPU suite and retail smoke have not been run for this commit. Assisted-by: Codex (GPT-6, exact variant not exposed)
|
Test run of Tested
Review: Each save opens its own staging file with Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Code/CI review only (not independently runtime-tested by me): clean merge with both checks green ( |
Two 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