Commit Graph

28 Commits

Author SHA1 Message Date
4ebfec34d7 Merge pull request #846 from TheGeogeo/fix/preserve-pipeline-crash-report
make_game: preserve crash reports when a retry fails setup (BUILD-PIPELINE-RETRY-CRASH-REPORT)
2026-11-29 16:44:37 +01:00
dcb9c0ea3c Merge pull request #2042 from alexandersato0830/codex/pipeline-index-top-level-object
Reject shader indexes with a non-object root before pipeline checks (PIPELINE-INDEX-TOP-LEVEL-OBJECT)
2026-11-28 11:47:39 +01:00
9200934dd0 Reject translated shader indexes with a non-object root 2026-11-25 12:50:19 -06:00
63fce8be54 Keep checking pipelines when the previous crash report is locked
(cherry picked from commit b3a8c538b7)
2026-11-24 16:45:20 -05:00
eb4bdfdc46 Preserve pipeline crash report when a retry fails setup 2026-11-24 20:57:35 +01:00
ce5d643b24 tests: the supplied-runtime build keeps its --jobs 3 on a 2-vCPU machine
make_game.main() clamps --jobs to the host CPU count through
leonida_tui.clamp_jobs, so test_windows_reuses_the_checker_from_the_supplied_runtime_build
compared the clamped value: at 2 CPUs it asserts '2' != '3'. #83 pinned the
other two assertions that ask for more jobs than a small runner has and missed
this one.

Reproduced on 21625bca8 with os.cpu_count() patched in-process (python -I
implies -E, so PYTHON_CPU_COUNT never reaches the test): 2 CPUs = 1 failure,
4 and 256 CPUs = pass. With the pin: pass at 2, 4 and 256. Negative control:
removing the pin turns the 2-CPU run red again.

Test-only; clamp_jobs and make_game.py untouched. Carries old PR 10056
(tests/test_make_game_pipelines.py part), which #322 reopened as a draft.
2026-11-24 13:09:32 +01:00
67cbdf11fa tests: pin the hardware threads where --jobs is asserted
main() clamps --jobs to os.cpu_count(), and the GitHub Windows runners have
four, so --jobs 6 reached the shaders stage as 4 and --jobs 5 reached the
pipeline checker as 4 ('4' != '5'). Both cases pin cpu_count at 16 for the
call, as the merged --jobs 10 assets case does; the default case keeps
reading the real count.
2026-11-24 04:28:23 +02:00
a2c2ba8788 Merge pull request #4092 from ray3242/devin/1795389450-pipeline-crash-bisect
make_game pipelines: bisect crashes to the module and record its SPIR-V hash (TEST-895)
2026-11-24 00:18:42 +01:00
fdc026a35e Accept BOM-marked indexes in the pipeline stage 2026-11-24 02:56:33 +05:30
12a9e7bc33 pipelines: warn instead of raising when the crash report cannot be written 2026-11-23 12:41:18 -06:00
7ca3a16b19 pipelines: keep the crash report on give-up paths; rebase onto current main 2026-11-23 12:17:54 -06:00
b36eff2cc2 make_game pipelines: record crashed modules' SPIR-V hashes on the new recovery path 2026-11-23 12:14:50 -06:00
c646bf8367 Speed up make_game by overlapping stages and showing progress. (#1797)
Squash-merged after diff review of PR #1797
2026-11-23 09:32:22 -06:00
da3556f634 Merge pull request #3623 from erickbobd
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:08:01 -05:00
795c28d52e Merge pull request #3623 from erickbobd 2026-11-22 17:03:04 -05:00
813e63318d Merge pull request #3328 from bobcatchris 2026-11-22 17:01:25 -05:00
b27f24045e build: stop on inconclusive pipeline crash probes (BUILD-1030) 2026-11-22 18:57:37 -03:00
30e676038b build: stop pipeline batches on native setup failures (BUILD-1030) 2026-11-22 18:24:03 -03:00
e4617613e7 build: bound pipeline checks and recover collective crashes (BUILD-1030) 2026-11-22 18:07:48 -03:00
1631d6a9e3 Merge pull request #2923 from jaybeebabageyus 2026-11-22 15:13:14 -05:00
b616525c28 Pipelines: refuse an empty or unreadable translated shader index 2026-11-22 14:07:47 -06:00
adf687993d Merge upstream main into the Windows pipeline checker fix
Keep the pipeline crash-recovery code and the upstream translated-shader preflight while resolving the checker path once per selected runtime build.
2026-11-22 16:27:33 -03:00
8da9c66188 make_game.py: the pipelines stage log names graphics pipelines too
The stage runs vk_pipeline_check without a --stage filter and the checker's default is all: cs become
compute pipelines, ps/vs/ms/gs become graphics pipelines with partner stubs (runtime/test/vk_pipeline_check.cpp),
so the announce line claiming compute only misled a review of #2815 (RT-191) into thinking graphics shaders
are only turned into modules. The line now says compute and graphics; a regression test pins the announce
line and fails on the old wording. Found by @iurysf.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-11-22 19:44:29 +01:00
2a1bd0399d vk_pipeline_check: a module is in flight from vkCreateShaderModule on, tagged module or pipeline
Review of #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>
2026-11-22 11:34:50 -05:00
0c45e9a569 Pipelines stage: use the new checker options only when the build has them; the checker rejects unknown options
Review of #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 (#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 6a6704df 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 6a6704df 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>
2026-11-22 11:25:07 -05:00
a00b5f3fc5 build: reuse the supplied Windows Vulkan pipeline checker
Resolve the optional checker beside the supplied Windows runtime files before looking in the local build, and use the same choice during preflight and the pipeline stage. Preserve native Linux checker selection.

AI-assisted.
2026-11-22 13:14:02 -03:00
05686f15a4 Pipelines stage: a module that takes vk_pipeline_check down is skipped and the rest is still checked
Since dcd8ecf the two #881/#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 (#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, #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>
2026-11-22 10:58:37 -05:00
8686b6989b make_game.py: --jobs reaches vk_pipeline_check in the pipelines stage
pipelines() ran vk_pipeline_check without --jobs, so --stages pipelines --jobs N always compiled on half the hardware threads. main() now passes its --jobs; the default (half the CPU count) matches the checker's own, so a run without --jobs is unchanged.
2026-11-21 20:26:58 -05:00