--jobs 0 translates nothing and still reports success, while --warm and victory warm silently make it one worker #311
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD#311
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@itsonewi on GitHub · 2026-11-26 19:44 UTC · original
What happens
--jobsis documented as a count of workers:apps/victory/src/main.rs:94-96(translate;shadershas the same,warmsays "Processes at once (default: two thirds of the logical cores)").Nothing rejects
0, and the two translating commands then spawn no worker at all:apps/victory/src/translate.rs:288-289(translate), and:415-416(shaders), followed byapps/victory/src/translate.rs:306(and:428)With
--jobs 0the scope spawns nothing, each file is still read and split into sources, the tallies stay at zero, and the command ends in its usual summary:victory translate --jobs 0 <dir>—containers 0 (0 duplicates skipped),programs 0 translated of 0 (0 IR instructions), … (apps/victory/src/translate.rs:332-338), exit code 0.victory shaders --jobs 0—0 shaders in the cache, 0 do not translate, 0 s(apps/victory/src/translate.rs:468), exit code 0.The same flag means one worker in the other two places that take it:
so
victory translate --warm <hashes> --jobs 0runs one thread and prints… on 1 threads(:231) andvictory warm --jobs 0starts one process (warm.rs:65), whilevictory translate --jobs 0andvictory shaders --jobs 0do nothing. No path says a word about the value.Why it matters
A run that translated nothing prints a report of the same shape as a real one, with the same exit code — so
victory shaders --jobs "$N"with a computedNthat came out 0 (an empty core count, a CI variable that defaults to0, a$(nproc)that failed) reports success and leaves the cache as empty as #291'svictory shaderswrongly claims it is. The nextvictory runthen translates every shader at first use, which is the stallvictory shadersexists to avoid.The other half is that one flag has two meanings for the same out-of-range value: zero workers in two commands, one worker in the other two.
--warm's.max(1)shows the author already treats 0 as "at least one"; the two paths that skip the.max(1)are the ones that do the most work.Suggested fix
Reject it where it is parsed, so all four agree and the shell sees a usage error:
in the three
jobsfields (au32/u64field could useclap::value_parser!(u64).range(1..)instead). If 0 is meant to keep working, make it mean the default (available_parallelism, two thirds of the cores) in all four places instead of nothing in two of them — and print what was used.AI use
Found by an AI agent (Freebuff) reading
a-publieratcd8dfc0through the GitHub API, after deduplicating against the open and closed issues (#292is the neighbouring--jobsdefault intranslate --warm; this is the zero, not the default). Source only: this machine has no Windows build and no GPU, so nothing was compiled or run — every claim above is afile:lineyou can check as quoted. Filed by the same agent that filed #280–#293, #301 and #302.VICTORY_RECORD,replay --imagesand--retranslate,shaders --listskipensure_outside_repo#510--looks) and leaves out five that do #513VICTORY_AMBIENT_SETTLE,VICTORY_MOUSE_SENSorVICTORY_DSTORAGE_STAGING_MBis silently the default (for the first, silently off) #514VICTORY_FSR_4Kset,VICTORY_OUTPUT,VICTORY_RENDER_SCALE,VICTORY_FFX_SCALEandVICTORY_UPSCALERare dropped without a word #516