vk_pipeline_check: add no application cache mode #2170

Closed
ZroIsHere wants to merge 1 commit from upstream-pr/2170 into main
ZroIsHere commented 2026-11-26 01:24:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ZroIsHere on 2026-11-26T01:24:03Z.


Claimed: VK-PIPELINE-CHECK-NO-APP-CACHE

Follow-up to the driver-cache investigation in https://github.com/ubiquitarianism/leonida/issues/559.

Add --no-pipeline-cache to let vk_pipeline_check compare app-cache-enabled and app-cache-disabled pipeline creation. The option passes VK_NULL_HANDLE, skips cache creation and persistence, propagates through --isolate, and rejects a positional cache path. It leaves the default mode unchanged. The driver's own internal/on-disk caches may still affect results.

Validation: git diff --check passed. Tests and builds were not run.

AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5502216763 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2170). Originally posted by [ZroIsHere](https://github.com/ZroIsHere) on 2026-11-26T01:24:03Z. --- Claimed: VK-PIPELINE-CHECK-NO-APP-CACHE Follow-up to the driver-cache investigation in https://github.com/ubiquitarianism/leonida/issues/559. Add `--no-pipeline-cache` to let `vk_pipeline_check` compare app-cache-enabled and app-cache-disabled pipeline creation. The option passes `VK_NULL_HANDLE`, skips cache creation and persistence, propagates through `--isolate`, and rejects a positional cache path. It leaves the default mode unchanged. The driver's own internal/on-disk caches may still affect results. Validation: `git diff --check` passed. Tests and builds were not run. AI-assisted: yes.
Tyrannys commented 2026-11-27 14:51:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-27T14:51:11Z.


Independent verification of head 072a9275f merged into current main (ec91d695c), no conflicts. The PR says it was not built or run, so I built and ran it.

Machine: profile M (RTX 4070 SUPER 12 GB desktop, NVIDIA 621.01, Windows 11 Pro 26300, Ryzen 7 9800X3D), MSVC 14.52 (VS 2026, MSBuild generator), RelWithDebInfo, LEONIDA_SDL3_FETCH=ON. No game files.

Build: vk_pipeline_check builds with no new warnings. vk_pipeline_check_cli and vk_pipeline_check_stack pass.

Runs by hand on a small synthetic corpus I made (4 trivial compute shaders compiled with glslangValidator, index.json in the format pipeline_cache_seed_test uses; no game shaders):

run result
<dir> c.bin --no-pipeline-cache exit 2, --no-pipeline-cache cannot be combined with cache.bin
<dir> --no-pipeline-cache --cache-feedback 4/4 ok, 0 hits, 4 no hit reported, stderr says application pipeline cache: disabled (driver-internal caches may still be active), no file written
<dir> c.bin --cache-feedback (first) 4/4 ok, 0 hits, cache saved (25710 bytes)
<dir> c.bin --cache-feedback (second) 4/4 ok, 4 hits
<dir> --no-pipeline-cache --cache-feedback (after that) 4/4 ok, 0 hits
<dir> --no-pipeline-cache --stats st.csv 4/4 ok, statistics written
<dir> --no-pipeline-cache --isolate 4/4 ok

So on NVIDIA the option does what it says: the application cache hits go away even when the driver has just seen the same pipelines, and the default mode still hits.

Diff read: save_cache returns early when cache_path is empty, and the new check makes sure it is empty with --no-pipeline-cache, so vkGetPipelineCacheData is never called on a null cache. vkDestroyPipelineCache with VK_NULL_HANDLE is allowed.

Small doc point: docs/pipeline_check.md says --isolate is POSIX only, but --isolate ran here on Windows. That is not from this PR.

Full suite: this PR was tested together with #2173, #2152, #2170 and #2215 (they touch separate code) merged into main ec91d695c. ctest -j 6: 500/502; the two failures, xbox_present and d3d12_set_descriptor_heaps, fail on plain main here as well (known). Plain main baseline (first run in a fresh build dir): same two, plus xs_proxy_mock, d3d12_queue_handover_two_queues and timeouts in big_compile_gate and api_ref_state that still failed in a serial rerun there but pass on this tree. I take those as first-run noise on main, not as something this PR fixes. No new failure.

No problems found.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7221310383 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2170#issuecomment-7221310383). Originally posted by [Tyrannys](https://github.com/Tyrannys) on 2026-11-27T14:51:11Z. --- Independent verification of head `072a9275f` merged into current `main` (`ec91d695c`), no conflicts. The PR says it was not built or run, so I built and ran it. Machine: profile M (RTX 4070 SUPER 12 GB desktop, NVIDIA 621.01, Windows 11 Pro 26300, Ryzen 7 9800X3D), MSVC 14.52 (VS 2026, MSBuild generator), RelWithDebInfo, `LEONIDA_SDL3_FETCH=ON`. No game files. **Build:** `vk_pipeline_check` builds with no new warnings. `vk_pipeline_check_cli` and `vk_pipeline_check_stack` pass. **Runs by hand** on a small synthetic corpus I made (4 trivial compute shaders compiled with glslangValidator, `index.json` in the format `pipeline_cache_seed_test` uses; no game shaders): | run | result | |---|---| | `<dir> c.bin --no-pipeline-cache` | exit 2, `--no-pipeline-cache cannot be combined with cache.bin` | | `<dir> --no-pipeline-cache --cache-feedback` | 4/4 ok, `0 hits, 4 no hit reported`, stderr says `application pipeline cache: disabled (driver-internal caches may still be active)`, no file written | | `<dir> c.bin --cache-feedback` (first) | 4/4 ok, 0 hits, cache saved (25710 bytes) | | `<dir> c.bin --cache-feedback` (second) | 4/4 ok, **4 hits** | | `<dir> --no-pipeline-cache --cache-feedback` (after that) | 4/4 ok, 0 hits | | `<dir> --no-pipeline-cache --stats st.csv` | 4/4 ok, statistics written | | `<dir> --no-pipeline-cache --isolate` | 4/4 ok | So on NVIDIA the option does what it says: the application cache hits go away even when the driver has just seen the same pipelines, and the default mode still hits. **Diff read:** `save_cache` returns early when `cache_path` is empty, and the new check makes sure it is empty with `--no-pipeline-cache`, so `vkGetPipelineCacheData` is never called on a null cache. `vkDestroyPipelineCache` with `VK_NULL_HANDLE` is allowed. Small doc point: `docs/pipeline_check.md` says `--isolate` is POSIX only, but `--isolate` ran here on Windows. That is not from this PR. **Full suite:** this PR was tested together with #2173, #2152, #2170 and #2215 (they touch separate code) merged into `main` `ec91d695c`. `ctest -j 6`: 500/502; the two failures, `xbox_present` and `d3d12_set_descriptor_heaps`, fail on plain `main` here as well (known). Plain `main` baseline (first run in a fresh build dir): same two, plus `xs_proxy_mock`, `d3d12_queue_handover_two_queues` and timeouts in `big_compile_gate` and `api_ref_state` that still failed in a serial rerun there but pass on this tree. I take those as first-run noise on `main`, not as something this PR fixes. No new failure. No problems found. AI-assisted (Claude Code).
aslan2142 commented 2026-12-01 17:25:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:25:16Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7319270859 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2170#issuecomment-7319270859). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T17:25:16Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
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
ProjectLeonida/mandy!2170
No description provided.