Repository navigation
Pipelines stage: a module that takes vk_pipeline_check down is skipped and the rest is still checked - #2111
Conversation
…d and the rest is still checked Since dcd8ecf the two ProjectLeonida#881/ProjectLeonida#884 giants pass spirv-val and are back in the corpus. On NVIDIA the larger one runs the driver's compiler out of memory (LLVM ERROR: out of memory, exit 0x80000003), vk_pipeline_check dies with it, and the pipelines stage stops: on @VeTkN's RTX 5070 (ProjectLeonida#884, c603b8f) about 5,750 pipelines after it were never checked or cached, and make_game.py exited 1. vk_pipeline_check: - --inflight-file F keeps the names of the modules being compiled in F. It is rewritten when a module over --large-module-bytes starts or finishes (those compile alone, ProjectLeonida#903, so F then names exactly that module), by the 5 s watchdog for the others, and emptied at the end of the pass. - --skip-file F: modules named in F are not compiled; each is reported as `MODULE CRASH <name> (<stage>, killed the driver in an earlier run; not retried)` and counted as a failed pipeline, as --isolate does on POSIX. --isolate passes it on to its children. A missing F is a usage error (exit 2). make_game.py, pipelines stage: - runs the checker with --inflight-file. When it exits other than 0, 1 or 2 (a crash, not Ctrl+C), the modules in the in-flight file are added to pipeline_crashes.txt and the checker runs again with --skip-file; what was already compiled comes back from pipeline_cache.bin (checkpointed every 10 minutes). If several modules were compiling, each is tried alone (--start/--count in the checker's name-sorted index) and only those that crash alone are skipped. - a crash no module can be named for is not retried, nor is Ctrl+C, and there are at most 5 restarts. - the stage still fails when anything failed, now after checking everything else, and names the modules that took the driver down. pipeline_crashes.txt is cleared at the start of each pipelines stage, so a module gets a fresh chance after a translator change. - run() takes check=False and returns the exit code. The --isolate child-process mode stays POSIX-only; with a multi-GB pipeline cache per child it is too heavy for the default path. A memory cap for the checker on Windows, so the OOM doesn't take other programs down, is a follow-up. Tested on Windows 11 Pro 25H2, MSVC 14.51 + Ninja, RTX 5070 Ti / 621.24: - tests/test_make_game_pipelines.py: 6 new cases (a named crasher is skipped and the rest checked; several in flight are tried alone and only the crasher is skipped; no suspect or Ctrl+C is not retried; the retry limit; a clean run is one call and an old skip list is dropped). All 14 test_make_game*.py files pass. - end to end on 62 real compute modules from my own copy's work folder (2 over 4 MiB), through make_game.pipelines: with VK_PIPELINE_CHECK_SIMULATE_CRASH on one large module, the first run died (exit 3), the in-flight file named that module, the second run checked the other 61 (all ok) and saved the cache, and the stage failed naming it. Without the hook: one call, 62/62, exit 0. The in-flight file is empty after a clean pass. No game data. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compatibility finding for the unconditional |
…them; the checker rejects unknown options Review of ProjectLeonida#2111 (@matheuskshn): a vk_pipeline_check built before this PR takes any argument it doesn't know as the cache path. Run with --inflight-file F, it would write the Vulkan pipeline cache into F and exit 0; make_game.py would then delete F and report success, with no pipeline_cache.bin. That happens with a reused runtime build or a supplied Windows build (ProjectLeonida#2194). - make_game.py asks the checker first: run without arguments it prints its usage before touching Vulkan, and only a build that lists --inflight-file and --skip-file gets them and the crash retry. An older build runs exactly as before (one call, a crash stops the stage), with a log line saying to rebuild the runtime stage for crash recovery. - vk_pipeline_check: an unknown --option or a second positional argument is now a usage error (exit 2) instead of silently becoming the cache path, so the next new option can't be swallowed the same way. Tested on Windows 11 Pro 25H2, MSVC 14.51 + Ninja, RTX 5070 Ti / 621.24: - checker_supports: True for this build, False for a 6a6704d build (before this PR). - the new checker: --no-such-option and a second cache path exit 2 with a message. - make_game.pipelines on 62 real compute modules: with this build and a simulated crash, the module is skipped and the other 61 checked, as before; with the 6a6704d build, one call without the new flags, exit 0, and the cache in pipeline_cache.bin (6.7 MB), nothing written to pipeline_inflight.txt. - tests/test_make_game_pipelines.py: 11 tests, 2 new (an older checker gets the old invocation and isn't retried; support is read from the usage line). All 14 test_make_game*.py files pass. No game data. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @matheuskshn, good catch: an older checker would have written the 4 GB cache into
Checked on the RTX 5070 Ti / 621.24 with 62 real compute modules through
AI-assisted. |
|
A data point for What I saw: twice the run stopped printing If the stage is going to read the file to decide what to skip after a crash, registering the entry before Counts only, no game files. AI-assisted (Claude Code). |
…, tagged module or pipeline Review of ProjectLeonida#2111 (@Pipodi): the in-flight table got its entry only just before vkCreateComputePipelines / vkCreateGraphicsPipelines, so a thread busy in vkCreateShaderModule (or a large module there, alone behind compile_gate) was invisible: the watchdog never named it, and --inflight-file couldn't name a module that died there. - The entry is made once the worker holds compile_gate, before vkCreateShaderModule, with phase "module"; it becomes "pipeline" when the pipeline is created, and is removed on every path out of the loop (a pipeline, a skip, a failed module). A module over --large-module-bytes writes the file when it enters the driver, not only at its pipeline. - --inflight-file lines are "name<TAB>phase"; make_game.py reads the name. - The watchdog says "still creating the shader module of X" or "still compiling X". Waiting on compile_gate is not in the table: that thread isn't in the driver. Tested on Windows 11 Pro 25H2, MSVC 14.51 + Ninja, RTX 5070 Ti / 621.24: the crash end-to-end through make_game.pipelines on 62 real compute modules (skipped, the other 61 checked); the in-flight file at a simulated crash reads "<module>\tpipeline" and is empty after a clean pass (62/62). tests/test_make_game_pipelines.py writes the tab format; all 14 test_make_game*.py files pass. No new warnings. No game data. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @Pipodi, that's the right place to register it, and it's the same few lines this PR touches, so I folded it in here rather than splitting it into a follow-up:
I left threads waiting on Re-checked on the RTX 5070 Ti / 621.24:
AI-assisted. |
|
Confirmed the compatibility fix on |
…the cache path Review of ProjectLeonida#2111 (@matheuskshn): an explicit empty argument followed by a filename was accepted, because an empty cache_path stood for both "not given" and "given as ''". A flag now records that the cache path was given, so a second positional argument is always a usage error (exit 2), and the message quotes both values. Tested: `vk_pipeline_check <dir> "" b.bin` and `<dir> a.bin b.bin` exit 2 with the message; one cache path still runs (62/62 real compute modules, RTX 5070 Ti / 621.24) and writes the cache. No new warnings. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @matheuskshn, for confirming on real binaries and for closing #2243. I fixed the parser edge too, since it was two lines: One cache path still runs normally (62/62 real compute modules, RTX 5070 Ti / 621.24), and there are no new warnings. AI-assisted. |
|
Tested
No game data. AI-assisted. |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Post-merge run of the pipelines stage with this PR (e77d75d), on my full 1.0.2.1 work folder (26,501 modules), RTX 3060 / 610.88, 8 threads, under a per-process commit cap. The in-flight file and the single re-checks work as described. Twice, at about module 7,500 with a 20 GB cap and about 13,750 with 26 GB, the 8 in-flight modules were each re-run alone and all passed, so the stage stopped with |
|
Ran the The skip-and-continue path works end to end on real modules.
AI-assisted run (Claude). Counts only; nothing from the game leaves this machine. |
Claimed in the coordination issue as a new BUILD item: claim. Related: #884, #881, #903, #1987.
What and why
Since
dcd8ecfthe two #881/#884 giants passspirv-valagain and are back in the corpus. On NVIDIA the larger one runs the driver's compiler out of memory (LLVM ERROR: out of memory, exit0x80000003).vk_pipeline_checkdies with it, and with it the whole pipelines stage:c603b8f): the crash came at 82 GB of commit,make_game.pyexited 1, and about 5,750 pipelines after it were never checked or cached.Until the translator makes these modules compilable on NVIDIA (#1905 and successors), every NVIDIA user's full build stops there.
The change
vk_pipeline_check--inflight-file F: keeps the names of the modules being compiled inF. It's rewritten when a module over--large-module-bytesstarts or finishes (those compile alone since Compile large Vulkan shader modules exclusively #903, soFthen names exactly that module), and by the 5 s watchdog for the rest. It's emptied at the end of the pass.--skip-file F: modules named inFaren't compiled. Each is reported asMODULE CRASH <name> (<stage>, killed the driver in an earlier run; not retried)and counted as a failed pipeline, as--isolatedoes on POSIX.--isolatepasses it on to its children, and a missingFis a usage error (exit 2).make_game.py, pipelines stage--inflight-file. If the checker exits with anything but 0, 1 or 2 (a crash, not Ctrl+C), the modules in the in-flight file go intopipeline_crashes.txtand the checker runs again with--skip-file. Pipelines already compiled come back frompipeline_cache.bin, which is checkpointed every 10 minutes (pipeline_cache_snapshot: read into a buffer with headroom so a busy cache doesn't fail every checkpoint #1987 makes that reliable on a big cache).--start/--countin the checker's name-sorted index) and only those that crash alone are skipped.pipeline_crashes.txtis cleared at the start of every pipelines stage, so a module gets a fresh chance after a translator change.run()gainscheck=Falseand returns the exit code.Not in this PR: the
--isolatechild-process mode stays POSIX-only, since a multi-GB cache per child makes it too heavy for the default path. A Windows memory cap for the checker (so the OOM doesn't take other programs down, as on @Proudnoob4's machine) would be a follow-up.Tested
Windows 11 Pro 25H2, MSVC 14.51 + Ninja (
scripts/build_runtime.ps1), NVIDIA RTX 5070 Ti, driver 621.24, onmain4eb6155d:tests/test_make_game_pipelines.py: 6 new cases with a scripted checker:All 14
tests/test_make_game*.pyfiles pass (three existing tests updated forrun()'s return code and the new argument).End to end on the GPU, with 62 real compute modules (2 over 4 MiB) from my own copy's work folder, through
make_game.pipelines(), withVK_PIPELINE_CHECK_SIMULATE_CRASHon one large module:1 module(s) took the driver down and were counted as failed: <name>.Without the hook: one call, 62/62, exit 0, and the in-flight file is empty afterwards.
Build: no new warnings.
Not run: a full 26,503-module stage with the real out-of-memory module. That's about 1.5 h to reach it plus a 1.5 h failure, and the in-flight file is written exactly when that module (over 4 MiB, compiled alone) starts.
No game data. AI-assisted.
🤖 Generated with Claude Code