mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #2392] make_game: the pipelines stage fills the runtime's own journal with gta6rt --precompile-pipelines (MAKE-GAME-PIPELINES-VIA-RUNTIME) #2394
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2394
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2392
Author: @qhukz13
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:cont/pipelines-via-runtime📝 Commits (2)
5d469d8make_game: the pipelines stage fills the runtime's own journal with gta6rt --precompile-pipelinesf445e3fprecompile: a module that kills the run is skipped on the next one, and reported📊 Changes
20 files changed (+1100 additions, -1170 deletions)
View changed files
📝
README.md(+7 -8)📝
docs/d3d12_vulkan.md(+3 -3)📝
docs/linux.md(+4 -4)📝
docs/linux_proton.md(+7 -5)📝
docs/pipeline_check.md(+18 -36)📝
docs/running.md(+3 -2)📝
make_game.py(+219 -263)📝
runtime/CMakeLists.txt(+5 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+74 -2)➕
runtime/src/precompile_inflight.h(+114 -0)📝
runtime/src/shader_library.h(+13 -0)➕
runtime/test/precompile_inflight_test.cpp(+119 -0)📝
tests/test_leonida_tui.py(+4 -6)📝
tests/test_make_game_argparse.py(+8 -8)📝
tests/test_make_game_dry_run.py(+18 -24)➖
tests/test_make_game_pipeline_batches.py(+0 -247)📝
tests/test_make_game_pipeline_preflight.py(+80 -182)📝
tests/test_make_game_pipelines.py(+352 -326)📝
tests/test_make_game_platform.py(+49 -52)📝
tests/test_make_game_preflight.py(+3 -2)📄 Description
Claimed in the coordination issue as: MAKE-GAME-PIPELINES-VIA-RUNTIME (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7198052250, corrected in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7198532316)
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.