Verify whether disk-enabled compute PSO builds waste CPU hashing DXIL on RAM-cache hits #2883

Open
opened 2026-11-26 21:12:48 +00:00 by github-bot · 1 comment
Owner

@⁠KOLESNiii on GitHub · 2026-11-26 21:11 UTC · original

Could someone verify whether deferring driver_cache::path_for / driver_cache::path until a compute PSO misses COMPUTE_BLOBS (or needs to write back to disk) saves measurable CPU time on warm world loads?

On main at 8b957bec, compute_container and the compute pass of finish_two_pass look up compute_blob(key) in RAM and also compute driver_cache::path_for / driver_cache::path eagerly before checking whether cached is already Some. driver_cache::name_for runs fnv64 over the entire DXIL buffer in addition to compute_blob_key's hash. When cached hits in COMPUTE_BLOBS and the driver accepts it, neither disk nor its FNV-1a hash is used.

A standalone Linux microbenchmark (extracted key functions compiled with rustc -O on synthetic byte buffers, Ryzen AI 7 350, three runs) measured median disk-name costs of ~0.85 ms for 1 MiB and ~3.42 ms for 4 MiB, versus ~0.14 ms and ~0.55 ms for compute_blob_key. Those are isolated component timings, not full title runs.

Please verify on Windows by measuring the count and total DXIL bytes of accepted COMPUTE_BLOBS RAM hits during a warm world load, and comparing time before the driver call with disk-path construction deferred until RAM miss or cache writeback (keeping disk filenames and cold/rejected-blob behavior unchanged).

Duplicate check: screened open issues and PRs (including drafts); PR #2723 modifies descriptor inputs and still builds the disk path eagerly, and PR #2767 covers DXIL copies.

AI use: Gemini 4 Hydrogen (via Antigravity CLI) verified the source locations and filed this verification request based on the earlier Codex-assisted static review and Linux component microbenchmark recorded in docs/pso-performance-audit.md.

**@⁠KOLESNiii** on GitHub · 2026-11-26 21:11 UTC · [original](https://github.com/xcl-dev/xcl/issues/2883) Could someone verify whether deferring `driver_cache::path_for` / `driver_cache::path` until a compute PSO misses `COMPUTE_BLOBS` (or needs to write back to disk) saves measurable CPU time on warm world loads? On `main` at `8b957bec`, `compute_container` and the compute pass of `finish_two_pass` look up `compute_blob(key)` in RAM and also compute `driver_cache::path_for` / `driver_cache::path` eagerly before checking whether `cached` is already `Some`. `driver_cache::name_for` runs `fnv64` over the entire DXIL buffer in addition to `compute_blob_key`'s hash. When `cached` hits in `COMPUTE_BLOBS` and the driver accepts it, neither `disk` nor its FNV-1a hash is used. - [Compute path](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L4427-L4435) - [Disk filename hashing](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L4520-L4541) - [Two-pass compute path](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/hle/d3d12x/real.rs#L6140-L6146) A standalone Linux microbenchmark (extracted key functions compiled with `rustc -O` on synthetic byte buffers, Ryzen AI 7 350, three runs) measured median disk-name costs of ~0.85 ms for 1 MiB and ~3.42 ms for 4 MiB, versus ~0.14 ms and ~0.55 ms for `compute_blob_key`. Those are isolated component timings, not full title runs. Please verify on Windows by measuring the count and total DXIL bytes of accepted `COMPUTE_BLOBS` RAM hits during a warm world load, and comparing time before the driver call with disk-path construction deferred until RAM miss or cache writeback (keeping disk filenames and cold/rejected-blob behavior unchanged). Duplicate check: screened open issues and PRs (including drafts); PR #2723 modifies descriptor inputs and still builds the disk path eagerly, and PR #2767 covers DXIL copies. AI use: Gemini 4 Hydrogen (via Antigravity CLI) verified the source locations and filed this verification request based on the earlier Codex-assisted static review and Linux component microbenchmark recorded in `docs/pso-performance-audit.md`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:12:48 +00:00
Author
Owner

@⁠CryingLaughing on GitHub · 2026-11-27 02:45 UTC · original · edited 2026-11-27 03:02 UTC

I measured the finish_two_pass compute path with the existing synthetic mesh and legacy geometry fixtures. Builds used pinned main 8b957bec6f82495aec940944c6bf47faa02db590 and #2909 head 67c26e28f4d5d148595923ebb254205b07164b83, with a passive timing observer and the same fixture on both revisions. Each of three fresh processes per revision performed two cold creates and 64 warm creates with disk caching enabled. Both revisions supplied and accepted RAM blobs on all 192 warm creates. All 24 GPU readbacks matched, and all six processes produced the same four cold driver filenames.

Compute source DXIL bytes per create RAM hits per revision Main warm disk filenames #2909 warm disk filenames Median warm preparation on main Median on #2909
Mesh shader 6,576 96 96 0 9.70 µs 2.20 µs
Legacy geometry shader 7,676 96 96 0 10.75 µs 2.40 µs

The eager path hashed 1,368,192 DXIL bytes for disk filenames across those warm hits. The lazy path hashed zero. The measured interval starts before the RAM-key hash and ends before the native driver call. It is instrumented elapsed time. The fixture used the existing retention override since both compute shaders are smaller than the 16 KiB production threshold. Retail world-load hit rate and elapsed time remain unmeasured.

Tested. Windows 11 25H2 build 26200.9974, Core i5-13600K, GeForce RTX 4080 on driver 621.01, Rust 1.100.0 MSVC and DXC 1.8.2502.11, release. Six interleaved, serial processes reported 6 passed, 0 failed, 0 ignored, 0 capability skips in total. Each process used a fresh private XCL_DXIL_CACHE and XCL_DATA_ROOT, with XCL_TEST_TWO_PASS_RAM_PROFILE=1 XCL_PSO_DISK_CACHE=1 XCL_PSO_PRELOAD=0 XCL_ASYNC_PSO=0 XCL_NETWORK=0 XCL_ADAPTER=4080 and the Windows SDK 10.0.26100.0 x64 DXC.

cargo test -p xcl --test gpu_two_pass_cache_e2e --release --locked --offline -j 4 --no-run --message-format=json
& $testExecutable --exact two_pass_compute_ram_hit_profile --nocapture --test-threads=1

Main observer and serial runner a7b75f694c0d98924d77a3a40290efdc323ffd15 · Same fixture on #2909 1d62b27ef5a4f1c0b2b68ca844933ccf5fa185f5

AI use

  • OpenAI Codex (GPT-6, exact serving variant unavailable) wrote the measurement overlay and serial runner, ran and analysed the synthetic comparison, and drafted this report. The comparison used the existing XCL fixtures and real-alponzo's #2909 implementation.
**@⁠CryingLaughing** on GitHub · 2026-11-27 02:45 UTC · [original](https://github.com/xcl-dev/xcl/issues/2883#issuecomment-7208407388) · edited 2026-11-27 03:02 UTC I measured the `finish_two_pass` compute path with the existing synthetic mesh and legacy geometry fixtures. Builds used pinned main `8b957bec6f82495aec940944c6bf47faa02db590` and #2909 head `67c26e28f4d5d148595923ebb254205b07164b83`, with a passive timing observer and the same fixture on both revisions. Each of three fresh processes per revision performed two cold creates and 64 warm creates with disk caching enabled. Both revisions supplied and accepted RAM blobs on all 192 warm creates. All 24 GPU readbacks matched, and all six processes produced the same four cold driver filenames. | Compute source | DXIL bytes per create | RAM hits per revision | Main warm disk filenames | #2909 warm disk filenames | Median warm preparation on main | Median on #2909 | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | Mesh shader | 6,576 | 96 | 96 | 0 | 9.70 µs | 2.20 µs | | Legacy geometry shader | 7,676 | 96 | 96 | 0 | 10.75 µs | 2.40 µs | The eager path hashed 1,368,192 DXIL bytes for disk filenames across those warm hits. The lazy path hashed zero. The measured interval starts before the RAM-key hash and ends before the native driver call. It is instrumented elapsed time. The fixture used the existing retention override since both compute shaders are smaller than the 16 KiB production threshold. Retail world-load hit rate and elapsed time remain unmeasured. **Tested.** Windows 11 25H2 build 26200.9974, Core i5-13600K, GeForce RTX 4080 on driver 621.01, Rust 1.100.0 MSVC and DXC 1.8.2502.11, release. Six interleaved, serial processes reported **6 passed, 0 failed, 0 ignored, 0 capability skips** in total. Each process used a fresh private `XCL_DXIL_CACHE` and `XCL_DATA_ROOT`, with `XCL_TEST_TWO_PASS_RAM_PROFILE=1 XCL_PSO_DISK_CACHE=1 XCL_PSO_PRELOAD=0 XCL_ASYNC_PSO=0 XCL_NETWORK=0 XCL_ADAPTER=4080` and the Windows SDK 10.0.26100.0 x64 DXC. ```powershell cargo test -p xcl --test gpu_two_pass_cache_e2e --release --locked --offline -j 4 --no-run --message-format=json & $testExecutable --exact two_pass_compute_ram_hit_profile --nocapture --test-threads=1 ``` [Main observer and serial runner `a7b75f694c0d98924d77a3a40290efdc323ffd15`](https://github.com/CryingLaughing/xcl/commit/a7b75f694c0d98924d77a3a40290efdc323ffd15) · [Same fixture on #2909 `1d62b27ef5a4f1c0b2b68ca844933ccf5fa185f5`](https://github.com/CryingLaughing/xcl/commit/1d62b27ef5a4f1c0b2b68ca844933ccf5fa185f5) **AI use** - OpenAI Codex (GPT-6, exact serving variant unavailable) wrote the measurement overlay and serial runner, ran and analysed the synthetic comparison, and drafted this report. The comparison used the existing XCL fixtures and real-alponzo's #2909 implementation.
This discussion has been locked. Commenting is limited to contributors.
No description provided.