Repository navigation
make_game: the pipelines stage fills the runtime's own journal with gta6rt --precompile-pipelines (MAKE-GAME-PIPELINES-VIA-RUNTIME) - #2392
Conversation
lixonik
left a comment
There was a problem hiding this comment.
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.
wavehs
left a comment
There was a problem hiding this comment.
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.cppis portable (standard library,Threads::Threadsonly, registered atruntime/CMakeLists.txt:892-895outside 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_*.pyplustests/test_leonida_tui.pyon the head tree: all OK (skips: argparse 1, paths 2, preflight 2). - Negative control: kept the PR's tests, put
make_game.pyback to the merge base935a2cd5b. Every changed suite fails -test_make_game_pipelines.py13 errors of 14,test_make_game_pipeline_preflight.py16 of 13 cases (subtests),test_make_game_dry_run.py5 errors,test_make_game_platform.py2 failures + 3 errors,test_make_game_argparse.py1 failure,test_make_game_preflight.py1 error,test_leonida_tui.py1 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-344pin exit 2 (warn, stage succeeds), exit 1 (fail, no retry), an NT interrupt status (no retry), one crash then success (retry line,pipeline_crashes.jsonwith 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'sprecompile_skip_listare 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
-
The rebase is not optional; a naive resolution drops main's skip-list reporting and fails a CTest. Main's
76109561faddedfiltered,listed_left_out, theif (listed && !options.skip_listed)message and theleft out: N of M listed in LEONIDA_SKIP_COMPUTEwording to the same twofprintfblocks this PR rewrites (runtime/shims/d3d12_vulkan_device.cpp:22389-22412and:22514-22529in the conflicted file). Main also addedruntime/test/check_precompile_skip_list.cmake, which asserts that line character for character::96expects[precompile] done: ... 0 failed; left out: 0 of 1 listed in LEONIDA_SKIP_COMPUTE, 0 not buildable, 0 filtered out; in N s:105expects1 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, andcrashed a runsits where the regex requires)or, 0 not buildable). Taking the PR's side in those two hunks would leaveprecompile_skip_listred 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. -
make_gamemislabels the new "another precompile holds the lock" exit.runtime/shims/d3d12_vulkan_device.cpp:22322-22324returns 1 whenrequests/precompile.lockis held by another process, andmake_game.py:2861maps every exit 1 togta6rt could not open the Vulkan device or shader library. Exit 1 is alsohost.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 inpipelines(), or havepipelines()pass the child's last line through when it matchesanother --precompile-pipelines is using. -
A crashed entry stays skipped for good, and
make_gamehas no way to retry it.runtime/src/precompile_inflight.hdeliberately keepscrashed.txtacross runs (pinned byruntime/test/precompile_inflight_test.cpp:55-58), and only--all(runtime/src/main.cpp:291, which setsrebuild) clears it.make_game.py's command line is[exe, "--precompile-pipelines", "--threads", N](:2717) and never passes--all; the warning at:2846-2848names the entries andpipeline_crashes.jsonbut not how to retry. So after the cause is fixed - the case that matters most, a translator change to that module - every latermake_game --stages pipelinesleaves 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--allwhen the user deletescrashed.txt) plus one sentence indocs/pipeline_check.md:352-354would close it. I could not test the retry end to end here; the finding is from the flag wiring and the C++ test. -
Nit: when the first run exits 2, the stage logs the
exit 2warning (:2858) and thencollect_crashes()logs a secondWARNING: N compute entry(ies) crashedfor the same entries, so one failure reads as two.collect_crashes()runs unconditionally after the loop; skipping the repeat whencode == 2already 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.
8a73cb0 to
f445e3f
Compare
|
@wavehs thank you, all four were right. Fixed in the force-pushed head, rebased on main
So that the crash path can be tested for real and not only by planting files, Tested again: GTX 1050 Ti, NVIDIA 582.66, Windows 10, MSVC RelWithDebInfo.
On macOS: yes, off Windows the stage now needs Wine and a Windows AI-assisted (Claude Code). |
|
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 thanks, good control. I ran it rather than adapting the old seed test: #2198's AI-assisted (Claude Code). |
lixonik
left a comment
There was a problem hiding this comment.
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.
|
Tested 1. A stage that is stopped marks the entries it interrupted as crashed. I stopped the stage's
2. The retry outlives the stage. After the stage's Python process ended, the retried 3. With the real library, the stage starts with the programs the game is told to skip. The plan line was
Not tested: a full stage run, journal reuse by the stage on this library, Wine. AI-assisted (Claude Code). |
…ta6rt --precompile-pipelines 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 <noreply@anthropic.com>
…nd reported 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) left 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 "<name> <key>" for 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 an entry while its key is the one that crashed. The key is the module file (size and last write, no read of the module) on this device and driver, so a new translation of the module or a new driver tries it again, and a build that returns clears it. --all tries every recorded entry again. One precompile per journal folder (requests/precompile.lock); a second one exits 3 with its own message, which make_game reports as such instead of as a device failure. The summary keeps main's wording (check_precompile_skip_list.cmake) and adds ", N crashed a run" only when N is not 0. LEONIDA_PRECOMPILE_CRASH_TEST=<entry> ends the run before that entry's create, for tests. make_game's pipelines stage reads the "<name> <key>" lines, reports crashed entries once (not also as a generic exit-2 warning) and says how they are retried; docs/pipeline_check.md says the same. precompile_inflight_test covers the record, a simulated dead run, a changed key, a returning build, --all and concurrent builders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f445e3f to
81c7fbf
Compare
Claimed in the coordination issue as: MAKE-GAME-PIPELINES-VIA-RUNTIME (#1608 (comment), corrected in #1608 (comment))
Touches the code this replaces in: #2113, #1407, #846, #285, #1319 and #2042 (all on the
vk_pipeline_checkside 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.cmakepasses).What and why
make_game.py --stages pipelinesranvk_pipeline_checkover the translated shaders and wrote onepipeline_cache.bin. The runtime never hits that cache, which the maintainers' status lists as "vk_pipeline_check never matches the runtime's cache keys":pipeline_cache.d/cs-<key>.bin.pApplicationName, its own executable name, robustness off, a different extension set, a different bindless set-0 layout,VK_SHADER_STAGE_ALLpush constants for bound compute, and nodecide_subgroup_size/REQUIRE_FULL_SUBGROUPS.docs/running.mdtold 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-pipelinesalready is that program: the same device, layouts,build_compute_pipelineand journal names as play. So the stage now runs it.The change
make_game.py(stagepipelines):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, withWINEhonoured.LEONIDA_SHADERSandLEONIDA_PIPELINE_CACHE_DIRpoint at the run'swork/shaders/spirvand--out, converted toZ:\...under Wine, unless the user set them.[precompile] i/nlines drive the stage's progress.PIPELINE_CRASH_RETRIES(5).<out>/pipeline_crashes.jsonas before, with each module's SHA-256.gta6rt.exemust exist; off Windows, Wine must exist. Off Windows without the cross-build or Wine, the default stage list dropspipelinesalong withruntime.vk_pipeline_checkdriving code goes: the exe lookup, staleness check, Linux auto-build, 500-entry batching and the BVH seeding pass. The precompile loadsbvh/,fspx*/,exe/andlibrary/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: therequests/<name>.buildinglock isDELETE_ON_CLOSE. A rerun built the same module first again and died again.runtime/src/precompile_inflight.h:requests/inflight.txtlists<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.requests/crashed.txtand 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.--alltries every recorded one now.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.--listtouches 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):-fsanitize=address,undefinedand with ThreadSanitizer;crashed.txtremoved, it fails at the dead-run check.gta6rt --precompile-pipelineswith real process deaths (LEONIDA_PRECOMPILE_CRASH_TEST), 17 checks, all pass:0xC0000005and leaves<name> <key>ininflight.txt;crashed.txt, exits 2 with main's summary wording plus, 1 crashed a run, and keeps skipping it while the module file is unchanged;--allbuilds a freshly crashed entry and clears the list;--listwrites nothing.main's
precompile_skip_listpasses alongsideprecompile_inflight.The stage end to end on the same machine, through
make_game.pipelines()with that build as--runtime-build:<out>/pipeline_cache.d, progress3/3;pipeline_crashes.jsonnaming 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 fakegta6rt: 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;tests/test_make_game_*.py, plustest_ctest_registration,test_text_write_line_endingsandtest_docs_env_vars.test_make_game_pipeline_batches.pyis removed with the batching it tested.Every standalone
tests/test_*.pyon 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 main935a2cd5b. The pytest-only files were not run here.python -m compileall,make_game.py --help,scripts/check_no_game_data.pyon every changed file, andgit diff --check: clean.Off Windows the stage now needs Wine and a Windows
gta6rt.exe, as playing does; theshaders,assetsandruntimestages 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
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code