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

Open
opened 2026-11-26 20:21:15 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1407
Author: @Diegobecker07
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: pipelines-eta


📝 Commits (1)

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

📊 Changes

2 files changed (+136 additions, -2 deletions)

View changed files

📝 make_game.py (+36 -2)
➕ tests/test_make_game_pipeline_eta.py (+100 -0)

📄 Description

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)

🔄 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/1407 **Author:** [@Diegobecker07](https://github.com/Diegobecker07) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pipelines-eta` --- ### 📝 Commits (1) - [`b26e434`](https://github.com/ubiquitarianism/leonida/commit/b26e43491f8499c82ee29d244ea8849023fda2b6) make_game pipelines: after each batch, the share done and the time left, weighted by module size (PIPELINES-ETA) ### 📊 Changes **2 files changed** (+136 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+36 -2) ➕ `tests/test_make_game_pipeline_eta.py` (+100 -0) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1435
No description provided.