[PR #43] [MERGED] OLD-7148: make_game and first_light rebuild or report a stale vk_pipeline_check / vk_harness #95

Closed
opened 2026-11-26 20:16:47 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/43
Author: @ItsMrDubey
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: stale-vk-tools


📝 Commits (1)

  • dfd2392 make_game, first_light: a vk_pipeline_check or vk_harness older than its sources is rebuilt or reported, not reused silently

📊 Changes

5 files changed (+207 additions, -8 deletions)

View changed files

📝 make_game.py (+30 -6)
📝 tests/test_first_light_harness_paths.py (+46 -0)
📝 tests/test_make_game_pipeline_preflight.py (+59 -0)
📝 tools/first_light.py (+22 -2)
➕ tools/stale_build.py (+50 -0)

📄 Description

Claimed in the coordination issue as: OLD-7148 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964)

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/43 **Author:** [@ItsMrDubey](https://github.com/ItsMrDubey) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `stale-vk-tools` --- ### 📝 Commits (1) - [`dfd2392`](https://github.com/ubiquitarianism/leonida/commit/dfd239266fd62e1fbbfcf264e9bb4e5c8e8dc801) make_game, first_light: a vk_pipeline_check or vk_harness older than its sources is rebuilt or reported, not reused silently ### 📊 Changes **5 files changed** (+207 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+30 -6) 📝 `tests/test_first_light_harness_paths.py` (+46 -0) 📝 `tests/test_make_game_pipeline_preflight.py` (+59 -0) 📝 `tools/first_light.py` (+22 -2) ➕ `tools/stale_build.py` (+50 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-7148 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964) ### 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:47 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#95
No description provided.