make_game pipelines: after each batch, the share done and the time left, weighted by module size (PIPELINES-ETA) #1407

Open
github-bot wants to merge 1 commit from github-bot/gh-1407 into main AGit
Owner

@⁠Diegobecker07 on GitHub · 2026-11-24 23:34 UTC · original
Diegobecker07:pipelines-eta → main · +136 −2 · 2 files · 1 commits · open

Claimed in the coordination issue as: PIPELINES-ETA (#14)

What and why

The pipelines stage of make_game.py logged only pipelines: checking shaders N-M of T in a fresh process per batch. Its batches of 500 modules take from seconds to half an hour, so a multi-hour stage gave no idea of when it would end; on my run every guess from the batch count came out hours early.

After each batch it now logs the shaders checked, the share of the estimated compile time behind them and the time left at the pace so far:

pipelines: 10000/26503 shaders checked, 43% of the estimated compile time, ~1h 05m left
…
pipelines: 26503/26503 shaders checked, 3h 12m elapsed

A module's estimated cost is its SPIR-V size in MB to the power PIPELINE_COST_EXPONENT (1.5), because a large module compiles disproportionately slower than a small one. The estimate only feeds this log line; the batching, the crash recovery and what runs are unchanged. A stopped batch (setup error, interrupt) logs no progress line. A run whose checker can't take ranges keeps one batch and no line, as before.

Measurement

One full-corpus run on my machine (RTX 5070 Ti, driver 621.24, wave64-emulated translation at 82a2aabcc): 41 batches of 500 finished in 2.82 h. The batches were 23-849 MB of SPIR-V and took 16 s to 26 min. Batch times rank with their bytes at Spearman 0.93.

Time left predicted after k batches, against the actual time to the end of batch 41:

after actual by batch count by bytes by MB^1.5 (this PR) by MB^2
5 159 min −55% −41% −25% +3%
10 151 min −61% −33% −6% +41%
20 126 min −64% −39% −17% +20%
30 98 min −73% −43% −15% +28%
38 57 min −85% −50% −18% +21%

1.5 is the exponent that stays closest without overshooting: an estimate a little short is less misleading than one that swings by 40%. One run on one GPU is not a model of every driver, so the constant says where it comes from and is easy to retune with more runs.

Tested

  • tests/test_make_game_pipeline_eta.py (new, 7 tests):
    • pipeline_costs, including a module without its .spv;
    • the progress line, with the share, time left, elapsed time and the no-estimate case;
    • the real pipelines() with a scripted checker result and clock, checking the three lines of a 5-module, 3-batch run and that a stopped batch logs nothing.
  • All 25 tests/test_make_game_*.py (with the new one), tests/test_leonida_tui.py and tests/test_text_write_line_endings.py: OK.
  • python -m compileall -q make_game.py tools tests, python -I make_game.py --help, scripts/check_no_game_data.py on the changed files: OK.
  • Merges cleanly with main and with the other open make_game.py pull requests that touch nearby code, #1337 and #1378.

GPUs tested: n/a for this change (the measurement above is from an NVIDIA GeForce RTX 5070 Ti, driver 621.24, Windows 11 Pro 26300)

AI-assisted: yes

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)
**@⁠Diegobecker07** on GitHub · 2026-11-24 23:34 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1407) `Diegobecker07:pipelines-eta` → `main` · +136 −2 · 2 files · 1 commits · open Claimed in the coordination issue as: PIPELINES-ETA (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why The pipelines stage of `make_game.py` logged only `pipelines: checking shaders N-M of T in a fresh process` per batch. Its batches of 500 modules take from seconds to half an hour, so a multi-hour stage gave no idea of when it would end; on my run every guess from the batch count came out hours early. After each batch it now logs the shaders checked, the share of the estimated compile time behind them and the time left at the pace so far: ``` pipelines: 10000/26503 shaders checked, 43% of the estimated compile time, ~1h 05m left … pipelines: 26503/26503 shaders checked, 3h 12m elapsed ``` A module's estimated cost is its SPIR-V size in MB to the power `PIPELINE_COST_EXPONENT` (1.5), because a large module compiles disproportionately slower than a small one. The estimate only feeds this log line; the batching, the crash recovery and what runs are unchanged. A stopped batch (setup error, interrupt) logs no progress line. A run whose checker can't take ranges keeps one batch and no line, as before. ### Measurement One full-corpus run on my machine (RTX 5070 Ti, driver 621.24, wave64-emulated translation at `82a2aabcc`): 41 batches of 500 finished in 2.82 h. The batches were 23-849 MB of SPIR-V and took 16 s to 26 min. Batch times rank with their bytes at Spearman 0.93. Time left predicted after k batches, against the actual time to the end of batch 41: | after | actual | by batch count | by bytes | by MB^1.5 (this PR) | by MB^2 | |---:|---:|---:|---:|---:|---:| | 5 | 159 min | −55% | −41% | −25% | +3% | | 10 | 151 min | −61% | −33% | −6% | +41% | | 20 | 126 min | −64% | −39% | −17% | +20% | | 30 | 98 min | −73% | −43% | −15% | +28% | | 38 | 57 min | −85% | −50% | −18% | +21% | 1.5 is the exponent that stays closest without overshooting: an estimate a little short is less misleading than one that swings by 40%. One run on one GPU is not a model of every driver, so the constant says where it comes from and is easy to retune with more runs. ### Tested - `tests/test_make_game_pipeline_eta.py` (new, 7 tests): - `pipeline_costs`, including a module without its `.spv`; - the progress line, with the share, time left, elapsed time and the no-estimate case; - the real `pipelines()` with a scripted checker result and clock, checking the three lines of a 5-module, 3-batch run and that a stopped batch logs nothing. - All 25 `tests/test_make_game_*.py` (with the new one), `tests/test_leonida_tui.py` and `tests/test_text_write_line_endings.py`: OK. - `python -m compileall -q make_game.py tools tests`, `python -I make_game.py --help`, `scripts/check_no_game_data.py` on the changed files: OK. - Merges cleanly with `main` and with the other open `make_game.py` pull requests that touch nearby code, #1337 and #1378. GPUs tested: n/a for this change (the measurement above is from an NVIDIA GeForce RTX 5070 Ti, driver 621.24, Windows 11 Pro 26300) AI-assisted: yes ### 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)
The pipelines stage logged only "checking shaders N-M of T" per batch, while its batches of 500 modules take from
seconds to half an hour, so the stage gave no idea of when it would end. After each batch it now logs the shaders
checked, the share of the estimated compile time behind them and the time left at the pace so far, and the
elapsed time after the last batch.

A module's estimated cost is its SPIR-V size in MB to the power PIPELINE_COST_EXPONENT (1.5): a large module
compiles disproportionately slower. On one full-corpus run (RTX 5070 Ti, driver 621.24, 41 batches of 500 taking
16 s to 26 min) the batch times ranked with their bytes at Spearman 0.93, and the time left after 5 to 38 batches
was 55-85% under the actual by batch count, 33-50% under by bytes, 6-25% under with 1.5, and 3-41% over with 2.
The estimate only feeds the log line; batching and what runs are unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:50:22 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 09:28 UTC · original

Reviewed b26e434: ran the new tests/test_make_game_pipeline_eta.py on the PR (7 OK) and on main (7 expected
failures), plus the pipeline batches/pipelines/preflight/interrupt/progress, argparse and docs tests on both
trees (all OK) and make_game.py --help. The PR is based on an older main, but it merges conflict-free and
cherry-picked onto current main still passes the eta, batches and pipelines tests; a stage-level probe shows
the same exit codes as main for all-ok, validation-failing and interrupted batches, with only new progress
lines and sane formats at the edges. No finding.
AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 09:28 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1407#issuecomment-7158373384) Reviewed b26e434: ran the new tests/test_make_game_pipeline_eta.py on the PR (7 OK) and on main (7 expected failures), plus the pipeline batches/pipelines/preflight/interrupt/progress, argparse and docs tests on both trees (all OK) and make_game.py --help. The PR is based on an older main, but it merges conflict-free and cherry-picked onto current main still passes the eta, batches and pipelines tests; a stage-level probe shows the same exit codes as main for all-ok, validation-failing and interrupted batches, with only new progress lines and sane formats at the edges. No finding. AI-assisted review. **Recommendation:** Merge
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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