fix(tools): run the pipeline check in chunks and report oversized modules #41

Manually merged
github merged 2 commits from gh-pr/41/head into gh-pr/41/base 2026-11-26 19:15:10 +00:00
Owner

@⁠Dark3581 on GitHub · 2026-11-22 20:11 UTC · original
Dark3581:fix/chunked-pipeline-check → main · +201 −29 · 5 files · 2 commits · merged 2026-11-22 20:13 UTC

What

The GPU driver's compiler keeps the memory it used until the process exits, so one pipeline checker process over a whole shader set grew until it crashed with an access violation hours in. tools/build_shaders.py now runs the checker once per chunk of index entries (--start/--count), the way the translator's own notes recommend:

  • --pipeline-chunk N (default 500, ANYBOX_PIPELINE_CHUNK in CMake; 0 runs one process). Every chunk seeds from and saves to the same pipeline cache.
  • A failed chunk does not stop the rest. build.json records every chunk, and for a failed one its exit code and the last compile the checker named as still running.
  • A rerun reuses chunks that passed with the same checker executable (path, size, modification time); --recheck checks them all again. Logs are one file per chunk in shaders/pipelines/.
  • --pipeline-max-bytes N (ANYBOX_PIPELINE_MAX_BYTES) passes the checker's --max-bytes: larger modules are reported as BIG SKIP by name instead of compiled, so a module that needs more memory than the PC can commit no longer takes the rest of its chunk down. The check still fails while anything is skipped.
  • shaders_pipelines passes only when every entry was covered and every chunk completed.

Tested

Windows 10, MinGW build, RTX 3070 Ti (driver 621.14), 31.8 GB RAM.

  • tools/tests: 80 tests pass, including new ones for chunk ranges, combining chunks, a crashed chunk (others still run, culprit named), reuse, --recheck, a changed checker, and the size limit.
  • ctest: 60 of 60 pass. python tools/check_conventions.py: ok.
  • On one title's 26,503 translated shaders: chunks [0, 500) and [500, 1000) passed 500 of 500 each, and a rerun reused both. The full chunked run is in progress.
  • Diagnosis: the largest compute module (43 MiB of SPIR-V) needs about 75 GB of committed memory to compile on its own in a fresh process (Windows low-memory event 2004 names the checker at 75.0 GB; this PC can commit 44.5 GB). Chunking fixes the growth over a run; the size limit keeps such a module from crashing its chunk.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • python tools/check_conventions.py passes (no comments in code, one declaration per export, Conventional Commit subjects)
  • Unimplemented paths stop (AbxNotImplemented / AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragment
  • Known gaps added, changed or removed through docs/dev/debt/changes/<branch>.md (none: build tooling only)
  • Generic behaviour, not specific to one title
  • No game files, keys, notes or logs added to the repository
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • Source of behaviour: the pipeline checker's --start, --count and --max-bytes options and its documented chunked runs
  • AI-assisted: yes
**@⁠Dark3581** on GitHub · 2026-11-22 20:11 UTC · [original](https://github.com/Dark3581/AnyBox/pull/41) `Dark3581:fix/chunked-pipeline-check` → `main` · +201 −29 · 5 files · 2 commits · merged 2026-11-22 20:13 UTC ### What The GPU driver's compiler keeps the memory it used until the process exits, so one pipeline checker process over a whole shader set grew until it crashed with an access violation hours in. `tools/build_shaders.py` now runs the checker once per chunk of index entries (`--start`/`--count`), the way the translator's own notes recommend: - `--pipeline-chunk N` (default 500, `ANYBOX_PIPELINE_CHUNK` in CMake; `0` runs one process). Every chunk seeds from and saves to the same pipeline cache. - A failed chunk does not stop the rest. `build.json` records every chunk, and for a failed one its exit code and the last compile the checker named as still running. - A rerun reuses chunks that passed with the same checker executable (path, size, modification time); `--recheck` checks them all again. Logs are one file per chunk in `shaders/pipelines/`. - `--pipeline-max-bytes N` (`ANYBOX_PIPELINE_MAX_BYTES`) passes the checker's `--max-bytes`: larger modules are reported as `BIG SKIP` by name instead of compiled, so a module that needs more memory than the PC can commit no longer takes the rest of its chunk down. The check still fails while anything is skipped. - `shaders_pipelines` passes only when every entry was covered and every chunk completed. ### Tested Windows 10, MinGW build, RTX 3070 Ti (driver 621.14), 31.8 GB RAM. - `tools/tests`: 80 tests pass, including new ones for chunk ranges, combining chunks, a crashed chunk (others still run, culprit named), reuse, `--recheck`, a changed checker, and the size limit. - `ctest`: 60 of 60 pass. `python tools/check_conventions.py`: ok. - On one title's 26,503 translated shaders: chunks [0, 500) and [500, 1000) passed 500 of 500 each, and a rerun reused both. The full chunked run is in progress. - Diagnosis: the largest compute module (43 MiB of SPIR-V) needs about 75 GB of committed memory to compile on its own in a fresh process (Windows low-memory event 2004 names the checker at 75.0 GB; this PC can commit 44.5 GB). Chunking fixes the growth over a run; the size limit keeps such a module from crashing its chunk. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] `python tools/check_conventions.py` passes (no comments in code, one declaration per export, Conventional Commit subjects) - [x] Unimplemented paths stop (`AbxNotImplemented` / `AbxUnsupported`); silent stubs are listed under Silent stubs through a debt fragment - [x] Known gaps added, changed or removed through `docs/dev/debt/changes/<branch>.md` (none: build tooling only) - [x] Generic behaviour, not specific to one title - [x] No game files, keys, notes or logs added to the repository - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] Source of behaviour: the pipeline checker's `--start`, `--count` and `--max-bytes` options and its documented chunked runs - [x] AI-assisted: yes
The GPU driver's compiler keeps its memory until the process exits, so a
single checker process over a whole shader set crashed hours in. The
pipelines step now runs the checker once per chunk (--pipeline-chunk,
default 500, ANYBOX_PIPELINE_CHUNK in CMake), each seeding from and
saving to the same cache, keeps going after a failed chunk, records each
chunk's exit code and last named compile, and reuses chunks that passed
with the same checker executable unless --recheck is given.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:15:08 +00:00
github manually merged commit a34d9443b4 into gh-pr/41/base 2026-11-26 19:15:10 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.