[PR #192] [CLOSED] make_game assets: exports and pool follow-ups use --jobs instead of running one by one #244

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/192
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/9924


📝 Commits (1)

  • d01ed69 make_game: run asset exports and pool follow-ups on --jobs workers, results in order

📊 Changes

2 files changed (+172 additions, -16 deletions)

View changed files

📝 make_game.py (+69 -16)
📝 tests/test_make_game_assets_pools.py (+103 -0)

📄 Description

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.

🔄 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/192 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/9924` --- ### 📝 Commits (1) - [`d01ed69`](https://github.com/ubiquitarianism/leonida/commit/d01ed69b068a58d81ae645ca6c05606250573650) make_game: run asset exports and pool follow-ups on --jobs workers, results in order ### 📊 Changes **2 files changed** (+172 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `make_game.py` (+69 -16) 📝 `tests/test_make_game_assets_pools.py` (+103 -0) </details> ### 📄 Description > 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:15 +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#244
No description provided.