Repository navigation
Conversation
…-AND-DONE-LIST) Every checker process of the pipelines stage loaded the whole pipeline_cache.bin (9.6 GB for the full set on NVIDIA) and saved it back, and a rerun checked all 26,503 modules again. Now, with a checker that has the new options: - each process, crash probe and the BVH pass writes its own shard cache in pipeline_shards/, and the shards are merged into pipeline_cache.bin once at the end with vkMergePipelineCaches (vk_pipeline_check --merge). A stopped run keeps its shards for the next one; a good merge removes them. - pipeline_done.json records each module that passed (--done-file) by the SHA-256 of its .spv and index entry. A rerun skips those, so only modules whose SPIR-V changed are built. The list is tied to the GPU and driver (--device-info: vendor/device ID, driver version, pipelineCacheUUID), the checker, the partner stubs and the cache file the last merge wrote. - the first run over a cache from before the list keeps the old per-process load and save, so what that cache holds still compiles from it. Crash recovery is unchanged: the in-flight file, the skip file, the single module probes and range splitting work on the list of modules still to check, selected with --names-file. An older checker keeps the --start/--count path. The checker also reads its seed cache in one call (2 GiB: 21.6 s -> 1.7 s). Tests: the batch orchestration tests run with both checker generations plus done-list cases; CTest pipeline_cache_header (no device) and vk_pipeline_check_merge (GPU, synthetic shaders: a merged cache gives six application-cache hits, one shard alone three). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When only the checker or the partner stubs change, the done-list no longer holds, but every pipeline in pipeline_cache.bin is still this driver's. Check every module again by checkpointing into that cache for this one run, as the first run over an old cache does, instead of starting empty shards that compile everything from scratch. Leftover shards of the same driver are kept and merged. A new GPU or driver still starts from empty shards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ards-done-list # Conflicts: # README.md
…cache writes The stage now checks the fspx/ and exe/ shader sets after the main set, like bvh/, each recorded in the done-list under "extras" by a digest of its folder and written to its own shard. library/ and fspx_gfx/ stay out: on NVIDIA the seed does not hit for them. A failing set is not recorded and fails the stage, but the other sets and the merge still run. A done-list with the old "bvh" key keeps that record. Entries merged into pipeline_cache.bin no longer depend on the file's size and mtime. A write from outside (a checker run straight into the cache) only adds pipelines, so the list is kept and the new stamp recorded. Merged entries are dropped, with a log line saying why, only when the cache is gone or empty, shrank since the last merge, or its header names another vendor, device or pipelineCacheUUID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Real-corpus test (RTX 4070 SUPER, NVIDIA 621.01): first run over an existing cache: 26,555 pipelines OK (26,503 modules + 52 BVH), 0 failed, 7,879 s. Second run with nothing changed: 3 s, all 26,503 modules already built, no checker process and no merge. Two fixes from that run, now pushed (16854a2, also merges current main):
New fake-checker tests cover both; the pipelines Python suites and CTest AI-assisted (Claude Code) |
|
Follow-up to my earlier runs of this PR on the real corpus (RTX 4070 SUPER, NVIDIA 621.01, Starting state: the 6.9 MB
Not checked: a driver update, a shrinking cache, the library and AI-assisted (Claude Code). |
|
Overlap: #2208 (keep checking pipelines when the crash report is locked) touches the same end-of-stage block of AI-assisted (Claude Code) |
Claimed in the coordination issue as: PIPELINES-STAGE-SHARDS-AND-DONE-LIST (claim)
What and why
The
pipelinesstage ranvk_pipeline_checkin batches of 500, and every batch loaded the wholepipeline_cache.bin(9.6 GB for the full set on an RTX 4070 SUPER, NVIDIA 621.01) and saved it back: 1-2 minutes of I/O per batch, times 53. A rerun after a translator change also walked all 26,503 modules again.With a checker that has the new options, the stage now:
pipeline_shards/NNNNN.bin, without loading or rewriting the big one. At the end the shards are merged intopipeline_cache.binonce, withvkMergePipelineCaches(vk_pipeline_check --merge <out> <in>...), and removed. A stopped run (Ctrl+C, setup error, crash retries running out) keeps its shards and the next run merges them; a failed merge leaves cache and shards as they were. A run with a validation failure still merges what was built, as each batch's own save did before.pipeline_done.jsonin--out(written withnewline="\n") records each module the checker's new--done-filenames, by SHA-256 of its.spvand of its index entry, and which shard (or the merged cache) holds it. A rerun skips them, so after a translator change only modules whose SPIR-V changed are built. The whole list is tied to the GPU and driver (--device-info: vendor/device ID, driver version,pipelineCacheUUID), the checker (hash of its sources when it is this checkout's current build, so thecl.exefallback's relink doesn't throw the list away; else hash of the executable), the partner stubs and the list format. Any change checks every module again. A new GPU or driver starts from empty shards (the old cache is no use to it). A new checker or new stubs on the same driver checkpoint into the existingpipeline_cache.binfor that one run, so what it holds still compiles from it instead of from scratch. Entries already merged hold only whilepipeline_cache.binhas the size and mtime the last merge left. Failed or crashed modules are never on the list, so they get a fresh chance every run, as before. The BVH pass is recorded by a hash of its index and.spv, so an unchanged corpus starts no checker process and needs no merge.pipeline_cache.binfrom before the done-list keeps the old per-process load and save, so what that cache holds still compiles from it instead of from scratch; later runs use shards.crashes_aloneprobes and range splitting all work on the list of modules still to check, selected with the new--names-file. An older checker without--mergekeeps the--start/--countpath exactly as it was.Checker changes (
runtime/test/vk_pipeline_check.cpp):--names-file,--done-file,--device-info,--merge. The merge refuses an input whose header names another vendor, device orpipelineCacheUUID(pipeline_cache_header.h), since a driver may silently drop such data. The seed cache is now read with onereadcall instead of anistreambuf_iteratorcopy: loading a 2 GiB cache file went from 21.6 s to 1.7 s on this PC.What ends up in the cache is the same: each pipeline is created by the same checker with the same device setup, just into a smaller cache that is merged afterwards. The merge test below shows the merged cache gives application-cache hits for every pipeline of both shards.
Tested
python -I tests/test_make_game_pipeline_batches.py: the existing real-orchestration tests now run with both checker generations (the fake checker speaks--names-file,--done-fileand--merge), plus done-list cases: one shard per process and one merge, LF-only done-list, rerun with nothing to do, only the changed module rebuilt, changed index entry, new driver /pipelineCacheUUID/ GPU rebuild everything into shards, new checker / stubs recheck everything from the existing cache and keep leftover shards, interrupted run keeps its shard and the next run finishes the rest, failed merge keeps the shards, removed cache rebuilds, crashed and failed modules not done, migration over an old cache, BVH pass skipped when unchanged. 45 tests, OK (1 skip: the old-checker-only case in the shard subclass).python -I tests/test_make_game_pipelines.py(pinned to the legacy protocol), alltests/test_make_game*.py,test_text_write_line_endings.py,test_ctest_registration.py,test_vk_pipeline_check_index.py,test_vk_pipeline_check_isolate.py(on the GPU, with this checker),test_build_runtime_fallback.py,test_docs_repo_paths.py: all pass.python -m compileall -q make_game.py tools tests,python -I make_game.py --help.cmake --build ... --parallel 2:pipeline_cache_header(new, no device),vk_pipeline_check_merge(new, GPU: two caches of three synthetic compute shaders, merged; a run over all six seeded with the merge reports 6 application-cache hits, the first shard alone 3; merging into an existing output keeps it; a foreign-header input fails with exit 1 and leaves the output byte-identical;--names-file/--done-fileselection and errors),vk_pipeline_check_cli,vk_pipeline_check_stack: 4/4 pass.python -I scripts/check_no_game_data.pyon every changed file: clean. No game files were used.Speed, synthetic.
make_game.pipelineswith the real checker,--jobs 2,__GL_SHADER_DISK_CACHE=0, 400 synthetic compute shaders in batches of 50 (8 processes), seconds, two runs each:Reruns are about 10x and 3x faster here. That corpus's cache is only 2.8 MB, so the full run shows the fixed cost of the new path (device query, hashing, one merge process: +0.3 s) and none of the cache I/O, which is what dominates the real corpus. There the stage no longer loads and saves 9.6 GB per batch (1-2 min each, 53 batches: roughly 1-1.5 h of a full run and nearly all of a rerun) but once in the merge, which is also faster now that the seed is read in one call (2 GiB: 21.6 s -> 1.7 s). I did not run the full corpus: another build was using this GPU.
GPUs tested: profile M: NVIDIA GeForce RTX 4070 SUPER, 12 GB, desktop, driver 621.01, Windows 11
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (also test-merged cleanly with the open PRs touching the checker or the stage: Reject shader indexes with a non-object root before pipeline checks (PIPELINE-INDEX-TOP-LEVEL-OBJECT) #2042, vk_pipeline_check: a large module that must wait frees its worker (VK-PIPELINE-CHECK-LARGE-ADMISSION) #2088, d3d12_vulkan_device: detect and enable VK_EXT_transform_feedback + vk_pipeline_check parity (D3D-TRANSFORM-FEEDBACK-DEVICE) #1891, vk_pipeline_check: synthesize --bary-fallback GS stage for PS pipelines (VK-PIPELINE-CHECK-BARY-FALLBACK) #1890, vk_pipeline_check: choose robustBufferAccess and VK_EXT_robustness2 as the runtime does (RT-PIPELINE-CHECK-ROBUSTNESS) #1833, runtime/d3d12: the --bary-fallback geometry stage feeds computed I/J pairs (RT-BARY-FALLBACK-PER-VERTEX) #1930, Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY) #2098).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code