make_game assets: exports and pool follow-ups use --jobs instead of running one by one #192

Closed
github-bot wants to merge 1 commit from gh-pr/192/head into gh-pr/192/base
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:40 UTC · original
ubiquitarianism:old-pr/9924 → main · +172 −16 · 2 files · 1 commits · closed without merging

Carried over from old PR 9924 by tedin7 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9924, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
tedin7: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

@ItsNotRexed: an exe PR, as you asked.

What

make_game.assets() took jobs but ran the archive exports, the texture-pool exports and the pool follow-ups (ttpf_assets.complete_pool) in plain for loops, one after the other. Each list now runs on up to --jobs workers (parallel_map in make_game.py):

  • archive and pool exports: threads (each one is an rpf9dump subprocess). rpf9dump is already multi-threaded, so the workers share the budget: with N side-by-side exports each gets --jobs budget//N, never more than --jobs in total. One worker (the default for --jobs 1, or a single item) runs inline exactly as before.
  • pool follow-ups: processes, since complete_pool is pure Python (GIL).
  • Results are taken in list order: log lines, the first failure reported, and every output file are the same as a serial run. The first failure stops work not yet started.

Not touched: the audio steps, tools/rdna2spirv.py (#9779 shard balancing, #9777 work_root). Checked open PRs for "assets" and "make_game": none changes this function.

Why

On a build with many texture pools the follow-up pass is the long single-core tail of the assets stage.

Tested

  • python -I tests/test_make_game_assets_pools.py: 12 tests pass (8 existing, 4 new).
  • New tests make a fake job finish only if a second job runs at the same moment (file rendezvous, 8 s limit): exports side by side with a --jobs budget of 2 each out of 4, pool follow-ups side by side in worker processes with log lines in pool order, --jobs 1 keeps serial order, and the first missing manifest in pool order is the one reported.
  • Negative control: with the old make_game.py the two concurrency tests fail ("export ran alone", "pool follow-up ran alone"); the other tests pass.
  • Other tests/test_make_game_*.py pass; test_make_game_resume.py (11 errors) and test_make_game_empty_translation.py (1 error) fail identically on origin/main, unrelated.
  • Not measured on a real game folder (no game data here); the output files are produced by the same calls, only scheduled differently.
**@⁠Andretuta** on GitHub · 2026-11-24 02:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/192) `ubiquitarianism:old-pr/9924` → `main` · +172 −16 · 2 files · 1 commits · closed without merging > Carried over from **old PR 9924** by `tedin7` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9924`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `tedin7`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): `@ItsNotRexed`: an exe PR, as you asked. ## What `make_game.assets()` took `jobs` but ran the archive exports, the texture-pool exports and the pool follow-ups (`ttpf_assets.complete_pool`) in plain `for` loops, one after the other. Each list now runs on up to `--jobs` workers (`parallel_map` in make_game.py): - archive and pool exports: threads (each one is an rpf9dump subprocess). rpf9dump is already multi-threaded, so the workers share the budget: with N side-by-side exports each gets `--jobs budget//N`, never more than `--jobs` in total. One worker (the default for `--jobs 1`, or a single item) runs inline exactly as before. - pool follow-ups: processes, since `complete_pool` is pure Python (GIL). - Results are taken in list order: log lines, the first failure reported, and every output file are the same as a serial run. The first failure stops work not yet started. Not touched: the audio steps, `tools/rdna2spirv.py` (`#9779` shard balancing, `#9777` work_root). Checked open PRs for "assets" and "make_game": none changes this function. ## Why On a build with many texture pools the follow-up pass is the long single-core tail of the assets stage. ## Tested - `python -I tests/test_make_game_assets_pools.py`: 12 tests pass (8 existing, 4 new). - New tests make a fake job finish only if a second job runs at the same moment (file rendezvous, 8 s limit): exports side by side with a `--jobs` budget of 2 each out of 4, pool follow-ups side by side in worker processes with log lines in pool order, `--jobs 1` keeps serial order, and the first missing manifest in pool order is the one reported. - Negative control: with the old `make_game.py` the two concurrency tests fail ("export ran alone", "pool follow-up ran alone"); the other tests pass. - Other `tests/test_make_game_*.py` pass; `test_make_game_resume.py` (11 errors) and `test_make_game_empty_translation.py` (1 error) fail identically on origin/main, unrelated. - Not measured on a real game folder (no game data here); the output files are produced by the same calls, only scheduled differently.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:48:13 +00:00
github-bot closed this pull request 2026-11-26 08:48:13 +00:00
Author
Owner

@⁠Diegobecker07 on GitHub · 2026-11-24 16:50 UTC · original

Carried over as #1013 (OLD-9924): tedin7's commit is kept as the first commit, rebased on current main, with the follow-ups in worker processes started costliest first. Measured on the retail package: the pass went from 78 min 30 s (serial) to 10.4 min with 12 workers, with byte-identical output. Once #1013 is reviewed, this draft can be closed in its favour.

**@⁠Diegobecker07** on GitHub · 2026-11-24 16:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/192#issuecomment-7138286459) Carried over as #1013 (OLD-9924): tedin7's commit is kept as the first commit, rebased on current `main`, with the follow-ups in worker processes started costliest first. Measured on the retail package: the pass went from 78 min 30 s (serial) to 10.4 min with 12 workers, with byte-identical output. Once #1013 is reviewed, this draft can be closed in its favour.
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 19:19 UTC · original

This carry-over of old upstream PR 9924 has been taken over in #1013, so I'm closing this draft as #17 describes. The branch old-pr/9924 stays.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 19:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/192#issuecomment-7141929255) This carry-over of old upstream PR 9924 has been taken over in #1013, so I'm closing this draft as #17 describes. The branch `old-pr/9924` stays. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.