Skip to content

BUILD-1303: read pipeline checker cache seeds in blocks - #5291

Open
TG0000 wants to merge 2 commits into
ItsNotRexed:mainfrom
TG0000:codex/pipeline-cache-bulk-read
Open

TG0000 wants to merge 2 commits into
ItsNotRexed:mainfrom
TG0000:codex/pipeline-cache-bulk-read

Conversation

@TG0000

@TG0000 TG0000 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What changes

Load an existing vk_pipeline_check seed into a buffer sized from the opened file. Read in 16 MiB chunks and pass a seed to Vulkan only after a complete read. Missing, empty, non-regular and unreadable seed files leave the checker able to build a cache from scratch.

BUILD-1303 — claimed in coordination and carried forward to #5256. Independent of #1096. If that PR lands first, the new helper accepts a filesystem::path, so keep its UTF-8 diagnostic next to the helper call.

Validation

  • Passed the pipeline_cache_file, pipeline_cache_snapshot and vk_pipeline_check_cli CTests on Windows 11, on the exact tree obtained by merging this patch with current main.
  • Ryzen 9 5900X, LLVM-MinGW Clang 23.1.6 -O2, warm filesystem cache, six alternating pairs. The upper median read time for a 539,388-byte cache generated by the AMD driver fell from 3.5 to 0.4 ms. A 120,337,044-byte synthetic file fell from 561.4 to 43.1 ms and was only used for the I/O benchmark. Both readers returned identical bytes in every pair.
  • Radeon RX 6800, driver 32.0.21045.29003. The baseline produced a cold cache from 104 synthetic compute pipelines. The patched checker read that cache and reported 104/104 hits, zero pipeline failures and zero skips, using the same executable path for both versions to hold the AMD driver's cache identity constant.

AI-assisted (OpenAI Codex). All shader inputs were generated fixtures.

Depends on: #1096

This records the seed-read hunk overlap. This PR can land independently. After #1096's rebase, keep the bulk-read helper call and the UTF-8 diagnostic from #1096.

An independent RTX 3080 Ti run reproduced 6/6 cache hits with a seed from the baseline; the Radeon run reported 104/104.

@TimIdle

TimIdle commented Nov 23, 2026

Copy link
Copy Markdown

Windows test result for head 9bfe3db.

Windows 11 Home (10.0.26300), MSVC 14.44 (VS 2022 BuildTools), CMake and Ninja from VS, CPython 3.14.10, CPU only, no game files.

  • Built pipeline_cache_file_test (RelWithDebInfo) and ran ctest -R pipeline_cache_file: 1/1 passed.

The configure warned that Vulkan headers are missing on this PC, so vk_pipeline_check and the D3D12 tools were not built. The vk_pipeline_check.cpp change is not covered by this run.

AI-assisted (Claude Code)

@kacper-serewis kacper-serewis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Windows CPU review at 9bfe3db. The production seed reader returned every expected byte at 16 MiB − 1, exactly 16 MiB, 16 MiB + 1 and 32 MiB + 137. With the last byte of the 16 MiB + 1 file locked, an independent stream could read the entire first block and failed on the final byte. The production reader discarded the prefix and returned an empty vector. Unlocking the byte restored a complete byte-for-byte read. AI-assisted synthetic check.

@thehollowedone

thehollowedone commented Nov 23, 2026 •

Copy link
Copy Markdown

Independent NVIDIA cache check for 9bfe3db4. Windows 11 x64 build 26300, RTX 3080 Ti / 621.35, MSVC 19.44.35230, Windows SDK 10.0.26100.0, Vulkan SDK 1.4.363.0, RelWithDebInfo.

Using the same checker executable path and six synthetic compute modules, merge base 03b09a08 generated a 35,974-byte seed with 0/6 reported hits. The exact PR checker loaded that seed and reported 6/6 hits. The same checker with a fresh cache path reported 0/6. All six pipelines succeeded in every run with zero skips or Vulkan validation errors. All six modules passed spirv-val.

A separate local integration onto target tip 3faac557 also loaded that base checker's seed with 6/6 hits. This run covered GPU seed reuse. AI-assisted.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head 9bfe3db4a on 03b09a0 (MERGEABLE with 3faac55). Windows 11, MSVC 19.44.35228, RelWithDebInfo, Ninja.

  • Configured and built pipeline_cache_file_test, pipeline_cache_snapshot_test and vk_pipeline_check in build-review-5291.
  • ctest -R "pipeline_cache_file|pipeline_cache_snapshot|vk_pipeline_check_cli" --output-on-failure -> 3/3 passed (0.56 s, 0.07 s, 0.24 s), 100%.
  • Extra probe of the new reader (not in the PR): round-tripped 16,778,450 bytes (past 16 MiB, a partial chunk and a tail) -> bytes identical; missing file, directory and empty file return empty.
  • git diff --check origin/main...HEAD clean.

read_pipeline_cache_file bounds itself with is_regular_file/tellg/seekg, reads 16 MiB chunks, and returns empty on every failure so Vulkan gets no seed and can still build a cache from scratch. The in-tree test stays below 16 MiB, but the chunk boundary is correct (probe above). Approve.

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested 9bfe3db on NVIDIA GeForce RTX 4080, driver 617.42: pipeline_cache_file_test exits 0. It prints nothing on a pass, so exit 0 is the only result. vk_pipeline_check_cli and pipeline_cache_snapshot were not run.

AI-assisted.

@itsonlysimbo

Copy link
Copy Markdown
Contributor

Tested 9bfe3db4 merged onto main 3faac557 (merges cleanly) on RTX 4070, NVIDIA 621.14, Windows 11 (10.0.26300), MSVC 19.44, Ninja, RelWithDebInfo, Vulkan SDK 1.4.363: pass.

  • pipeline_cache_file and vk_pipeline_check_cli pass.
  • ctest: 169 passed, 9 skipped, 0 failed; run_gpu_tests.py: 170/217 passed, 47 skipped, 0 failed, same as main.

AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants