D3D12.X: defer compute driver_cache path hashing until RAM cache miss #2909
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!2909
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2909"
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?
@real-alponzo on GitHub · 2026-11-26 22:50 UTC · original
real-alponzo:fix/2883-defer-compute-disk-hash→main· +84 −17 · 1 files · 1 commits · openDefer
driver_cache::path_for/driver_cache::path(which hashes the full DXIL buffer withfnv64) incompute_containerand the compute pass offinish_two_passuntilcompute_blob(key)misses inCOMPUTE_BLOBS, avoiding unnecessary full-buffer FNV-1a hashing on warm RAM-cache hits.Fixes #2883.
What is in it
resolve_compute_blobincrates/xcl/src/hle/d3d12x/real.rsto check the RAM cache first and only compute/load the on-diskdriver_cachepath on a RAM miss.driver_cache::path_for/driver_cache::pathlazily during writeback so the newly compiled blob is still persisted to disk.compute_blob_cache_tests::resolve_compute_blob_skips_disk_hash_on_ram_hitandcompute_blob_cache_tests::resolve_compute_blob_loads_from_disk_on_ram_miss.Regression run
Base (
main):PR head (
67c26e28):Tested
rustc 1.100.0, DXC 1.9.2602.17.cargo test -p xcl --lib compute_blob_cache_tests -- --nocapture:2 passed; 0 failed; 0 ignored; 1345 filtered out..\scripts\smoke.ps1 -Game "C:\VIctory-SSD-test\game" -Seconds 60on8b957becand67c26e28(blocks above).Not tested
cargo test --workspaceon this exact branch (verified targeted unit tests and paired 60 s retail smoke; CI covers the full suite).AI use
github-bot referenced this pull request2026-11-27 01:18:49 +00:00
@fromthemoonx on GitHub · 2026-11-26 23:11 UTC · original
Full suite on NVIDIA (listed under Not tested): passes. The new RAM-hit test fails with the old order (hash first). No existing test or the e2e title reaches the RAM-hit branch in
compute_container/finish_two_pass, so the helper tests are its only coverage.Tested:
67c26e2(its base is currentmain8b957be, so head = merged). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, Graphics Tools (D3D12 debug layer) installed.cargo test --workspace --no-fail-fast -- --test-threads=4SKIPPEDlines (no wave64, refused per-lane forms)compute_blob_cache_tests(2 tests), 3 runsresolve_compute_blobwithdisk_path()called before the RAM check (scratch,main's order)resolve_compute_blob_skips_disk_hash_on_ram_hitfails 3 of 3:disk path / fnv64 must not run on a RAM-cache hiteprintln!indriver_cache::path_forand on each RAM hit,cargo test -p xcl --lib+--test gpu_compute_e2e,mainvs headpath_for4 times, 0 RAM hitse2edebug-layer tests, head vsmain8b957bepath_forBy reading, the writeback is unchanged: when a RAM blob is refused and the build succeeds,
diskis computed beforedriver_cache::keep, anddriver_cache::note(false, …)only runs whenfrom_diskis set, sodiskhas already been computed there.Not tested: a warm title run where a RAM hit happens (none of the suite's builds repeat a program), the saved time, AMD / Intel on this run.
AI use: Claude Code (Claude Opus 5.5) ran the tests and scratch checks and wrote this report.
@JJAutoCompare on GitHub · 2026-11-26 23:32 UTC · original
Tested: Clean
67c26e28f4d5d148595923ebb254205b07164b83, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 x64 MSVC, debug.cargo test -p xcl --lib compute_blob_cache_tests -- --nocapture: 2 passed.cargo test -p xcl --lib real::driver_cache::tests -- --nocapture: 4 passed. Both had zero failures, ignores and skips. The RAM-hit case bypassed both disk callbacks, while a miss called each once. The disk fixtures covered cache-key filenames, persistence/readback, refused-file removal, and overlapping writes.A separate optimized synthetic microbenchmark on the same host measured the disk-filename routine at 1.010 ms for 1 MiB and 4.069 ms for 4 MiB (median of seven alternating rounds), versus 0.200 ms and 0.815 ms for the RAM-key routine that still runs on hits. These are isolated routine costs.
Not tested: GPU, driver rejection of a RAM blob through a live pipeline, retail smoke, world-load timings, or the full workspace suite.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran the tests, wrote and ran the isolated benchmark, and drafted the report.@upipibi on GitHub · 2026-11-27 00:12 UTC · original
Tested head
67c26e28f4d5d148595923ebb254205b07164b83, merge-base8b957bec6f82495aec940944c6bf47faa02db590, RTX 3070 (Ampere) driver 616.56, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09)Debug build, no env vars, no game files.
cargo test -p xcl --lib compute_blob_cache_tests -- --test-threads=1, 3 runs on head:2 passed, 0 failedeach time (resolve_compute_blob_skips_disk_hash_on_ram_hit,resolve_compute_blob_loads_from_disk_on_ram_miss).compute_blob_cache_testsmodule at the end ofreal.rs) applied to the merge-base8b957bec: does not compile,error[E0432]: unresolved importsuper::resolve_compute_blob``, so the tests cannot run there (the function is the PR's new code).cargo test -p xcl --lib -- --test-threads=4(whole lib): head1320 passed, 0 failed(27 ignored); merge-base1318 passed, 0 failed(27 ignored). The +2 is the two new tests.hle::xaudio2tests ran normally, nothing skipped for them.no wave64(RTX 3070 is wave32-only), 3 per-lane form refused (#1426f16 forms), 1pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache / SDK component missing).Not tested: retail title.
AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
@retrope13 on GitHub · 2026-11-27 00:16 UTC · original
Verified
67c26e28f4d5d148595923ebb254205b07164b83againstmain(8b957bec6f82495aec940944c6bf47faa02db590) on NVIDIA Ada Lovelace (debug +--releasetargeted GPU cache tests and paired full workspace suite).Hardware / toolchain: Windows 11 26H2 (build 26300.9818), Intel Core i5-14500HX, 24 GB RAM, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver
32.0.16.2140/621.40), Intel UHD Graphics (driver32.0.101.7092),rustc 1.100.0(stable-x86_64-pc-windows-msvc), Windows SDK10.0.26100.0(DXC1.9.2602.17).Tested:
cargo test --locked -p xcl --lib compute_blob -- --nocapture(XCL_ADAPTER=NVIDIA):4 passed; 0 failed; 0 ignoredin both debug (0.00s) and--release(0.01s) (covers both newcompute_blob_cache_testsand existingcompute_blob_tests).cargo test --locked -p xcl --test gpu_two_pass_cache_e2e -- --nocapture:XCL_ADAPTER=NVIDIA:1 passed; 0 failed(no skip) in both debug (8.20s) and--release(7.88s).XCL_ADAPTER=Intel/WARP: capability-skipped (SKIPPED ...: no wave64).XCL_ADAPTER=NVIDIA,cargo build --workspace --locked,cargo test --workspace --locked --no-fail-fast -- --test-threads=4, debug):8b957bec:1,446 passed, 0 failed, 47 ignored67c26e28:1,448 passed, 0 failed, 47 ignored(+2 new tests, zero regressions)Code review notes (non-blocking):
resolve_compute_blob(real.rs:4422–4433),compute_container(real.rs:4446–4497), andfinish_two_pass(real.rs:6162–6204) preserve all fallback/writeback behavior (copy.Flags.0is untouched before lazydriver_cache::path_forat4489, and graphics PSOs at5307/6080already usedriver_cache::graphics_path(hash, bytes)without re-hashing DXIL).real.rs:4488,6195), gating lazydriver_cache::path_for/pathondriver_cache::worth_keeping(in_driver)(matchingfinish_two_pass's graphics path at6143–6148) would also skip hashing fast (< 250 ms) retries thatdriver_cache::keepwill not persist.main: on a disk-cache hit (reused && from_disk,real.rs:4495–4497and6202–6204), the loaded compute blob is not promoted intoCOMPUTE_BLOBS(unlikeremember_graphics_blobat6139), so a second build of a disk-warm compute PSO still misses RAM and re-hashes/re-reads disk.Not tested:
AI use:
real.rs, ran the paired debug and release tests, and drafted this verification report.@andrewDoing on GitHub · 2026-11-27 00:40 UTC · original
Native ordinary compute driver-cache check
On an RTX 5070 with disk caching enabled, the ordinary
compute_containerpath in PR #2909 accepted a native RAM-cached PSO twice without hashing any DXIL bytes for the disk filename. The second acceptance occurred after deleting the on-disk copy. A deliberately invalid RAM blob then forced a native cold retry, which recreated the missing disk file. After evicting the RAM entry, the driver accepted the regenerated file.This was a local test overlay on
67c26e28f4d5d148595923ebb254205b07164b83, with a counter atdriver_cache::name_forand a fresh writable cache. It used actual D3D12 PSO creation and the same program, flags and root signature throughout. The repository's fixture retention switch admitted the small synthetic shader. One test passed, with no skips. The counter covers disk-name hashing only. Two-pass compute, actual world-load RAM-hit frequency, and retail CPU-time savings remain unmeasured. Run logAI use: OpenAI Codex wrote and ran the fixture, inspected the code, and drafted the report.
@oni-swr on GitHub · 2026-11-27 02:06 UTC · original
Tested (AMD): clean
67c26e28f4d5d148595923ebb254205b07164b83(base = main8b957bec). Windows 11 26200, Ryzen 7 5700X3D, AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Rust 1.100.0 MSVC, DXC 1.8.2502.11 (Windows SDK 10.0.26100), debug.cargo test -j 4 -p xcl --no-fail-fast -- --test-threads=4thencargo build --workspace+cargo test -p xcl --test e2e: thee2etests need the workspace-built test title, so the first run failed 3 of them for lack of it and the rerun passed 4 of 4. Lib/other targets: 1 failed, 7SKIPPEDlines (no heap windows, refused V_CVT_F16_F32 / V_MUL_F16 / VOP3-modifier forms), 47 ignored. The one failure,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722:res[30] = 0x1, CPU 0x7fffffff), also fails onmain8b957becwith the same seed on this GPU, so it is not from the PR.compute_blob_cache_tests(2) pass, as do the 4driver_cachetests.Review (by reading, no bugs found): the RAM check now precedes the disk-path hash, and after a refused RAM blob the path is computed before
driver_cache::keep, in bothcompute_containerandfinish_two_pass, so persistence is unchanged. Agrees with the earlier reports.Not tested: retail smoke. The
scripts/smoke.ps1run starts with a cold-cache precompile of about 26k shaders, which did not fit this session's time budget, so I did not produce a base/headxcl-smokepair. No runtime hit-rate or timing was measured either.AI use: Claude Code (Claude Sonnet 5.5) ran the checks and wrote this.
@LocranKing on GitHub · 2026-11-27 10:00 UTC · original
Tested PR #2909 (
67c26e28) againstmain(8b957bec) on Windows 11 (26300), Ryzen 5 5500 (6C/12T), RTX 3060 Ti 8 GiB (driver621.40),rustc 1.100.0, DXC1.9.2602.17.Unit Tests (
cargo test --locked -p xcl)hle::d3d12x::real::compute_blob_cache_tests::resolve_compute_blob_skips_disk_hash_on_ram_hit: okhle::d3d12x::real::compute_blob_cache_tests::resolve_compute_blob_loads_from_disk_on_ram_miss: ok(
2 passed, 0 failed.)Paired 180 s Retail Smoke (
9cc6a39e, Series Slockhart,XCL_HEAP_WINDOWS=1,XCL_DIRECT_DXIL=all,XCL_DIRECT_SPLIT_INSTRUCTIONS=0,XCL_PSO_WAIT_MS=50)Both runs started from identical pre-warmed DXIL/driver cache snapshots and reached the 3D world (
~60 sin-world):main(8b957bec)67.2 s/188.4 s124014(28windows)29,411 MB14,281 / 2,241 MB9,178draws,34,068dispatches0 / 0(exit: 0x0)67c26e28)109.8 s/229.1 s124715(29windows)30,376 MB14,449 / 2,243 MB12,981draws,51,401dispatches0 / 0(exit: 0x0)Behavior matched
mainwithout regressions (exit: 0x0,0crashes,0device removals).Not tested: Instrumented micro-timing / byte counts of
COMPUTE_BLOBSRAM hits inside the retail title run (verification aspect from #2883), or full workspace test suite on67c26e28.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.