translate --warm starts four worker threads by default, though --jobs says every logical core #292

Closed
opened 2026-11-26 19:22:35 +00:00 by github-bot · 0 comments
Owner

@⁠itsonewi on GitHub · 2026-11-26 19:16 UTC · original

What happens

--jobs of victory translate is documented as "Worker threads (default: every logical core)" (apps/victory/src/main.rs:94), and the ordinary path keeps that promise: apps/victory/src/translate.rs:289 uses

jobs.unwrap_or_else(|| std::thread::available_parallelism().map_or(4, |n| n.get()))

(the same as victory shaders, :416). The --warm path in the same command does not:

// apps/victory/src/translate.rs:182
let threads = jobs.unwrap_or(4).max(1);

So victory translate --warm hashes.txt with no --jobs translates on 4 threads whatever the machine has, and the summary says so: "… {:.1} s on {threads} threads" (:231). On a 16-core machine that is a quarter of the cores the same flag gives victory translate and victory shaders; on a 32-thread one, an eighth. The dedicated victory warm command does scale with the machine (apps/victory/src/warm.rs:62-63, two thirds of the cores), which makes the 4 in the --warm path look like a leftover rather than a choice.

Why it matters

A warm-up is the long, once-per-translator-version job the command exists for (the Shaders help calls it "a few minutes, once per version of the translator"). Four threads where the help promises every core makes it several times longer than it needs to be, and the only visible sign is the "on 4 threads" at the end of a run that already finished.

Suggested fix

Use the same default as the other two paths (jobs.unwrap_or_else(|| available_parallelism().map_or(4, |n| n.get()))), or point the --jobs help at the --warm default if 4 is meant there.

AI use

Found by reading apps/victory/src/main.rs and apps/victory/src/translate.rs (and apps/victory/src/warm.rs for the other default). Nothing was built or run.

**@⁠itsonewi** on GitHub · 2026-11-26 19:16 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/292) ## What happens `--jobs` of `victory translate` is documented as "Worker threads (default: every logical core)" (`apps/victory/src/main.rs:94`), and the ordinary path keeps that promise: `apps/victory/src/translate.rs:289` uses ```rust jobs.unwrap_or_else(|| std::thread::available_parallelism().map_or(4, |n| n.get())) ``` (the same as `victory shaders`, `:416`). The `--warm` path in the same command does not: ```rust // apps/victory/src/translate.rs:182 let threads = jobs.unwrap_or(4).max(1); ``` So `victory translate --warm hashes.txt` with no `--jobs` translates on 4 threads whatever the machine has, and the summary says so: "… {:.1} s on {threads} threads" (`:231`). On a 16-core machine that is a quarter of the cores the same flag gives `victory translate` and `victory shaders`; on a 32-thread one, an eighth. The dedicated `victory warm` command does scale with the machine (`apps/victory/src/warm.rs:62-63`, two thirds of the cores), which makes the 4 in the `--warm` path look like a leftover rather than a choice. ## Why it matters A warm-up is the long, once-per-translator-version job the command exists for (the `Shaders` help calls it "a few minutes, once per version of the translator"). Four threads where the help promises every core makes it several times longer than it needs to be, and the only visible sign is the "on 4 threads" at the end of a run that already finished. ## Suggested fix Use the same default as the other two paths (`jobs.unwrap_or_else(|| available_parallelism().map_or(4, |n| n.get()))`), or point the `--jobs` help at the `--warm` default if 4 is meant there. ## AI use Found by reading `apps/victory/src/main.rs` and `apps/victory/src/translate.rs` (and `apps/victory/src/warm.rs` for the other default). Nothing was built or run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:22:35 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.