D3D12.X: defer driver cache path hashing on compute RAM hits #2998
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2998"
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 SalmanBarkat on 2026-11-27T10:15:24Z.
Defers
driver_cache::path_for/driver_cache::path(and its full-bufferfnv64DXIL hash) until aftercompute_blob(key)misses in RAM or when a newly compiled blob needs to be stored on disk. On compute PSO RAM cache hits where the driver accepts the cached blob, thefnv64pass over the DXIL bytecode is skipped completely.Fixes #2883
What is in it
crates/xcl/src/hle/d3d12x/real.rs:compute_container: computedriver_cache::path_for(dxil, copy.Flags.0, mode == ComputeBuild::Chain)only whencompute_blob(key)returnsNone, or right beforedriver_cache::keep(...)if a new blob is written back after compilation.finish_two_pass: apply the same lazydriver_cache::path(&tp.cs, 0)deferral around the compute-passcompute_blob(ckey)lookup and writeback.driver_cache::tests::deferred_path_is_deterministic: verifypath_forandname_forare deterministic across calls and distinct for.chain.psovs.pso.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), debug build.cargo build --workspace: succeeded.cargo test --workspace -- --test-threads=4: 1447 passed, 0 failed, 47 ignored (across all 38 workspace test binaries, includinghle::d3d12x::real::driver_cache::tests::*andgpu_two_pass_cache_e2e).Not tested
scripts/smoke.ps1regression run (no retail game package available locally to producexcl-smokeblocks).AI use
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T10:23:56Z.
Tested on clean
3071230e616a25ce66b215dd741a7a87ec6b94dc. Windows 11 26200.9974, Rust 1.97.1 MSVC, debug.cargo test --offline --locked -j 2 -p xcl --lib driver_cache::tests -- --test-threads=1passed 5/5 withXCL_PSO_DISK_CACHE=1. The same test binary in a fresh process withXCL_PSO_DISK_CACHE=0passed 4/5. Onlydeferred_path_is_deterministicfailed:path_forcorrectly returnsNonefor both paths with caching disabled, and the test expects them to differ. Enabling the cache again returned to 5/5.I also compared the exact heads with #2909
67c26e28. Both cover the same RAM-hit fast path incompute_containerand the compute half offinish_two_pass, on the same parent8b957bec. Both merge individually intomain623d02e4and conflict with each other inreal.rs. #2909’s callback tests exercise whether the disk path/load runs. #2998’s new test exercises path identity. No GPU timing or retail run.AI use: OpenAI Codex (GPT-6) ran the Windows tests, compared the diffs, and drafted this report.
Imported from ivall/xcl. Originally posted by throny on 2026-11-30T20:19:07Z.
Closing: it is the same change as #2909 (older, with the helper and tests), which stays open as the one to rebase; note that both no longer apply because
mainreworked that code. Checked against currentmain(ff0c364b), hunk by hunk. 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) checked this; part of the duplicate sweep on #3041.
Pull request closed