make_game: the pipelines stage fills the runtime's own journal with gta6rt --precompile-pipelines (MAKE-GAME-PIPELINES-VIA-RUNTIME) #2392

Open
github-bot wants to merge 2 commits from github-bot/gh-2392 into main AGit
Owner

@⁠qhukz13 on GitHub · 2026-11-26 17:42 UTC · original
qhukz13:cont/pipelines-via-runtime → main · +1100 −1170 · 20 files · 2 commits · open

Claimed in the coordination issue as: MAKE-GAME-PIPELINES-VIA-RUNTIME (#1608, corrected in #1608)

Touches the code this replaces in: #2113, #1407, #846, #285, #1319 and #2042 (all on the vk_pipeline_check side of the stage). Built on top of RT-PRECOMPILE-SKIP-LIST-EXPLICIT (@⁠aslan2142, now in main): this keeps its entry selection and its summary wording (check_precompile_skip_list.cmake passes).

What and why

make_game.py --stages pipelines ran vk_pipeline_check over the translated shaders and wrote one pipeline_cache.bin. The runtime never hits that cache, which the maintainers' status lists as "vk_pipeline_check never matches the runtime's cache keys":

  • The runtime looks a compute pipeline up in its own journal, pipeline_cache.d/cs-<key>.bin.
  • The checker creates its pipelines on a different device: no pApplicationName, its own executable name, robustness off, a different extension set, a different bindless set-0 layout, VK_SHADER_STAGE_ALL push constants for bound compute, and no decide_subgroup_size / REQUIRE_FULL_SUBGROUPS.
  • So even the driver's own cache keys differ. docs/running.md told players to skip the stage for that reason.

Closing those gaps one at a time in the checker would copy the runtime's device and layout code into a second program. gta6rt --precompile-pipelines already is that program: the same device, layouts, build_compute_pipeline and journal names as play. So the stage now runs it.

The change

make_game.py (stage pipelines):

  • It runs gta6rt.exe --precompile-pipelines --threads <jobs>, using the one in --out, else --runtime-build, else the default build folder. It runs natively on Windows and under Wine elsewhere, with WINE honoured.
  • LEONIDA_SHADERS and LEONIDA_PIPELINE_CACHE_DIR point at the run's work/shaders/spirv and --out, converted to Z:\... under Wine, unless the user set them.
  • The [precompile] i/n lines drive the stage's progress.
  • Exit codes:
    • 2 (some entries failed, or were skipped after a crash) is a warning;
    • 1 (no device or library) fails the stage;
    • anything else is a crash, and the stage reruns up to PIPELINE_CRASH_RETRIES (5).
  • Crashed entries go to <out>/pipeline_crashes.json as before, with each module's SHA-256.
  • Preflight: without the runtime stage, gta6rt.exe must exist; off Windows, Wine must exist. Off Windows without the cross-build or Wine, the default stage list drops pipelines along with runtime.
  • The vk_pipeline_check driving code goes: the exe lookup, staleness check, Linux auto-build, 500-entry batching and the BVH seeding pass. The precompile loads bvh/, fspx*/, exe/ and library/ itself. vk_pipeline_check, its tests, docs and the CI step that runs it stay: it remains the driver-acceptance checker.

gta6rt --precompile-pipelines: a module that kills the run is skipped next time. Before this, a crashed build left nothing behind: the requests/<name>.building lock is DELETE_ON_CLOSE. A rerun built the same module first again and died again.

  • New runtime/src/precompile_inflight.h: requests/inflight.txt lists <name> <key> for the entries inside the driver, rewritten before each create and after it. The key is the module file (size and last write, no read of the module) on this device and driver.
  • The next run moves what a dead run left there to requests/crashed.txt and skips an entry while its key is the one that crashed. Each gets a line, the summary adds , N crashed a run (only when N is not 0, so main's wording stands), and the exit code is 2.
  • A new translation of the module or a new driver gives a new key, so the next run tries it again by itself, and a build that returns clears it from the list. --all tries every recorded one now.
  • One precompile per journal folder (requests/precompile.lock), so a leftover list can only be a dead run's. A second one exits 3, which the stage reports as such, not as a device failure. --list touches nothing.
  • LEONIDA_PRECOMPILE_CRASH_TEST=<entry> ends the run just before that entry's create, so the crash path is tested by a real process death.

Graphics pipelines leave the stage. The runtime builds them at the title's draw from the PSO and the bound formats, and the checker's stub-paired pipelines never matched those (docs/d3d12_vulkan.md). Ordering them ahead of play is #2220 / #2260's work.

Docs updated: README.md, docs/running.md, docs/linux_proton.md, docs/linux.md, docs/pipeline_check.md, docs/d3d12_vulkan.md. Only the lines about the stage changed; the skip-list text and timings are left to RT-PRECOMPILE-SKIP-LIST-EXPLICIT.

Tested

Windows 10 Pro 19045, MSVC 14.44 RelWithDebInfo, GTX 1050 Ti (NVIDIA), on main 2d43417d4. No game files: two or three authored compute shaders (OpExecutionMode LocalSize n 1 1) written to a temporary library.

  • precompile_inflight_test (new, standard library only):

    • passes under MSVC, and under GCC 14 with -fsanitize=address,undefined and with ThreadSanitizer;
    • with the move of leftover entries into crashed.txt removed, it fails at the dead-run check.
  • gta6rt --precompile-pipelines with real process deaths (LEONIDA_PRECOMPILE_CRASH_TEST), 17 checks, all pass:

    • a crash inside an entry's create ends the run with 0xC0000005 and leaves <name> <key> in inflight.txt;
    • the next run names the entry, skips it, records it in crashed.txt, exits 2 with main's summary wording plus , 1 crashed a run, and keeps skipping it while the module file is unchanged;
    • after the module file is rewritten (a new translation), the next run builds it, exits 0 and clears the list;
    • --all builds a freshly crashed entry and clears the list;
    • a held journal folder exits 3, and --list writes nothing.
  • main's precompile_skip_list passes alongside precompile_inflight.

  • The stage end to end on the same machine, through make_game.pipelines() with that build as --runtime-build:

    • 3 journal files in <out>/pipeline_cache.d, progress 3/3;
    • with a crash planted in one entry, the first attempt dies, the retry skips it, and the stage completes with one warning that names it and says how it is retried, and pipeline_crashes.json naming it.

    make_game.py's CLI asks for a game package before any stage, so the run calls the stage function directly.

  • Python test files, on Windows (Python 3.12) and Linux (Python 3.14.8):

    • test_make_game_pipelines (rewritten around a fake gta6rt: arguments, environment, Wine paths, progress, exit codes 0/1/2/3, the retry limit, <name> <key> lines → pipeline_crashes.json, one warning);
    • test_make_game_pipeline_preflight (rewritten);
    • test_make_game_dry_run, test_make_game_platform, test_make_game_argparse, test_make_game_preflight, test_leonida_tui;
    • every other tests/test_make_game_*.py, plus test_ctest_registration, test_text_write_line_endings and test_docs_env_vars.

    test_make_game_pipeline_batches.py is removed with the batching it tested.

  • Every standalone tests/test_*.py on Linux (544 files): no new failure. The one failing file, test_calibrated_texture_extra (test_export_file_replacement_failure_cleans_temporary_file), fails the same way on main 935a2cd5b. The pytest-only files were not run here.

  • python -m compileall, make_game.py --help, scripts/check_no_game_data.py on every changed file, and git diff --check: clean.

Off Windows the stage now needs Wine and a Windows gta6rt.exe, as playing does; the shaders, assets and runtime stages do not. On a machine without them the stage says so in preflight.

Not tested: a real game library, and the stage under Wine (the Wine command line is covered by the tests, not run against a real Wine).

GPUs tested: NVIDIA GeForce GTX 1050 Ti, Windows 10.

AI-assisted: yes. Antigravity (Gemini 4 Neon) wrote the implementation plan and the make_game.py, test and docs changes. Claude Code wrote the runtime part, reviewed the rest, and ran the builds, tests and mutant.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

**@⁠qhukz13** on GitHub · 2026-11-26 17:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2392) `qhukz13:cont/pipelines-via-runtime` → `main` · +1100 −1170 · 20 files · 2 commits · open Claimed in the coordination issue as: MAKE-GAME-PIPELINES-VIA-RUNTIME (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608, corrected in https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) Touches the code this replaces in: #2113, #1407, #846, #285, #1319 and #2042 (all on the `vk_pipeline_check` side of the stage). Built on top of RT-PRECOMPILE-SKIP-LIST-EXPLICIT (@⁠aslan2142, now in main): this keeps its entry selection and its summary wording (`check_precompile_skip_list.cmake` passes). ### What and why `make_game.py --stages pipelines` ran `vk_pipeline_check` over the translated shaders and wrote one `pipeline_cache.bin`. The runtime never hits that cache, which the maintainers' status lists as "vk_pipeline_check never matches the runtime's cache keys": - The runtime looks a compute pipeline up in its own journal, `pipeline_cache.d/cs-<key>.bin`. - The checker creates its pipelines on a different device: no `pApplicationName`, its own executable name, robustness off, a different extension set, a different bindless set-0 layout, `VK_SHADER_STAGE_ALL` push constants for bound compute, and no `decide_subgroup_size` / `REQUIRE_FULL_SUBGROUPS`. - So even the driver's own cache keys differ. `docs/running.md` told players to skip the stage for that reason. Closing those gaps one at a time in the checker would copy the runtime's device and layout code into a second program. `gta6rt --precompile-pipelines` already is that program: the same device, layouts, `build_compute_pipeline` and journal names as play. So the stage now runs it. ### The change **`make_game.py` (stage `pipelines`):** - It runs `gta6rt.exe --precompile-pipelines --threads <jobs>`, using the one in `--out`, else `--runtime-build`, else the default build folder. It runs natively on Windows and under Wine elsewhere, with `WINE` honoured. - `LEONIDA_SHADERS` and `LEONIDA_PIPELINE_CACHE_DIR` point at the run's `work/shaders/spirv` and `--out`, converted to `Z:\...` under Wine, unless the user set them. - The `[precompile] i/n` lines drive the stage's progress. - Exit codes: - 2 (some entries failed, or were skipped after a crash) is a warning; - 1 (no device or library) fails the stage; - anything else is a crash, and the stage reruns up to `PIPELINE_CRASH_RETRIES` (5). - Crashed entries go to `<out>/pipeline_crashes.json` as before, with each module's SHA-256. - Preflight: without the runtime stage, `gta6rt.exe` must exist; off Windows, Wine must exist. Off Windows without the cross-build or Wine, the default stage list drops `pipelines` along with `runtime`. - The `vk_pipeline_check` driving code goes: the exe lookup, staleness check, Linux auto-build, 500-entry batching and the BVH seeding pass. The precompile loads `bvh/`, `fspx*/`, `exe/` and `library/` itself. `vk_pipeline_check`, its tests, docs and the CI step that runs it stay: it remains the driver-acceptance checker. **`gta6rt --precompile-pipelines`: a module that kills the run is skipped next time.** Before this, a crashed build left nothing behind: the `requests/<name>.building` lock is `DELETE_ON_CLOSE`. A rerun built the same module first again and died again. - New `runtime/src/precompile_inflight.h`: `requests/inflight.txt` lists `<name> <key>` for the entries inside the driver, rewritten before each create and after it. The key is the module file (size and last write, no read of the module) on this device and driver. - The next run moves what a dead run left there to `requests/crashed.txt` and skips an entry while its key is the one that crashed. Each gets a line, the summary adds `, N crashed a run` (only when N is not 0, so main's wording stands), and the exit code is 2. - A new translation of the module or a new driver gives a new key, so the next run tries it again by itself, and a build that returns clears it from the list. `--all` tries every recorded one now. - One precompile per journal folder (`requests/precompile.lock`), so a leftover list can only be a dead run's. A second one exits 3, which the stage reports as such, not as a device failure. `--list` touches nothing. - `LEONIDA_PRECOMPILE_CRASH_TEST=<entry>` ends the run just before that entry's create, so the crash path is tested by a real process death. Graphics pipelines leave the stage. The runtime builds them at the title's draw from the PSO and the bound formats, and the checker's stub-paired pipelines never matched those (docs/d3d12_vulkan.md). Ordering them ahead of play is #2220 / #2260's work. Docs updated: `README.md`, `docs/running.md`, `docs/linux_proton.md`, `docs/linux.md`, `docs/pipeline_check.md`, `docs/d3d12_vulkan.md`. Only the lines about the stage changed; the skip-list text and timings are left to RT-PRECOMPILE-SKIP-LIST-EXPLICIT. ### Tested Windows 10 Pro 19045, MSVC 14.44 RelWithDebInfo, GTX 1050 Ti (NVIDIA), on main `2d43417d4`. No game files: two or three authored compute shaders (`OpExecutionMode LocalSize n 1 1`) written to a temporary library. - **`precompile_inflight_test`** (new, standard library only): - passes under MSVC, and under GCC 14 with `-fsanitize=address,undefined` and with ThreadSanitizer; - with the move of leftover entries into `crashed.txt` removed, it fails at the dead-run check. - **`gta6rt --precompile-pipelines` with real process deaths** (`LEONIDA_PRECOMPILE_CRASH_TEST`), 17 checks, all pass: - a crash inside an entry's create ends the run with `0xC0000005` and leaves `<name> <key>` in `inflight.txt`; - the next run names the entry, skips it, records it in `crashed.txt`, exits 2 with main's summary wording plus `, 1 crashed a run`, and keeps skipping it while the module file is unchanged; - after the module file is rewritten (a new translation), the next run builds it, exits 0 and clears the list; - `--all` builds a freshly crashed entry and clears the list; - a held journal folder exits 3, and `--list` writes nothing. - **main's `precompile_skip_list`** passes alongside `precompile_inflight`. - **The stage end to end on the same machine**, through `make_game.pipelines()` with that build as `--runtime-build`: - 3 journal files in `<out>/pipeline_cache.d`, progress `3/3`; - with a crash planted in one entry, the first attempt dies, the retry skips it, and the stage completes with one warning that names it and says how it is retried, and `pipeline_crashes.json` naming it. `make_game.py`'s CLI asks for a game package before any stage, so the run calls the stage function directly. - **Python test files**, on Windows (Python 3.12) and Linux (Python 3.14.8): - `test_make_game_pipelines` (rewritten around a fake `gta6rt`: arguments, environment, Wine paths, progress, exit codes 0/1/2/3, the retry limit, `<name> <key>` lines → `pipeline_crashes.json`, one warning); - `test_make_game_pipeline_preflight` (rewritten); - `test_make_game_dry_run`, `test_make_game_platform`, `test_make_game_argparse`, `test_make_game_preflight`, `test_leonida_tui`; - every other `tests/test_make_game_*.py`, plus `test_ctest_registration`, `test_text_write_line_endings` and `test_docs_env_vars`. `test_make_game_pipeline_batches.py` is removed with the batching it tested. - Every standalone `tests/test_*.py` on Linux (544 files): no new failure. The one failing file, `test_calibrated_texture_extra` (`test_export_file_replacement_failure_cleans_temporary_file`), fails the same way on main `935a2cd5b`. The pytest-only files were not run here. - `python -m compileall`, `make_game.py --help`, `scripts/check_no_game_data.py` on every changed file, and `git diff --check`: clean. Off Windows the stage now needs Wine and a Windows `gta6rt.exe`, as playing does; the `shaders`, `assets` and `runtime` stages do not. On a machine without them the stage says so in preflight. Not tested: a real game library, and the stage under Wine (the Wine command line is covered by the tests, not run against a real Wine). GPUs tested: NVIDIA GeForce GTX 1050 Ti, Windows 10. AI-assisted: yes. Antigravity (Gemini 4 Neon) wrote the implementation plan and the `make_game.py`, test and docs changes. Claude Code wrote the runtime part, reviewed the rest, and ran the builds, tests and mutant. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Switch make_game.py's pipelines stage from vk_pipeline_check to gta6rt.exe --precompile-pipelines --threads <jobs> (under Wine off Windows, honouring WINE) so the stage populates <out>/pipeline_cache.d with runtime-matching driver keys.

Stream [precompile] progress lines into Progress/LeonidaBoard, treat exit 2 as a warning, fail on exit 1, retry crashes up to PIPELINE_CRASH_RETRIES, and report pipeline_cache.d/requests/crashed.txt into <out>/pipeline_crashes.json. Remove vk_pipeline_check orchestration from make_game.py while leaving vk_pipeline_check and its own tests intact.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gta6rt --precompile-pipelines resumes by skipping journaled entries, but an entry whose pipeline create takes the
process down (a driver crash, an abort in the compiler) had no journal file and no trace: its requests/<name>.building
lock is opened DELETE_ON_CLOSE, so the OS removes it with the process. The next run built it first again and died
the same way, so a stage that reruns the precompile could never get past it.

requests/inflight.txt now lists the entries inside the driver, written before each create and cleared after it. A
run moves what a dead run left there into requests/crashed.txt and skips those entries with a line each and a count
in the summary (exit 2); --all tries them again. One precompile per journal folder (requests/precompile.lock), so a
leftover list can only be a dead run's. precompile_inflight_test covers the record, a simulated dead run, --all and
concurrent builders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:43:38 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-26 18:01 UTC · original · reviewed

Built gta6rt and the inflight test at this head with MSVC on Windows 11. precompile_inflight passed and the Python pipeline tests ran 25 passes with one skip. With a synthetic compute shader, I ran the actual make_game.pipelines stage twice: the first run created one native journal entry, and the second reported it as already journaled and preserved bytes and mtime. GPU: NVIDIA GeForce RTX 5070, 610.88. This checks stage-to-runtime integration and journal reuse by the stage.

AI-assisted.

**@⁠lixonik** on GitHub · 2026-11-26 18:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2392#pullrequestreview-6078729866) · **reviewed** Built `gta6rt` and the inflight test at this head with MSVC on Windows 11. `precompile_inflight` passed and the Python pipeline tests ran 25 passes with one skip. With a synthetic compute shader, I ran the actual `make_game.pipelines` stage twice: the first run created one native journal entry, and the second reported it as already journaled and preserved bytes and mtime. GPU: NVIDIA GeForce RTX 5070, 610.88. This checks stage-to-runtime integration and journal reuse by the stage. AI-assisted.
Author
Owner

@⁠wavehs on GitHub · 2026-11-26 18:50 UTC · original · reviewed

macOS arm64 check of #2392 (MAKE-GAME-PIPELINES-VIA-RUNTIME). Python build driving, the dashboard/docs, a new Windows-side precompile journal and the portable header its test covers.

Two commits, head 8a73cb09b. It does not merge onto main bdbc7e923: git merge-tree --write-tree exits 1 with conflicts in docs/d3d12_vulkan.md, docs/linux_proton.md, docs/running.md and runtime/shims/d3d12_vulkan_device.cpp. The whole conflict is with one upstream commit, 76109561f ("--precompile-pipelines builds the skip-listed programs unless --skip-listed"), which is not in the branch's merge base 935a2cd5b. I tested the head tree as authored (a clean git archive of 8a73cb09b) and report the merge separately below.

Environment: Apple M3 Pro, arm64, macOS 27.2.1, Apple clang 21.0.0, CMake 4.5.0, CPython 3.15.2.

What ran

  • New runtime/test/precompile_inflight_test.cpp is portable (standard library, Threads::Threads only, registered at runtime/CMakeLists.txt:892-895 outside the WIN32 block). Configured the head tree with CMake on macOS and built the target through CMake: OK. Ran it: precompile_inflight_test: ok. Also built it standalone with -fsanitize=address,undefined: pass, no report.
  • The 23 tests/test_make_game_*.py plus tests/test_leonida_tui.py on the head tree: all OK (skips: argparse 1, paths 2, preflight 2).
  • Negative control: kept the PR's tests, put make_game.py back to the merge base 935a2cd5b. Every changed suite fails - test_make_game_pipelines.py 13 errors of 14, test_make_game_pipeline_preflight.py 16 of 13 cases (subtests), test_make_game_dry_run.py 5 errors, test_make_game_platform.py 2 failures + 3 errors, test_make_game_argparse.py 1 failure, test_make_game_preflight.py 1 error, test_leonida_tui.py 1 error.
  • python -m compileall -q make_game.py tools tests: clean. python -I make_game.py --help: OK.
  • The crash/retry loop is actually covered, not just the happy path: tests/test_make_game_pipelines.py:269-344 pin exit 2 (warn, stage succeeds), exit 1 (fail, no retry), an NT interrupt status (no retry), one crash then success (retry line, pipeline_crashes.json with the module's SHA-256), the retry limit, and a stale report being dropped.
  • Cannot run here: anything that needs gta6rt.exe (no MSVC/Wine), so the real precompile, the lock, the inflight journal on a device and CTest's precompile_skip_list are unexecuted.

The macOS/off-Windows path is graceful. Called the stage directly on this machine (make_game.pipelines(work, out)), three failure modes, all exit 1 with the intended message and no traceback:

gta6rt.exe was not found: run the runtime stage (clang-cl + xwin) or pass --runtime-build.
No translated shaders yet: run the shaders stage first.
'wine' was not found: install Wine or set WINE to run gta6rt.exe in the pipelines stage.

That includes the macOS-specific clang-cl + xwin hint. I could not get further: the stage genuinely needs a Windows gta6rt.exe under Wine on this platform, and there is no Wine here. If macOS is meant to be able to run --stages pipelines, that is now a Wine + Windows-Vulkan requirement that did not exist before this PR; the preflight says so clearly, but it is worth stating in the PR that macOS users are expected to run shaders/assets/runtime only, or to accept Wine.

Findings

  1. The rebase is not optional; a naive resolution drops main's skip-list reporting and fails a CTest. Main's 76109561f added filtered, listed_left_out, the if (listed && !options.skip_listed) message and the left out: N of M listed in LEONIDA_SKIP_COMPUTE wording to the same two fprintf blocks this PR rewrites (runtime/shims/d3d12_vulkan_device.cpp:22389-22412 and :22514-22529 in the conflicted file). Main also added runtime/test/check_precompile_skip_list.cmake, which asserts that line character for character:

    • :96 expects [precompile] done: ... 0 failed; left out: 0 of 1 listed in LEONIDA_SKIP_COMPUTE, 0 not buildable, 0 filtered out; in N s
    • :105 expects 1 compute entries to build (... , 1 left out by --skip-listed, 0 not buildable)

    The head's replacement lines ("[precompile] %zu compute entries to build (%.1f MB of SPIR-V; %zu filtered out, %zu not buildable, %zu crashed a run), ..." and "done: %zu compiled, ... %zu not buildable, %zu crashed a run, in %.0f s") match neither: they have no "left out ... listed in LEONIDA_SKIP_COMPUTE" text, and crashed a run sits where the regex requires ) or , 0 not buildable). Taking the PR's side in those two hunks would leave precompile_skip_list red after the rebase. The merge must keep main's two sentences and add the crashed count, e.g. ... %zu filtered out, %zu crashed a run) and ... left out: %zu of %zu listed in LEONIDA_SKIP_COMPUTE%s, %zu not buildable, %zu filtered out, %zu crashed a run; in %.0f s. I verified the regexes against both sides; I did not resolve the merge myself.

  2. make_game mislabels the new "another precompile holds the lock" exit. runtime/shims/d3d12_vulkan_device.cpp:22322-22324 returns 1 when requests/precompile.lock is held by another process, and make_game.py:2861 maps every exit 1 to gta6rt could not open the Vulkan device or shader library. Exit 1 is also host.open() failing (:22272), so the code is shared; a user who starts two stages, or a stale window, is told the Vulkan device is broken. Either give the lock its own exit status (2 is taken for "built, some failed"; 3 is free) and a branch in pipelines(), or have pipelines() pass the child's last line through when it matches another --precompile-pipelines is using.

  3. A crashed entry stays skipped for good, and make_game has no way to retry it. runtime/src/precompile_inflight.h deliberately keeps crashed.txt across runs (pinned by runtime/test/precompile_inflight_test.cpp:55-58), and only --all (runtime/src/main.cpp:291, which sets rebuild) clears it. make_game.py's command line is [exe, "--precompile-pipelines", "--threads", N] (:2717) and never passes --all; the warning at :2846-2848 names the entries and pipeline_crashes.json but not how to retry. So after the cause is fixed - the case that matters most, a translator change to that module - every later make_game --stages pipelines leaves it out of the journal again, exits 0, and prints the same warning. The impact is bounded (the title compiles that pipeline at play, as before the PR), but the stage's whole value is filling the journal, and the retry is invisible. A --retry-crashed (or forwarding --all when the user deletes crashed.txt) plus one sentence in docs/pipeline_check.md:352-354 would close it. I could not test the retry end to end here; the finding is from the flag wiring and the C++ test.

  4. Nit: when the first run exits 2, the stage logs the exit 2 warning (:2858) and then collect_crashes() logs a second WARNING: N compute entry(ies) crashed for the same entries, so one failure reads as two. collect_crashes() runs unconditionally after the loop; skipping the repeat when code == 2 already reported it would halve the noise.

Not re-run: the shader corpus and GPU fixtures. No translator, scripts/run_gpu_tests.py or runtime test-harness change; the same-main baseline stands (195 PASS / 3 FAIL / 70 SKIP MoltenVK, 190 / 5 / 73 KosmicKrisp at bdbc7e923).

python -I scripts/check_no_game_data.py on all changed files: clean.

No game files. AI-assisted.

**@⁠wavehs** on GitHub · 2026-11-26 18:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2392#pullrequestreview-6079174467) · **reviewed** **macOS arm64 check of #2392** (MAKE-GAME-PIPELINES-VIA-RUNTIME). Python build driving, the dashboard/docs, a new Windows-side precompile journal and the portable header its test covers. Two commits, head `8a73cb09b`. **It does not merge onto `main` `bdbc7e923`**: `git merge-tree --write-tree` exits 1 with conflicts in `docs/d3d12_vulkan.md`, `docs/linux_proton.md`, `docs/running.md` and `runtime/shims/d3d12_vulkan_device.cpp`. The whole conflict is with one upstream commit, `76109561f` ("--precompile-pipelines builds the skip-listed programs unless --skip-listed"), which is not in the branch's merge base `935a2cd5b`. I tested the head tree as authored (a clean `git archive` of `8a73cb09b`) and report the merge separately below. Environment: Apple M3 Pro, arm64, macOS 27.2.1, Apple clang 21.0.0, CMake 4.5.0, CPython 3.15.2. **What ran** - New `runtime/test/precompile_inflight_test.cpp` is portable (standard library, `Threads::Threads` only, registered at `runtime/CMakeLists.txt:892-895` outside the WIN32 block). Configured the head tree with CMake on macOS and built the target through CMake: OK. Ran it: `precompile_inflight_test: ok`. Also built it standalone with `-fsanitize=address,undefined`: pass, no report. - The 23 `tests/test_make_game_*.py` plus `tests/test_leonida_tui.py` on the head tree: all OK (skips: argparse 1, paths 2, preflight 2). - Negative control: kept the PR's tests, put `make_game.py` back to the merge base `935a2cd5b`. Every changed suite fails - `test_make_game_pipelines.py` 13 errors of 14, `test_make_game_pipeline_preflight.py` 16 of 13 cases (subtests), `test_make_game_dry_run.py` 5 errors, `test_make_game_platform.py` 2 failures + 3 errors, `test_make_game_argparse.py` 1 failure, `test_make_game_preflight.py` 1 error, `test_leonida_tui.py` 1 error. - `python -m compileall -q make_game.py tools tests`: clean. `python -I make_game.py --help`: OK. - The crash/retry loop is actually covered, not just the happy path: `tests/test_make_game_pipelines.py:269-344` pin exit 2 (warn, stage succeeds), exit 1 (fail, no retry), an NT interrupt status (no retry), one crash then success (retry line, `pipeline_crashes.json` with the module's SHA-256), the retry limit, and a stale report being dropped. - Cannot run here: anything that needs `gta6rt.exe` (no MSVC/Wine), so the real precompile, the lock, the inflight journal on a device and CTest's `precompile_skip_list` are unexecuted. **The macOS/off-Windows path is graceful.** Called the stage directly on this machine (`make_game.pipelines(work, out)`), three failure modes, all exit 1 with the intended message and no traceback: ``` gta6rt.exe was not found: run the runtime stage (clang-cl + xwin) or pass --runtime-build. No translated shaders yet: run the shaders stage first. 'wine' was not found: install Wine or set WINE to run gta6rt.exe in the pipelines stage. ``` That includes the macOS-specific `clang-cl + xwin` hint. I could not get further: the stage genuinely needs a Windows `gta6rt.exe` under Wine on this platform, and there is no Wine here. If macOS is meant to be able to run `--stages pipelines`, that is now a Wine + Windows-Vulkan requirement that did not exist before this PR; the preflight says so clearly, but it is worth stating in the PR that macOS users are expected to run `shaders`/`assets`/`runtime` only, or to accept Wine. **Findings** 1. **The rebase is not optional; a naive resolution drops main's skip-list reporting and fails a CTest.** Main's `76109561f` added `filtered`, `listed_left_out`, the `if (listed && !options.skip_listed)` message and the `left out: N of M listed in LEONIDA_SKIP_COMPUTE` wording to the same two `fprintf` blocks this PR rewrites (`runtime/shims/d3d12_vulkan_device.cpp:22389-22412` and `:22514-22529` in the conflicted file). Main also added `runtime/test/check_precompile_skip_list.cmake`, which asserts that line character for character: - `:96` expects `[precompile] done: ... 0 failed; left out: 0 of 1 listed in LEONIDA_SKIP_COMPUTE, 0 not buildable, 0 filtered out; in N s` - `:105` expects `1 compute entries to build (... , 1 left out by --skip-listed, 0 not buildable)` The head's replacement lines (`"[precompile] %zu compute entries to build (%.1f MB of SPIR-V; %zu filtered out, %zu not buildable, %zu crashed a run), ..."` and `"done: %zu compiled, ... %zu not buildable, %zu crashed a run, in %.0f s"`) match neither: they have no "left out ... listed in LEONIDA_SKIP_COMPUTE" text, and `crashed a run` sits where the regex requires `)` or `, 0 not buildable)`. Taking the PR's side in those two hunks would leave `precompile_skip_list` red after the rebase. The merge must keep main's two sentences and add the crashed count, e.g. `... %zu filtered out, %zu crashed a run)` and `... left out: %zu of %zu listed in LEONIDA_SKIP_COMPUTE%s, %zu not buildable, %zu filtered out, %zu crashed a run; in %.0f s`. I verified the regexes against both sides; I did not resolve the merge myself. 2. **`make_game` mislabels the new "another precompile holds the lock" exit.** `runtime/shims/d3d12_vulkan_device.cpp:22322-22324` returns 1 when `requests/precompile.lock` is held by another process, and `make_game.py:2861` maps every exit 1 to `gta6rt could not open the Vulkan device or shader library`. Exit 1 is also `host.open()` failing (`:22272`), so the code is shared; a user who starts two stages, or a stale window, is told the Vulkan device is broken. Either give the lock its own exit status (2 is taken for "built, some failed"; 3 is free) and a branch in `pipelines()`, or have `pipelines()` pass the child's last line through when it matches `another --precompile-pipelines is using`. 3. **A crashed entry stays skipped for good, and `make_game` has no way to retry it.** `runtime/src/precompile_inflight.h` deliberately keeps `crashed.txt` across runs (pinned by `runtime/test/precompile_inflight_test.cpp:55-58`), and only `--all` (`runtime/src/main.cpp:291`, which sets `rebuild`) clears it. `make_game.py`'s command line is `[exe, "--precompile-pipelines", "--threads", N]` (`:2717`) and never passes `--all`; the warning at `:2846-2848` names the entries and `pipeline_crashes.json` but not how to retry. So after the cause is fixed - the case that matters most, a translator change to that module - every later `make_game --stages pipelines` leaves it out of the journal again, exits 0, and prints the same warning. The impact is bounded (the title compiles that pipeline at play, as before the PR), but the stage's whole value is filling the journal, and the retry is invisible. A `--retry-crashed` (or forwarding `--all` when the user deletes `crashed.txt`) plus one sentence in `docs/pipeline_check.md:352-354` would close it. I could not test the retry end to end here; the finding is from the flag wiring and the C++ test. 4. **Nit:** when the first run exits 2, the stage logs the `exit 2` warning (`:2858`) and then `collect_crashes()` logs a second `WARNING: N compute entry(ies) crashed` for the same entries, so one failure reads as two. `collect_crashes()` runs unconditionally after the loop; skipping the repeat when `code == 2` already reported it would halve the noise. **Not re-run**: the shader corpus and GPU fixtures. No translator, `scripts/run_gpu_tests.py` or runtime test-harness change; the same-main baseline stands (195 PASS / 3 FAIL / 70 SKIP MoltenVK, 190 / 5 / 73 KosmicKrisp at `bdbc7e923`). `python -I scripts/check_no_game_data.py` on all changed files: clean. No game files. AI-assisted.
github-bot force-pushed github-bot/gh-2392 from 8a73cb09be to f445e3f7d5 2026-11-26 19:36:18 +00:00 Compare
Author
Owner

@⁠qhukz13 on GitHub · 2026-11-26 19:28 UTC · original

@⁠wavehs thank you, all four were right. Fixed in the force-pushed head, rebased on main 2d43417d4:

  1. Rebase, keeping main's skip-list reporting. precompile_compute_pipelines is main's version with this PR's part added on top.
    • The plan line keeps ... left out by --skip-listed, N not buildable).
    • The done: line is main's sentence word for word. , N crashed a run is added before ; in only when N is not 0, so check_precompile_skip_list.cmake's exact regexes still match.
    • The doc conflicts keep both texts: your skip-list lines and this PR's stage lines.
  2. The busy-lock exit has its own status. A held requests/precompile.lock now exits 3, and the stage reports "another gta6rt --precompile-pipelines is using this pipeline journal" instead of the device message. There is a test for it.
  3. A crashed entry is no longer skipped for good. This is the root of it: a crash is now held against what crashed, not against the name.
    • inflight.txt / crashed.txt lines are <name> <key>.
    • The key is the module file (size and last write, so no read of the module) on this device and driver.
    • A new translation of the module or a new driver gives a new key, and the next run tries it again by itself. A build that returns clears it from the list.
    • --all still forces every one.
    • The stage's warning says this, and so does docs/pipeline_check.md.
  4. One warning. Crashed entries are reported once; the generic exit-2 warning is printed only when nothing was recorded as crashed.

So that the crash path can be tested for real and not only by planting files, LEONIDA_PRECOMPILE_CRASH_TEST=<entry> ends the precompile just before that entry's create.

Tested again: GTX 1050 Ti, NVIDIA 582.66, Windows 10, MSVC RelWithDebInfo.

  • precompile_inflight and main's precompile_skip_list pass. The latter shows the summary lines kept their exact wording.
  • An end-to-end run with real process deaths passes all 17 checks. A crash inside cs_beta's create ends the run with 0xC0000005. The next run names cs_beta, skips it, records cs_beta <key> and exits 2, and keeps skipping it while the file is unchanged. Rewriting the module makes the next run build it and clear the list. --all retries a fresh crash. A held lock exits 3, and --list writes nothing.
  • The whole stage, through make_game.pipelines() with a crash planted in cs_gamma: the first attempt dies, the retry skips it, the stage completes, prints one warning that names cs_gamma and says how it is retried, and writes pipeline_crashes.json.
  • On Linux: the updated precompile_inflight_test under GCC 14 with ASan/UBSan and TSan, and the 15 test_make_game_pipelines cases plus every touched test file.

On macOS: yes, off Windows the stage now needs Wine and a Windows gta6rt.exe, like the game itself. I'll add a sentence to the PR saying that the other stages don't need it.

AI-assisted (Claude Code).

**@⁠qhukz13** on GitHub · 2026-11-26 19:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2392#issuecomment-7201637364) @⁠wavehs thank you, all four were right. Fixed in the force-pushed head, rebased on main `2d43417d4`: 1. **Rebase, keeping main's skip-list reporting.** `precompile_compute_pipelines` is main's version with this PR's part added on top. - The plan line keeps `... left out by --skip-listed, N not buildable)`. - The `done:` line is main's sentence word for word. `, N crashed a run` is added before `; in` only when N is not 0, so `check_precompile_skip_list.cmake`'s exact regexes still match. - The doc conflicts keep both texts: your skip-list lines and this PR's stage lines. 2. **The busy-lock exit has its own status.** A held `requests/precompile.lock` now exits **3**, and the stage reports "another gta6rt --precompile-pipelines is using this pipeline journal" instead of the device message. There is a test for it. 3. **A crashed entry is no longer skipped for good.** This is the root of it: a crash is now held against *what* crashed, not against the name. - `inflight.txt` / `crashed.txt` lines are `<name> <key>`. - The key is the module file (size and last write, so no read of the module) on this device and driver. - A new translation of the module or a new driver gives a new key, and the next run tries it again by itself. A build that returns clears it from the list. - `--all` still forces every one. - The stage's warning says this, and so does `docs/pipeline_check.md`. 4. **One warning.** Crashed entries are reported once; the generic exit-2 warning is printed only when nothing was recorded as crashed. So that the crash path can be tested for real and not only by planting files, `LEONIDA_PRECOMPILE_CRASH_TEST=<entry>` ends the precompile just before that entry's create. **Tested again:** GTX 1050 Ti, NVIDIA 582.66, Windows 10, MSVC RelWithDebInfo. - `precompile_inflight` and main's `precompile_skip_list` pass. The latter shows the summary lines kept their exact wording. - An end-to-end run with real process deaths passes all 17 checks. A crash inside `cs_beta`'s create ends the run with `0xC0000005`. The next run names `cs_beta`, skips it, records `cs_beta <key>` and exits 2, and keeps skipping it while the file is unchanged. Rewriting the module makes the next run build it and clear the list. `--all` retries a fresh crash. A held lock exits 3, and `--list` writes nothing. - The whole stage, through `make_game.pipelines()` with a crash planted in `cs_gamma`: the first attempt dies, the retry skips it, the stage completes, prints one warning that names `cs_gamma` and says how it is retried, and writes `pipeline_crashes.json`. - On Linux: the updated `precompile_inflight_test` under GCC 14 with ASan/UBSan and TSan, and the 15 `test_make_game_pipelines` cases plus every touched test file. On macOS: yes, off Windows the stage now needs Wine and a Windows `gta6rt.exe`, like the game itself. I'll add a sentence to the PR saying that the other stages don't need it. AI-assisted (Claude Code).
Author
Owner

@⁠akimfomin on GitHub · 2026-11-26 20:09 UTC · original

The RTX 5070 review already checked that a second stage run preserves the journal bytes and timestamp. To check whether a fresh runtime gets a driver cache hit, Continued has a useful positive control in the #821 test, lines 363–417. For one synthetic compute pipeline, compare the journal written by this PR with a cache the consuming device wrote itself. Check the valid and application-cache-hit bits. If even the control misses, the driver result is inconclusive. The older test used the checker’s seed, so the input to adapt is the new journal.

Would that control change what you test before accepting runtime cache reuse? PortBridge’s one-PR comparison found it on the earlier revision. On the rebased head the search follows the crash code instead. You or your agent can use the linked test directly. If you try it, a one-line result or reason to skip is enough. No installation or private inputs needed.

AI-assisted source review.

**@⁠akimfomin** on GitHub · 2026-11-26 20:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2392#issuecomment-7202363138) The RTX 5070 review already checked that a second stage run preserves the journal bytes and timestamp. To check whether a fresh runtime gets a driver cache hit, Continued has a useful positive control in [the #821 test, lines 363–417](https://github.com/ubiquitarianism/leonida/blob/32a5d9698022711bc52e3c5cf28766691518dc8e/runtime/test/pipeline_cache_seed_test.cpp#L363-L417). For one synthetic compute pipeline, compare the journal written by this PR with a cache the consuming device wrote itself. Check the valid and application-cache-hit bits. If even the control misses, the driver result is inconclusive. The older test used the checker’s seed, so the input to adapt is the new journal. Would that control change what you test before accepting runtime cache reuse? [PortBridge’s one-PR comparison](https://github.com/akimfomin/PortBridge/blob/0cb1fe46d14f0930e7e347e3c9980a53c9d94be9/audit/evidence/m53/development-search.md) found it on the earlier revision. On the rebased head the search follows the crash code instead. You or your agent can use the linked test directly. If you try it, a one-line result or reason to skip is enough. No installation or private inputs needed. AI-assisted source review.
Author
Owner

@⁠qhukz13 on GitHub · 2026-11-26 20:37 UTC · original

@⁠akimfomin thanks, good control. I ran it rather than adapting the old seed test: #2198's scripts/check_precompile_verify.py --require-hit (head 95267b8c7, built with MSVC on a GTX 1050 Ti, NVIDIA 582.66, Windows 10). It warms the journal with gta6rt --precompile-pipelines in one process, then --verify in a fresh one, and requires the driver's application-cache-hit bit. Result: driver reported application-cache hit: True. This PR's stage only runs that same --precompile-pipelines, so the journal it writes is the one that control checks.

AI-assisted (Claude Code).

**@⁠qhukz13** on GitHub · 2026-11-26 20:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2392#issuecomment-7202911853) @⁠akimfomin thanks, good control. I ran it rather than adapting the old seed test: #2198's `scripts/check_precompile_verify.py --require-hit` (head `95267b8c7`, built with MSVC on a GTX 1050 Ti, NVIDIA 582.66, Windows 10). It warms the journal with `gta6rt --precompile-pipelines` in one process, then `--verify` in a fresh one, and requires the driver's application-cache-hit bit. Result: `driver reported application-cache hit: True`. This PR's stage only runs that same `--precompile-pipelines`, so the journal it writes is the one that control checks. AI-assisted (Claude Code).
Author
Owner

@⁠lixonik on GitHub · 2026-11-26 20:43 UTC · original · reviewed

Retested the rebased head f445e3f7 on Windows 11, MSVC, RTX 5070 and NVIDIA 610.88. precompile_inflight and precompile_skip_list passed. The two targeted Python files had 26 passes and 1 skip. Running the actual make_game.pipelines() twice produced one native journal entry and preserved its bytes and mtime on the second run.

I also tested the fresh-process cache question. I used the same synthetic compute module for three runs of the #2198 --verify diagnostic (95267b8c7). An empty journal gave missing_or_unusable=1. A journal written by the diagnostic executable itself gave verified=1. The journal written by this PR's actual make_game.pipelines() also gave verified=1 in a separate verifier process, with the application-cache-hit bit required. The verifier left both populated journals unchanged.

AI-assisted.

**@⁠lixonik** on GitHub · 2026-11-26 20:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2392#pullrequestreview-6080300502) · **reviewed** Retested the rebased head `f445e3f7` on Windows 11, MSVC, RTX 5070 and NVIDIA 610.88. `precompile_inflight` and `precompile_skip_list` passed. The two targeted Python files had 26 passes and 1 skip. Running the actual `make_game.pipelines()` twice produced one native journal entry and preserved its bytes and mtime on the second run. I also tested the fresh-process cache question. I used the same synthetic compute module for three runs of the #2198 `--verify` diagnostic (`95267b8c7`). An empty journal gave `missing_or_unusable=1`. A journal written by the diagnostic executable itself gave `verified=1`. The journal written by this PR's actual `make_game.pipelines()` also gave `verified=1` in a separate verifier process, with the application-cache-hit bit required. The verifier left both populated journals unchanged. AI-assisted.
This pull request has changes conflicting with the target branch.
  • runtime/shims/d3d12_vulkan_device.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2392/head:github-bot/gh-2392'
git switch 'github-bot/gh-2392'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2392'
git switch 'github-bot/gh-2392'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2392'
git switch 'github-bot/gh-2392'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2392'
git switch 'main'
git merge --squash 'github-bot/gh-2392'
git switch 'main'
git merge --ff-only 'github-bot/gh-2392'
git switch 'main'
git merge 'github-bot/gh-2392'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.