Repository navigation
D3D12.X: defer compute driver_cache path hashing until RAM cache miss - #2909
real-alponzo wants to merge 1 commit into
Conversation
compute_container and the compute pass of finish_two_pass previously computed driver_cache::path_for / driver_cache::path (which hashes the full DXIL buffer with fnv64) eagerly before checking whether compute_blob(key) already hit in COMPUTE_BLOBS. Defer the disk path lookup until a RAM-cache miss or a cold-compile writeback after a rejected RAM blob. Fixes xcl-dev#2883. Assisted-by: Antigravity (Gemini 4 Neon)
|
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 Tested:
By reading, the writeback is unchanged: when a RAM blob is refused and the build succeeds, 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. |
…m, pure std) Upstream single-commit 7575f67 on 8b957be: 1 file shaders.rs +38/-2. Helper + 2 direct_sweep call-site swaps + regression test, hunk bodies identical (only line offset from linux-only helpers). xcl-dev#2909/xcl-dev#2910 SKIP (hle/d3d12x/real.rs, Windows-only); xcl-dev#2906 SKIP (dev-stack tip, same shape as xcl-dev#2886); xcl-dev#2889 re-pinned f334cc9 (force-push, still SKIP).
|
Tested: Clean 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 ( |
|
Tested head Debug build, no env vars, no game files.
Not tested: retail title. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted). |
|
Verified Hardware / toolchain: Windows 11 26H2 (build 26300.9818), Intel Core i5-14500HX, 24 GB RAM, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver Tested:
Code review notes (non-blocking):
Not tested:
AI use:
|
Native ordinary compute driver-cache checkOn an RTX 5070 with disk caching enabled, the ordinary
This was a local test overlay on AI use: OpenAI Codex wrote and ran the fixture, inspected the code, and drafted the report. |
|
Tested (AMD): clean
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 Not tested: retail smoke. The AI use: Claude Code (Claude Sonnet 5.5) ran the checks and wrote this. |
|
Tested PR #2909 ( Unit Tests (
|
| Build | Guest entry / World load | Frames shown | World presents | Peak commit | Peak local / non-local VRAM | Console stats | Crashes / Removals |
|---|---|---|---|---|---|---|---|
main (8b957bec) |
67.2 s / 188.4 s |
1240 |
14 (28 windows) |
29,411 MB |
14,281 / 2,241 MB |
9,178 draws, 34,068 dispatches |
0 / 0 (exit: 0x0) |
PR #2909 (67c26e28) |
109.8 s / 229.1 s |
1247 |
15 (29 windows) |
30,376 MB |
14,449 / 2,243 MB |
12,981 draws, 51,401 dispatches |
0 / 0 (exit: 0x0) |
Behavior matched main without regressions (exit: 0x0, 0 crashes, 0 device removals).
Not tested: Instrumented micro-timing / byte counts of COMPUTE_BLOBS RAM hits inside the retail title run (verification aspect from #2883), or full workspace test suite on 67c26e28.
|
I reproduced the second follow-up in retrope13’s review on the ordinary compute path. I used a local release build based on I seeded a private cache with
This measures a pre-existing distinction relevant to #2883. When profiling repeat creates, it matters whether the first build happened offline or in the running process. Title frequency, world-load impact, two-pass compute and this PR’s head remain unmeasured in this experiment. OpenAI Codex (GPT-6) assisted with the probe, measurements and report. |
Defer
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