Translate: --warm uses every logical core by default, as --jobs says #332

Manually merged
github merged 1 commit from github-bot/gh-332 into a-publier 2026-11-27 00:57:57 +00:00 AGit
Owner

@⁠TinkerBell-90 on GitHub · 2026-11-26 20:33 UTC · original
TinkerBell-90:translate-warm-every-core → a-publier · +20 −5 · 1 files · 1 commits · merged 2026-11-26 22:30 UTC

Fixes #292.

translate --warm took 4 threads when --jobs was not given, while the flag's help says "every logical core" and the two other paths of translate.rs (translate, shaders) do that. The three paths now take their count from one function, worker_threads: every logical core by default, never fewer than one (the .max(1) the warm-up path already had). victory warm (warm.rs, two thirds of the cores) is unchanged.

This touches only translate.rs, so it does not overlap #326, which rejects --jobs 0 at parse time for #311. Once #326 is in, the .max(1) is only a guard.

Testing

Linux host: built for x86_64-pc-windows-gnu and run under Wine 10 (Ryzen 7 3700X, 16 logical cores). Not Windows. The only input was three empty DXBC containers made for the test; no game data anywhere, nothing was run in game.

  • victory unit tests: 23 passed, the new jobs_is_at_least_one_worker_and_every_core_by_default included.
  • Negative controls: with the old warm-up expression in the function the test fails (left: 4, right: 16); with the old translate/shaders expression it fails on --jobs 0 (left: 0, right: 1).
  • Real binary, victory translate --warm all on the folder holding them, without --jobs: ... 3 do not translate; 0.4 s on 4 threads at cd8dfc0, ... on 16 threads with this change.
  • cargo clippy --no-deps -p victory --all-targets --target x86_64-pc-windows-gnu -- -D warnings: clean.

AI-assisted.

**@⁠TinkerBell-90** on GitHub · 2026-11-26 20:33 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/332) `TinkerBell-90:translate-warm-every-core` → `a-publier` · +20 −5 · 1 files · 1 commits · merged 2026-11-26 22:30 UTC Fixes #292. `translate --warm` took 4 threads when `--jobs` was not given, while the flag's help says "every logical core" and the two other paths of `translate.rs` (`translate`, `shaders`) do that. The three paths now take their count from one function, `worker_threads`: every logical core by default, never fewer than one (the `.max(1)` the warm-up path already had). `victory warm` (`warm.rs`, two thirds of the cores) is unchanged. This touches only `translate.rs`, so it does not overlap #326, which rejects `--jobs 0` at parse time for #311. Once #326 is in, the `.max(1)` is only a guard. ## Testing Linux host: built for `x86_64-pc-windows-gnu` and run under Wine 10 (Ryzen 7 3700X, 16 logical cores). Not Windows. The only input was three empty DXBC containers made for the test; no game data anywhere, nothing was run in game. - `victory` unit tests: 23 passed, the new `jobs_is_at_least_one_worker_and_every_core_by_default` included. - Negative controls: with the old warm-up expression in the function the test fails (`left: 4, right: 16`); with the old `translate`/`shaders` expression it fails on `--jobs 0` (`left: 0, right: 1`). - Real binary, `victory translate --warm all` on the folder holding them, without `--jobs`: `... 3 do not translate; 0.4 s on 4 threads` at `cd8dfc0`, `... on 16 threads` with this change. - `cargo clippy --no-deps -p victory --all-targets --target x86_64-pc-windows-gnu -- -D warnings`: clean. AI-assisted.
translate --warm took 4 threads when --jobs was not given, while the
flag's help says every logical core and the two other paths of
translate.rs (translate, shaders) do that. The three paths now take
their count from one function, which keeps the at-least-one the warm-up
path already had.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:38:38 +00:00
github manually merged commit 038c507c4c into a-publier 2026-11-27 00:57:57 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.