CLI: translate --jobs 0 accepts the input and reports zero containers #249

Open
opened 2026-11-26 03:39:11 +00:00 by github-bot · 0 comments
Owner

@⁠Bennet0k on GitHub · 2026-11-24 23:00 UTC · original

Source · Source

The argument type accepts zero and the code uses it directly as the worker count. For victory translate --jobs 0 <file-with-a-shader>, the per-file worker range is empty even when shader sources were found, so the command reaches the summary with zero work instead of reporting invalid input. Verified from the argument and worker code. The Windows CLI was not run for this check.

Proposed fix. Parse the option as NonZeroUsize or reject zero before scanning. Test that zero exits with an argument error and one processes a synthetic shader fixture.

Found in an AI-assisted audit of 2119b0e.

**@⁠Bennet0k** on GitHub · 2026-11-24 23:00 UTC · [original](https://github.com/fxceless/victory-fork/issues/249) [Source](https://github.com/fxceless/victory-fork/blob/2119b0e44c53aa9648307b0c5c73590290305b1f/apps/victory/src/main.rs#L80-L86) · [Source](https://github.com/fxceless/victory-fork/blob/2119b0e44c53aa9648307b0c5c73590290305b1f/apps/victory/src/translate.rs#L187-L223) The argument type accepts zero and the code uses it directly as the worker count. For `victory translate --jobs 0 <file-with-a-shader>`, the per-file worker range is empty even when shader sources were found, so the command reaches the summary with zero work instead of reporting invalid input. Verified from the argument and worker code. The Windows CLI was not run for this check. **Proposed fix.** Parse the option as `NonZeroUsize` or reject zero before scanning. Test that zero exits with an argument error and one processes a synthetic shader fixture. Found in an AI-assisted audit of `2119b0e`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:11 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
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
github/fxceless--victory-fork#249
No description provided.