CLI: reject zero shader translation workers #506

Manually merged
github merged 1 commit from gh-pr/506/head into gh-pr/506/base 2026-11-26 04:06:31 +00:00
Owner

@⁠yualk on GitHub · 2026-11-24 04:18 UTC · original
yualk:fix/translate-positive-workers → main · +34 −4 · 3 files · 1 commits · merged 2026-11-25 21:49 UTC

Problem

victory translate --jobs 0 silently skips all shader translation and reports a successful empty scan. Use a positive worker count at the CLI boundary; leaving --jobs out still auto-selects the count.

Verification

  • CLI regression: exit 0 before the change; exit 2 with an argument diagnostic afterward.
  • Read-only check on the Xbox Series 1.0.2.1 executable: --jobs 1 and the default each found 15 containers and translated 12 of 12 programs.
  • Windows workspace tests: 265 passed, 4 ignored. Asset policy and scoped formatting passed. No game content is included.

AI assistance: Codex identified the bug, wrote the change and regression, and ran the checks.

**@⁠yualk** on GitHub · 2026-11-24 04:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/506) `yualk:fix/translate-positive-workers` → `main` · +34 −4 · 3 files · 1 commits · merged 2026-11-25 21:49 UTC ## Problem `victory translate --jobs 0` silently skips all shader translation and reports a successful empty scan. Use a positive worker count at the CLI boundary; leaving `--jobs` out still auto-selects the count. ## Verification - CLI regression: exit 0 before the change; exit 2 with an argument diagnostic afterward. - Read-only check on the Xbox Series 1.0.2.1 executable: `--jobs 1` and the default each found 15 containers and translated 12 of 12 programs. - Windows workspace tests: 265 passed, 4 ignored. Asset policy and scoped formatting passed. No game content is included. AI assistance: Codex identified the bug, wrote the change and regression, and ran the checks.
- Reject --jobs 0 in both translation modes before starting workers.
- Cover the CLI exit and diagnostic without including title files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:06:30 +00:00
github manually merged commit df7b754880 into gh-pr/506/base 2026-11-26 04:06:31 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 17:33 UTC · original

Verification ran against PR head e80778cffa944cecfdc0775c10b466d6887edd95; the PR was open at refresh.

  • Command: cargo test -p victory --test translate translate_rejects_zero_workers
  • Result: 1 passed. translate_rejects_zero_workers invokes the built CLI with --jobs 0 and checks for exit code 2 plus a --jobs diagnostic. The test exercises argument validation before shader translation starts.

This verification was AI-assisted.

**@⁠jeremygold02** on GitHub · 2026-11-24 17:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/506#issuecomment-7139364826) Verification ran against PR head `e80778cffa944cecfdc0775c10b466d6887edd95`; the PR was open at refresh. - Command: `cargo test -p victory --test translate translate_rejects_zero_workers` - Result: 1 passed. `translate_rejects_zero_workers` invokes the built CLI with `--jobs 0` and checks for exit code 2 plus a `--jobs` diagnostic. The test exercises argument validation before shader translation starts. This verification was AI-assisted.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:22 UTC · original · edited 2026-11-25 01:22 UTC

Automated triage for the maintainers.

Merge candidate. Rebased, so this is now reviewed in full. The bug is real. In apps/victory/src/translate.rs, both run and warm start threads.min(jobs.len()) workers. With --jobs 0 that is no workers, so nothing gets translated and the command still exits 0. The PR changes jobs in apps/victory/src/main.rs to Option<NonZeroUsize>, so clap rejects 0 with exit code 2. Leaving --jobs out still picks the worker count automatically. The new apps/victory/tests/translate.rs covers both translate and translate --cache. It runs the built binary the same way tests/census.rs already does.

Minor: the README line repeats what the --jobs help text now says, so it could go.

CI: not run on this head.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/506#issuecomment-7148443124) · edited 2026-11-25 01:22 UTC <!-- victory-triage v1 head=df7b7548809c86f6825352f02d9ec67d34b633a0 verdict=merge-candidate at=2026-11-25T01:22:20Z --> Automated triage for the maintainers. **Merge candidate.** Rebased, so this is now reviewed in full. The bug is real. In `apps/victory/src/translate.rs`, both `run` and `warm` start `threads.min(jobs.len())` workers. With `--jobs 0` that is no workers, so nothing gets translated and the command still exits 0. The PR changes `jobs` in `apps/victory/src/main.rs` to `Option<NonZeroUsize>`, so clap rejects 0 with exit code 2. Leaving `--jobs` out still picks the worker count automatically. The new `apps/victory/tests/translate.rs` covers both `translate` and `translate --cache`. It runs the built binary the same way `tests/census.rs` already does. Minor: the README line repeats what the `--jobs` help text now says, so it could go. CI: not run on this head. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/Marvisak--VIctory!506
No description provided.