OLD-7148: make_game and first_light rebuild or report a stale vk_pipeline_check / vk_harness #43

Manually merged
github merged 1 commit from gh-pr/43/head into gh-pr/43/base 2026-11-26 08:42:05 +00:00
Owner

@⁠ItsMrDubey on GitHub · 2026-11-24 02:06 UTC · original
ItsMrDubey:stale-vk-tools → main · +207 −8 · 5 files · 1 commits · merged 2026-11-24 02:27 UTC

Claimed in the coordination issue as: OLD-7148 (#14)

What and why

Old #7148: make_game.py and tools/first_light.py took whichever vk_pipeline_check / vk_harness was already in runtime/build and used it without checking it. After a pull that changed the program, they kept running the binary built from the old sources and said nothing. make_game.py only built the Linux checker when it was missing. first_light.py never builds anything. No old-pr branch in #17 covers this, so this is a new fix.

The fix:

  • New tools/stale_build.py. newer_sources(exe, root, name) returns the sources of runtime/test/<name>.cpp that are newer than exe. That means the .cpp plus every header it pulls in through #include "...", followed recursively. runtime/CMakeLists.txt is left out on purpose: a CMake change that doesn't touch the program doesn't relink it, so counting it would flag a current binary as stale on every run.
  • make_game.py preflight, off Windows: the checker is now rebuilt when it is stale as well as when it is missing. This uses the existing build_pipeline_check, which runs an incremental cmake --build. If CMake isn't installed, the existing checker is still used, as before.
  • make_game.py pipelines(), on all platforms: before the stage starts it logs a WARNING if the checker is still older than its sources. The warning names the changed files and how to rebuild (on Windows: the runtime stage with VULKAN_SDK set).
  • first_light.py find_harness() prints the same kind of warning to stderr for a stale vk_harness.
  • Only binaries under this checkout's runtime/build are compared. A --runtime-build, --harness or LEONIDA_VK_HARNESS binary from another folder is not: its timestamp says nothing about these sources.

Tested

Windows 11, Python 3.11.9, no GPU or compiler needed (synthetic files with set mtimes; the build is mocked).

  • Repro on origin/main: a runtime/build/linux/vk_pipeline_check older than runtime/test/vk_pipeline_check.cpp, with os.name mocked to posix and CMake present. preflight(["pipelines"]) did not call build_pipeline_check. With this branch it does.
  • python -I tests/test_make_game_pipeline_preflight.py: OK (20 tests, 1 POSIX-only skip). New tests: a stale checker is rebuilt; a current one is not; without CMake a stale one is used and pipelines() logs the warning; a checker outside runtime/build is not compared.
  • python -I tests/test_first_light_harness_paths.py: OK (7 tests). New tests: a stale harness is warned about, including a header under runtime/src; a current one is quiet; an explicit harness outside the build folder is not compared.
  • tests/test_first_light*.py, test_leonida_tui.py, test_make_game_{assets_*,container,empty_translation,interrupt,pick,pipeline_batches,progress,python_version,resume,submodule,translate_cleanup,translation_completeness,translator_flags}.py, and the shader/audio/bvh/fspx/ttpf stage tests that import make_game: all OK.
  • test_make_game_{argparse,destinations,dry_run,paths,pipelines,platform,preflight,wave64}.py fail on this machine (Python 3.11, Windows). They fail the same way on origin/main: I compared the failure counts for each file, and the full list of failing test names for test_make_game_preflight.py, which is identical.
  • python -I scripts/check_no_game_data.py on every changed file: clean.

AI-assisted: yes

Checklist

  • 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 rule
**@⁠ItsMrDubey** on GitHub · 2026-11-24 02:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/43) `ItsMrDubey:stale-vk-tools` → `main` · +207 −8 · 5 files · 1 commits · merged 2026-11-24 02:27 UTC Claimed in the coordination issue as: OLD-7148 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why Old #7148: `make_game.py` and `tools/first_light.py` took whichever `vk_pipeline_check` / `vk_harness` was already in `runtime/build` and used it without checking it. After a pull that changed the program, they kept running the binary built from the old sources and said nothing. `make_game.py` only built the Linux checker when it was missing. `first_light.py` never builds anything. No old-pr branch in #17 covers this, so this is a new fix. The fix: - New `tools/stale_build.py`. `newer_sources(exe, root, name)` returns the sources of `runtime/test/<name>.cpp` that are newer than `exe`. That means the `.cpp` plus every header it pulls in through `#include "..."`, followed recursively. `runtime/CMakeLists.txt` is left out on purpose: a CMake change that doesn't touch the program doesn't relink it, so counting it would flag a current binary as stale on every run. - `make_game.py` preflight, off Windows: the checker is now rebuilt when it is stale as well as when it is missing. This uses the existing `build_pipeline_check`, which runs an incremental `cmake --build`. If CMake isn't installed, the existing checker is still used, as before. - `make_game.py` `pipelines()`, on all platforms: before the stage starts it logs a WARNING if the checker is still older than its sources. The warning names the changed files and how to rebuild (on Windows: the runtime stage with VULKAN_SDK set). - `first_light.py` `find_harness()` prints the same kind of warning to stderr for a stale `vk_harness`. - Only binaries under this checkout's `runtime/build` are compared. A `--runtime-build`, `--harness` or `LEONIDA_VK_HARNESS` binary from another folder is not: its timestamp says nothing about these sources. ### Tested Windows 11, Python 3.11.9, no GPU or compiler needed (synthetic files with set mtimes; the build is mocked). - Repro on origin/main: a `runtime/build/linux/vk_pipeline_check` older than `runtime/test/vk_pipeline_check.cpp`, with `os.name` mocked to posix and CMake present. `preflight(["pipelines"])` did not call `build_pipeline_check`. With this branch it does. - `python -I tests/test_make_game_pipeline_preflight.py`: OK (20 tests, 1 POSIX-only skip). New tests: a stale checker is rebuilt; a current one is not; without CMake a stale one is used and `pipelines()` logs the warning; a checker outside `runtime/build` is not compared. - `python -I tests/test_first_light_harness_paths.py`: OK (7 tests). New tests: a stale harness is warned about, including a header under `runtime/src`; a current one is quiet; an explicit harness outside the build folder is not compared. - `tests/test_first_light*.py`, `test_leonida_tui.py`, `test_make_game_{assets_*,container,empty_translation,interrupt,pick,pipeline_batches,progress,python_version,resume,submodule,translate_cleanup,translation_completeness,translator_flags}.py`, and the shader/audio/bvh/fspx/ttpf stage tests that import make_game: all OK. - `test_make_game_{argparse,destinations,dry_run,paths,pipelines,platform,preflight,wave64}.py` fail on this machine (Python 3.11, Windows). They fail the same way on origin/main: I compared the failure counts for each file, and the full list of failing test names for `test_make_game_preflight.py`, which is identical. - `python -I scripts/check_no_game_data.py` on every changed file: clean. AI-assisted: yes ### Checklist - [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 rule
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:42:04 +00:00
github manually merged commit dfd239266f into gh-pr/43/base 2026-11-26 08:42:05 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.