runtime: verify offline compute pipeline journal hits (RT-NATIVE-COMPUTE-WARMUP) #2198

Closed
sodove wants to merge 2 commits from upstream-pr/2198 into main
sodove commented 2026-11-26 05:23:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-26T05:23:56Z.


Claimed in the coordination issue as RT-NATIVE-COMPUTE-WARMUP.

What and why

The offline compute compiler from #2098 can skip an entry when the cache file has a compatible header. A compatible file can still miss the requested pipeline on the next boot. This adds gta6rt --precompile-pipelines --verify to check the selected entries in a fresh process before starting the game. It uses the existing shader library, pipeline keys, layouts, and selection options.

Each probe supplies just that entry’s local journal file to Vulkan and sets FAIL_ON_PIPELINE_COMPILE_REQUIRED. A verified entry requires valid application-cache-hit feedback from the driver. The command reports missing files, unconfirmed hits, and errors. It exits successfully only for a nonempty, fully verified selection. The probe leaves journal bytes and modification times intact and performs no cache repair. This also lets someone measure what a repair such as #2179 accomplished.

The new mode is based directly on main. It has no dependency on the open DXBC helper in #1308.

Tested

  • Built gta6rt with MSVC, RelWithDebInfo, on Windows 11.
  • Ran the fresh-process synthetic fixture with --require-hit on an NVIDIA GeForce RTX 5070 Ti (610.74) and AMD Radeon(TM) Graphics (32.0.21045.29003). Both drivers confirmed the intended hit. The fixture also covers a valid cache from a different shader, missing files, header-only files, mixed selections with missing input, and unchanged contents and timestamps.
  • An offline check over eight selected local compute entries confirmed 8/8 hits and preserved all five distinct journal files.
  • Five focused CTests passed, including precompile_verify and the four pipeline-cache file, store, journal, and snapshot tests. The semantic suite ran 6,351 tests across 498 files with zero failing files. All three text line-ending tests passed. The changed-file game-data scan and git diff --check passed.

AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5504514705 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2198). Originally posted by [sodove](https://github.com/sodove) on 2026-11-26T05:23:56Z. --- Claimed in the coordination issue as [RT-NATIVE-COMPUTE-WARMUP](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7183219099). ### What and why The offline compute compiler from #2098 can skip an entry when the cache file has a compatible header. A compatible file can still miss the requested pipeline on the next boot. This adds `gta6rt --precompile-pipelines --verify` to check the selected entries in a fresh process before starting the game. It uses the existing shader library, pipeline keys, layouts, and selection options. Each probe supplies just that entry’s local journal file to Vulkan and sets `FAIL_ON_PIPELINE_COMPILE_REQUIRED`. A verified entry requires valid application-cache-hit feedback from the driver. The command reports missing files, unconfirmed hits, and errors. It exits successfully only for a nonempty, fully verified selection. The probe leaves journal bytes and modification times intact and performs no cache repair. This also lets someone measure what a repair such as #2179 accomplished. The new mode is based directly on main. It has no dependency on the open DXBC helper in #1308. ### Tested - Built `gta6rt` with MSVC, RelWithDebInfo, on Windows 11. - Ran the fresh-process synthetic fixture with `--require-hit` on an NVIDIA GeForce RTX 5070 Ti (610.74) and AMD Radeon(TM) Graphics (32.0.21045.29003). Both drivers confirmed the intended hit. The fixture also covers a valid cache from a different shader, missing files, header-only files, mixed selections with missing input, and unchanged contents and timestamps. - An offline check over eight selected local compute entries confirmed 8/8 hits and preserved all five distinct journal files. - Five focused CTests passed, including `precompile_verify` and the four pipeline-cache file, store, journal, and snapshot tests. The semantic suite ran 6,351 tests across 498 files with zero failing files. All three text line-ending tests passed. The changed-file game-data scan and `git diff --check` passed. AI-assisted: yes.
lixonik commented 2026-11-26 11:03:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T11:03:01Z.

Review: COMMENTED


Built gta6rt with MSVC at this head and ran its fresh-process fixture with --require-hit on Windows 11. It confirmed an application-cache hit and passed the negative cases for a different shader cache, missing/header-only entries, a mixed selection, and external seed data. The fixture also verified that journal contents and timestamps stayed unchanged. GPU: NVIDIA GeForce RTX 5070, driver 610.88. No findings from these synthetic checks.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6072989345 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2198#pullrequestreview-6072989345). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-26T11:03:01Z. **Review:** COMMENTED --- Built `gta6rt` with MSVC at this head and ran its fresh-process fixture with `--require-hit` on Windows 11. It confirmed an application-cache hit and passed the negative cases for a different shader cache, missing/header-only entries, a mixed selection, and external seed data. The fixture also verified that journal contents and timestamps stayed unchanged. GPU: NVIDIA GeForce RTX 5070, driver 610.88. No findings from these synthetic checks. AI-assisted.
Tyrannys commented 2026-11-26 13:23:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-26T13:23:43Z.


Independent verification of head 95267b8c7bba786e356bef364dc25862a26ebab8, with current main (a73a57e13) merged in, no conflicts.

Windows 11 Pro, RTX 4070 SUPER (NVIDIA 621.01), MSVC 19.52.37029, RelWithDebInfo.

  • New precompile_verify (ctest): passes, 24 s. Output: "Verified read-only journal checks; driver reported application-cache hit: True". So NVIDIA 621.01 does set the application-cache-hit feedback bit for a journal entry.
  • Neighbours pipeline_cache_file, pipeline_cache_store, pipeline_cache_journal, compile_helper and the run_tiny_* tests pass.
  • Full suite with the PR: 475/478. xbox_present and d3d12_set_descriptor_heaps fail on plain main too. d3d12_queue_wait_timeout timed out once under ctest -j 4 and passed when run alone.
  • No run against main: the test drives the new --verify option, which main does not have.

Diff read: the verify path opens the journal entry read-only, with a size limit, and pipeline_cache_path(false) no longer creates the cache folder only to name a journal file. No problem found.

No game files used. AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7193290837 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2198#issuecomment-7193290837). Originally posted by [Tyrannys](https://github.com/Tyrannys) on 2026-11-26T13:23:43Z. --- **Independent verification** of head `95267b8c7bba786e356bef364dc25862a26ebab8`, with current `main` (`a73a57e13`) merged in, no conflicts. Windows 11 Pro, RTX 4070 SUPER (NVIDIA 621.01), MSVC 19.52.37029, RelWithDebInfo. - New `precompile_verify` (ctest): **passes**, 24 s. Output: "Verified read-only journal checks; driver reported application-cache hit: True". So NVIDIA 621.01 does set the application-cache-hit feedback bit for a journal entry. - Neighbours `pipeline_cache_file`, `pipeline_cache_store`, `pipeline_cache_journal`, `compile_helper` and the `run_tiny_*` tests pass. - Full suite with the PR: 475/478. `xbox_present` and `d3d12_set_descriptor_heaps` fail on plain `main` too. `d3d12_queue_wait_timeout` timed out once under `ctest -j 4` and passed when run alone. - No run against `main`: the test drives the new `--verify` option, which `main` does not have. Diff read: the verify path opens the journal entry read-only, with a size limit, and `pipeline_cache_path(false)` no longer creates the cache folder only to name a journal file. No problem found. No game files used. AI-assisted (Claude Code).
zmasi commented 2026-11-29 00:36:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T00:36:34Z.


Windows 11 + MSVC 19.44 + RTX 3090 Verification — PASS (b5682061b5)

Verified b5682061b5 (RT-NATIVE-COMPUTE-WARMUP) merged onto origin/main (829530dbd0 and 48bae6cade, 0 conflicts, plus a 5-way combined merge alongside #1918, #1579, #1628, and #900) on native Windows 11 (10.0.26200.9974) with MSVC 19.44.35228 and NVIDIA GeForce RTX 3090.

Checks Run

  • Red (origin/main):
    • gta6rt --precompile-pipelines --verify rejected at CLI argument parsing (rc=2), and scripts/check_precompile_verify.py is absent.
  • Green (#2198 + origin/main on NVIDIA GeForce RTX 3090):
    • Built gta6rt.exe with LEONIDA_VULKAN_DEVICE (/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8 /bigobj) -> rc=0.
    • Ran python -I scripts/check_precompile_verify.py <gta6rt.exe> --require-hit on NVIDIA GeForce RTX 3090 -> rc=0 (Verified read-only journal checks; driver reported application-cache hit: True), confirming all five end-to-end assertions:
      1. --verify without --precompile-pipelines exits 2.
      2. Missing pipeline cache exits 1 ("pipeline cache missing") without creating %LOCALAPPDATA%\Leonida\cache (pipeline_cache_path(false) read-only path).
      3. Truncated 4-byte pipeline cache exits 1.
      4. Unwarmed compute journal entry exits 1 ("0 hit, 1 cold") under VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT.
      5. Offline warmup of the synthetic 10-line SPIR-V compute shader followed by --precompile-pipelines --verify exits 0 ("1 hit, 0 cold"), with VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT reported by the NVIDIA RTX 3090 driver.
  • Documentation & registration suites: tests/test_docs_encoding.py, tests/test_ctest_registration.py, and tests/test_ci_registration.py passed (rc=0), and tests/test_docs_cli_flags.py reported 0 errors on --verify (matching origin/main baseline).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248230797 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2198#issuecomment-7248230797). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T00:36:34Z. --- ## Windows 11 + MSVC `19.44` + RTX 3090 Verification — PASS (`b5682061b5`) Verified `b5682061b5` (`RT-NATIVE-COMPUTE-WARMUP`) merged onto `origin/main` (`829530dbd0` and `48bae6cade`, `0` conflicts, plus a 5-way combined merge alongside `#1918`, `#1579`, `#1628`, and `#900`) on native Windows 11 (`10.0.26200.9974`) with MSVC `19.44.35228` and **NVIDIA GeForce RTX 3090**. ### Checks Run - **Red (`origin/main`)**: - `gta6rt --precompile-pipelines --verify` rejected at CLI argument parsing (`rc=2`), and `scripts/check_precompile_verify.py` is absent. - **Green (`#2198 + origin/main` on NVIDIA GeForce RTX 3090)**: - Built `gta6rt.exe` with `LEONIDA_VULKAN_DEVICE` (`/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8 /bigobj`) -> `rc=0`. - Ran `python -I scripts/check_precompile_verify.py <gta6rt.exe> --require-hit` on **NVIDIA GeForce RTX 3090** -> **`rc=0`** (`Verified read-only journal checks; driver reported application-cache hit: True`), confirming all five end-to-end assertions: 1. `--verify` without `--precompile-pipelines` exits `2`. 2. Missing pipeline cache exits `1` (`"pipeline cache missing"`) without creating `%LOCALAPPDATA%\Leonida\cache` (`pipeline_cache_path(false)` read-only path). 3. Truncated 4-byte pipeline cache exits `1`. 4. Unwarmed compute journal entry exits `1` (`"0 hit, 1 cold"`) under `VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT`. 5. Offline warmup of the synthetic 10-line SPIR-V compute shader followed by `--precompile-pipelines --verify` exits `0` (`"1 hit, 0 cold"`), with `VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT` reported by the NVIDIA RTX 3090 driver. - **Documentation & registration suites**: `tests/test_docs_encoding.py`, `tests/test_ctest_registration.py`, and `tests/test_ci_registration.py` passed (`rc=0`), and `tests/test_docs_cli_flags.py` reported `0` errors on `--verify` (matching `origin/main` baseline). AI-assisted.
timbot103 commented 2026-11-29 04:28:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:28:21Z.

Review: COMMENTED


Static audit of b5682061b against b6bf3aa0b. No builds, tests, or GPU runs were performed. The Vulkan 1.3 path enables pipelineCreationCacheControl before the verifier can set the cache-only flag, as required by VUID-VkComputePipelineCreateInfo-pipelineCreationCacheControl-02878. The verifier exits during setup when that path is unavailable and requires valid application-cache-hit feedback for a hit.

  • Major runtime/shims/d3d12_vulkan_device.cpp:11778 can pass a partially truncated journal blob to Vulkan. Keeping the compatible header and some payload passes the current checks, but the supplied size then differs from the size returned by vkGetPipelineCacheData, violating VUID-VkPipelineCacheCreateInfo-initialDataSize-00768. Record and validate the original length and a checksum before handing the blob to Vulkan, and add a fixture case that preserves the header and part of the payload.
  • Minor runtime/CMakeLists.txt:4545 can report a passing test even if the verifier never confirms a hit. The default fixture accepts an unverified result after warmup at scripts/check_precompile_verify.py:123, and the wrong-cache check at scripts/check_precompile_verify.py:145 gives the same expected outcome for a compile-required result and a successful pipeline without hit feedback. Add a deterministic test that asserts the cache-only flag and verifies both the hit and compile-required cases.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6101399276 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2198#pullrequestreview-6101399276). Originally posted by [timbot103](https://github.com/timbot103) on 2026-11-29T04:28:21Z. **Review:** COMMENTED --- Static audit of `b5682061b` against `b6bf3aa0b`. No builds, tests, or GPU runs were performed. The Vulkan 1.3 path enables `pipelineCreationCacheControl` before the verifier can set the cache-only flag, as required by `VUID-VkComputePipelineCreateInfo-pipelineCreationCacheControl-02878`. The verifier exits during setup when that path is unavailable and requires valid application-cache-hit feedback for a hit. - **Major** `runtime/shims/d3d12_vulkan_device.cpp:11778` can pass a partially truncated journal blob to Vulkan. Keeping the compatible header and some payload passes the current checks, but the supplied size then differs from the size returned by `vkGetPipelineCacheData`, violating `VUID-VkPipelineCacheCreateInfo-initialDataSize-00768`. Record and validate the original length and a checksum before handing the blob to Vulkan, and add a fixture case that preserves the header and part of the payload. - **Minor** `runtime/CMakeLists.txt:4545` can report a passing test even if the verifier never confirms a hit. The default fixture accepts an unverified result after warmup at `scripts/check_precompile_verify.py:123`, and the wrong-cache check at `scripts/check_precompile_verify.py:145` gives the same expected outcome for a compile-required result and a successful pipeline without hit feedback. Add a deterministic test that asserts the cache-only flag and verifies both the hit and compile-required cases. AI-assisted.
OreoFR commented 2026-11-29 14:58:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T14:58:39Z.


TAKEN by OreoFR (Windows, RTX 4070 8 GB)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257722376 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2198#issuecomment-7257722376). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T14:58:39Z. --- TAKEN by OreoFR (Windows, RTX 4070 8 GB)
OreoFR commented 2026-11-29 21:33:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T21:33:07Z.


Verified by OreoFR — READY

  • Base: main c22a0a732 + this PR (head b5682061b) merged with --no-ff
  • Red (main + only this PR's test and its CMake registration): the new ctest precompile_verify fails on main: main's gta6rt has no --verify, so the first verify run exits 2 without the expected selected=1 verified=0 missing_or_unusable=1 unverified=0 errors=0 summary.
  • Green (merge): precompile_verify passes (116 s); ctest (Ninja RelWithDebInfo, all targets, gta6rt launchers excluded) in package p1 = main + #2198 + #2333 + #2308 + #2268 (no shared files): 506 tests, new failures vs main: none. d3d12_queue_wait_timeout, d3d12_pipeline_workers and dxgi_waitable_latency failed in the parallel run and pass when re-run alone (main alone: 505 tests, 6 failures: big_compile_gate and api_ref_state and d3d12_queue_wait_timeout timeouts, xs_proxy_mock, vk_compile_gate_calibration, xbox_present; xbox_present fails in every package as on main)
  • gta6rt.exe links without the XMA decoder (LEONIDA_CARGO=OFF, LEONIDA_XMA2_DECODER_LIB empty) in package p1; imports unchanged vs main (25 DLLs, 755 functions, no WS2_32)
  • Diff read: no issue. --verify probes each local journal file in its own cache with FAIL_ON_PIPELINE_COMPILE_REQUIRED, skips the shared cache, upkeep and writes (pipeline_cache_path(false) no longer creates the directory), and is refused together with --list, --all or --via-helper.
  • Other runs: Consistent with Tyrannys's and zmasi's runs and lixonik's and timbot103's reviews.
  • Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44

Ready to merge per the maintainers' plan.

AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7262965033 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2198#issuecomment-7262965033). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T21:33:07Z. --- **Verified by OreoFR** — READY - Base: main c22a0a732 + this PR (head b5682061b) merged with --no-ff - Red (main + only this PR's test and its CMake registration): the new ctest `precompile_verify` fails on main: main's gta6rt has no `--verify`, so the first verify run exits 2 without the expected `selected=1 verified=0 missing_or_unusable=1 unverified=0 errors=0` summary. - Green (merge): `precompile_verify` passes (116 s); ctest (Ninja RelWithDebInfo, all targets, gta6rt launchers excluded) in package p1 = main + #2198 + #2333 + #2308 + #2268 (no shared files): 506 tests, new failures vs main: none. `d3d12_queue_wait_timeout`, `d3d12_pipeline_workers` and `dxgi_waitable_latency` failed in the parallel run and pass when re-run alone (main alone: 505 tests, 6 failures: big_compile_gate and api_ref_state and d3d12_queue_wait_timeout timeouts, xs_proxy_mock, vk_compile_gate_calibration, xbox_present; xbox_present fails in every package as on main) - gta6rt.exe links without the XMA decoder (`LEONIDA_CARGO=OFF`, `LEONIDA_XMA2_DECODER_LIB` empty) in package p1; imports unchanged vs main (25 DLLs, 755 functions, no WS2_32) - Diff read: no issue. `--verify` probes each local journal file in its own cache with `FAIL_ON_PIPELINE_COMPILE_REQUIRED`, skips the shared cache, upkeep and writes (`pipeline_cache_path(false)` no longer creates the directory), and is refused together with `--list`, `--all` or `--via-helper`. - Other runs: Consistent with Tyrannys's and zmasi's runs and lixonik's and timbot103's reviews. - Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44 Ready to merge per the maintainers' plan. AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
aslan2142 commented 2026-12-01 17:25:33 +00:00 (Migrated from github.com)

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


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:7319278140 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2198#issuecomment-7319278140). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T17:25:33Z. --- 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!2198
No description provided.