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

Merged
Diegobecker07 merged 1 commit from upstream-pr/1407 into main 2026-11-28 14:39:59 +00:00
Diegobecker07 commented 2026-11-24 23:34:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Diegobecker07 on 2026-11-24T23:34:51Z.


Claimed in the coordination issue as: PIPELINES-ETA (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147477749)

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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5482162374 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1407). Originally posted by [Diegobecker07](https://github.com/Diegobecker07) on 2026-11-24T23:34:51Z. --- Claimed in the coordination issue as: PIPELINES-ETA (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147477749) ### 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)
PierreEbele commented 2026-11-25 09:28:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T09:28:12Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7158373384 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1407#issuecomment-7158373384). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T09:28:12Z. --- 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
MoonEyes commented 2026-11-28 14:39:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T14:39:54Z.


Red/green: pytest tests/test_make_game_pipeline_eta.py fails on main (7 failed) and passes on head b26e43491f merged with main (7 passed).
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7240838734 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1407#issuecomment-7240838734). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T14:39:54Z. --- Red/green: `pytest tests/test_make_game_pipeline_eta.py` fails on main (7 failed) and passes on head b26e43491f84 merged with main (7 passed). Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1407
No description provided.