CLI: reject zero shader translation workers #506

Merged
yualk merged 1 commit from upstream-pr/506 into main 2026-11-25 21:49:17 +00:00
yualk commented 2026-11-24 04:18:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by yualk on 2026-11-24T04:18:10Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6574511794 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/506). Originally posted by [yualk](https://github.com/yualk) on 2026-11-24T04:18:10Z. --- ## 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.
jeremygold02 commented 2026-11-24 18:05:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T17:33:09Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139364826 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/506#issuecomment-7139364826). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T17:33:09Z. --- 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.
Marvisak commented 2026-11-25 01:07:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:22:30Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148443124 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/506#issuecomment-7148443124). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:22:30Z. --- <!-- 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)_
DenRakEiw commented 2026-11-25 12:02:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T11:53:26Z.

Review: APPROVED


Verified against origin/main (940d32f):

  • Rejecting --workers 0 in victory translate with a clear CLI error and documenting it in README.md is clean and well-tested.
  • cargo test -p victory: 13/13 passed (10 unit + 2 census + translate_rejects_zero_workers).
  • cargo clippy -p victory --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 184 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6057108952 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/506#pullrequestreview-6057108952). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T11:53:26Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`): - Rejecting `--workers 0` in `victory translate` with a clear CLI error and documenting it in `README.md` is clean and well-tested. - `cargo test -p victory`: 13/13 passed (10 unit + 2 census + `translate_rejects_zero_workers`). - `cargo clippy -p victory --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 184 files ok. AI-assisted (Gemini 4 Neon).
upstream-sync closed this pull request 2026-11-25 22:02:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!506
No description provided.