Repository navigation
D3D12.X: persist graphics PSO blobs to disk even when GRAPHICS_BLOBS is full - #2910
real-alponzo wants to merge 1 commit into
Conversation
|
The new slow-small-PSO path still extracts a driver blob when Consider |
|
Rerun on the new head
From reading: First run, on Tested:
So the disk-persistence fix has no test of its own. If Not tested: a title run that fills the 256 MiB AI use: Claude Code (Claude Opus 5.5) ran the tests and the 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).
KOLESNiii
left a comment
There was a problem hiding this comment.
The fix in translated_graphics_pso_once looks right to me: it uses the same blob-keeping rule as the mesh path in finish_two_pass, and the RAM cap is still enforced. One change is needed before merge: the tests don't exercise the function this PR fixes (inline comment).
Review written with Claude Code (Claude Opus 5.5); I checked each point against the diff.
| } | ||
|
|
||
| #[cfg(test)] | ||
| fn keep_graphics_blob_with( |
There was a problem hiding this comment.
The new tests call keep_graphics_blob_with, a #[cfg(test)] copy of the logic, while production runs the separate unsafe fn keep_graphics_blob. The two have already drifted (this one has the bytes.is_empty() check, production has the pso.is_null() check), and the tests would pass on main too, so they don't guard the fix (AGENTS.md: a bug fix comes with a test that fails without the fix).
Please have keep_graphics_blob delegate to this function: take the GRAPHICS_BLOBS lock, pass its map, total and GRAPHICS_BLOBS_MAX, and use || read_pso_cached_blob(pso) as read_blob, keeping the null check in the wrapper. Then drop the #[cfg(test)] gate so the tests cover the code that runs.
|
Two more points, neither blocking on its own:
Written with Claude Code (Claude Opus 5.5); checked against the PR head |
…is full translated_graphics_pso_once previously called keep_graphics_blob and then looked up graphics_blob(gkey) before writing to driver_cache. Once GRAPHICS_BLOBS hit its 256 MiB RAM cap, remember_graphics_blob rejected new entries and graphics_blob(gkey) returned None, skipping disk persistence for slow graphics PSOs. Return the extracted blob directly from keep_graphics_blob (and extract slow builds even below COMPUTE_BLOB_MIN_DXIL, matching finish_two_pass's mesh pass) so driver_cache::keep still persists it to disk while respecting GRAPHICS_BLOBS_MAX in RAM. Fixes xcl-dev#2884. Assisted-by: Antigravity (Gemini 4 Neon)
3d34505 to
2481b11
Compare
|
Thanks @KOLESNiii and @fromthemoonx! Addressed in 2481b11: \keep_graphics_blob\ now delegates directly to \keep_graphics_blob_with\ (dropping #[cfg(test)]), \keep_fixtures\ is passed explicitly to keep tests order-independent, and \slow\ is gated on \disk.is_some(). Re-ran unit tests and 60 s smoke. |
|
NVIDIA and AMD full-suite run, to go with the reports above by fromthemoonx, since none of them covers AMD. Tested exact head Tested
Not tested
AI use
|
|
Independent Windows/NVIDIA test of PR head
This verifies the synthetic suite on this adapter. I did not run a retail title or fill the 256 MiB graphics-blob cap in a live workload, and I did not measure the AI use: Codex (GPT-6.2 Sol) reviewed the changed path, ran the tests, and drafted this report. |
Ensure slow graphics PSO blobs in
translated_graphics_pso_oncecontinue persisting todriver_cacheon disk even afterGRAPHICS_BLOBSreaches its 256 MiB in-memory cap, matchingfinish_two_pass's mesh pass.Fixes #2884.
What is in it
keep_graphics_blobincrates/xcl/src/hle/d3d12x/real.rsto delegate directly tokeep_graphics_blob_with, returningOption<Arc<Vec<u8>>>directly (and extracting blobs whenslow || dxil_len >= COMPUTE_BLOB_MIN_DXIL || keep_fixtures), while still enforcingGRAPHICS_BLOBS_MAXinsideremember_graphics_blob_into.translated_graphics_pso_onceto gateslowondisk.is_some() && driver_cache::worth_keeping(build.in_driver)and pass the returned blob directly todriver_cache::keepinstead of re-queryinggraphics_blob(gkey).graphics_blob_cache_tests::keep_graphics_blob_returns_blob_for_disk_even_when_ram_cache_is_fullandgraphics_blob_cache_tests::keep_graphics_blob_skips_fast_small_psoexercising the productionkeep_graphics_blob_withpath with an explicitkeep_fixturesflag.Regression run
Base (
main):PR head (
2481b11f):Tested
rustc 1.100.0, DXC 1.9.2602.17.cargo test -p xcl --lib graphics_blob_cache_tests -- --nocapture:2 passed; 0 failed; 0 ignored; 1345 filtered out..\scripts\smoke.ps1 -Game "C:\VIctory-SSD-test\game" -Seconds 60on8b957becand2481b11f(blocks above).Not tested
GRAPHICS_BLOBScap live.AI use
keep_graphics_blobdelegation and return-value fix, wrote the unit tests, ran the tests and paired smoke runs, and drafted this PR description.