D3D12.X: slow graphics PSO blobs are not saved to disk once GRAPHICS_BLOBS is full #2884

Open
opened 2026-11-26 21:14:02 +00:00 by KOLESNiii · 1 comment
KOLESNiii commented 2026-11-26 21:14:02 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T21:14:02Z.


Could someone verify whether slow graphics and two-pass mesh PSOs stop being persisted to driver_cache on disk once GRAPHICS_BLOBS reaches its 256 MiB cap during a retail world load?

On main at 8b957bec, translated_graphics_pso_once calls keep_graphics_blob(gkey, *ppv, bytes) and then reads graphics_blob(gkey) to decide whether to call driver_cache::keep. finish_two_pass's mesh pass does the same. Inside remember_graphics_blob, if blob.len() > GRAPHICS_BLOBS_MAX.saturating_sub(*total) (256 MiB), it returns early without inserting into GRAPHICS_BLOBS, so graphics_blob(gkey) returns None and driver_cache::keep is skipped.

PR #2740 addressed the analogous pattern for COMPUTE_BLOBS in compute_container and the compute pass of finish_two_pass, but did not modify keep_graphics_blob, translated_graphics_pso_once, or the mesh pass of finish_two_pass.

Please verify on a Windows retail world load whether GRAPHICS_BLOBS reaches 256 MiB while slow (>= 250 ms) graphics or two-pass mesh PSOs are still being built, and whether returning the read Arc<Vec<u8>> directly (like #2740) reduces cold/repeated graphics compiles on subsequent runs.

Duplicate check: screened open issues and PRs (including drafts); #2740 covers compute blobs only, and #2621 / #2001 do not address GRAPHICS_BLOBS capacity dropping disk persistence.

AI use: Gemini 4 Hydrogen (via Antigravity CLI) inspected the source and PR #2740 diff and filed this verification request.

<!-- greyfinch-sync:ivall/xcl:issue:6635184503 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2884). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-26T21:14:02Z. --- Could someone verify whether slow graphics and two-pass mesh PSOs stop being persisted to `driver_cache` on disk once `GRAPHICS_BLOBS` reaches its 256 MiB cap during a retail world load? On `main` at `8b957bec`, `translated_graphics_pso_once` calls `keep_graphics_blob(gkey, *ppv, bytes)` and then reads `graphics_blob(gkey)` to decide whether to call `driver_cache::keep`. `finish_two_pass`'s mesh pass does the same. Inside `remember_graphics_blob`, if `blob.len() > GRAPHICS_BLOBS_MAX.saturating_sub(*total)` (256 MiB), it returns early without inserting into `GRAPHICS_BLOBS`, so `graphics_blob(gkey)` returns `None` and `driver_cache::keep` is skipped. PR #2740 addressed the analogous pattern for `COMPUTE_BLOBS` in `compute_container` and the compute pass of `finish_two_pass`, but did not modify `keep_graphics_blob`, `translated_graphics_pso_once`, or the mesh pass of `finish_two_pass`. - [Ordinary graphics writeback](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L5307-L5311) - [Two-pass mesh writeback](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L6122-L6131) - [`keep_graphics_blob` / `remember_graphics_blob`](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L4858-L4875) Please verify on a Windows retail world load whether `GRAPHICS_BLOBS` reaches 256 MiB while slow (`>= 250 ms`) graphics or two-pass mesh PSOs are still being built, and whether returning the read `Arc<Vec<u8>>` directly (like #2740) reduces cold/repeated graphics compiles on subsequent runs. Duplicate check: screened open issues and PRs (including drafts); #2740 covers compute blobs only, and #2621 / #2001 do not address `GRAPHICS_BLOBS` capacity dropping disk persistence. AI use: Gemini 4 Hydrogen (via Antigravity CLI) inspected the source and PR #2740 diff and filed this verification request.
andrewDoing commented 2026-11-26 21:18:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-26T21:18:36Z.


At 8b957bec, the RAM-cap dependency is present in the ordinary graphics path: it calls keep_graphics_blob, then looks the key up in GRAPHICS_BLOBS before writing to disk. If a new blob is rejected by the capacity check, the subsequent lookup returns None. Ordinary graphics · Capacity check

The two-pass mesh path already reads the newly built PSO blob directly on a RAM miss. For a slow build with a disk path and an exportable blob, it calls driver_cache::keep before remember_graphics_blob, so RAM-cap rejection there does not suppress that write. It may help to measure ordinary graphics RAM-admission failures separately. Mesh path.

This is source inspection only; I did not measure retail cap frequency or subsequent-launch compilation time. AI use: OpenAI Codex with GPT-6.2 Astra inspected the source; Codex verified the cited paths and posted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7203600538 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/2884#issuecomment-7203600538). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-26T21:18:36Z. --- At `8b957bec`, the RAM-cap dependency is present in the ordinary graphics path: it calls `keep_graphics_blob`, then looks the key up in `GRAPHICS_BLOBS` before writing to disk. If a new blob is rejected by the capacity check, the subsequent lookup returns `None`. [Ordinary graphics](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L5307-L5311) · [Capacity check](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L4858-L4875) The two-pass mesh path already reads the newly built PSO blob directly on a RAM miss. For a slow build with a disk path and an exportable blob, it calls `driver_cache::keep` before `remember_graphics_blob`, so RAM-cap rejection there does not suppress that write. It may help to measure ordinary graphics RAM-admission failures separately. [Mesh path](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L6122-L6130). This is source inspection only; I did not measure retail cap frequency or subsequent-launch compilation time. AI use: OpenAI Codex with GPT-6.2 Astra inspected the source; Codex verified the cited paths and posted this report.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#2884
No description provided.