Report malformed host-wave overrides during translation #303

Manually merged
github merged 1 commit from github-bot/gh-303 into a-publier 2026-11-27 00:57:58 +00:00 AGit
Owner

@⁠loyodea on GitHub · 2026-11-26 19:33 UTC · original
loyodea:victory-translate-wave-config → a-publier · +96 −21 · 3 files · 1 commits · merged 2026-11-26 22:30 UTC

Fixes #282.

Resolve VICTORY_HOST_WAVE and VICTORY_HOST_MAX_WAVE before dispatching either translate mode. Trim surrounding whitespace and report each configured value that cannot be parsed, including values that cannot be decoded as Unicode. A valid primary value takes precedence over the alias. Explicit 0 still selects an unknown host width.

Validation

  • On Windows, cargo test --locked -p victory passed all 27 tests.
  • The CLI regression covers malformed values in ordinary translation and --warm all, including an unpaired UTF-16 surrogate. It uses empty synthetic inputs and an isolated cache. A separate CLI smoke check verified that a padded explicit zero takes precedence over the alias in both modes.

Codex contributed the implementation, independent review, and verification.

**@⁠loyodea** on GitHub · 2026-11-26 19:33 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/303) `loyodea:victory-translate-wave-config` → `a-publier` · +96 −21 · 3 files · 1 commits · merged 2026-11-26 22:30 UTC Fixes #282. Resolve `VICTORY_HOST_WAVE` and `VICTORY_HOST_MAX_WAVE` before dispatching either `translate` mode. Trim surrounding whitespace and report each configured value that cannot be parsed, including values that cannot be decoded as Unicode. A valid primary value takes precedence over the alias. Explicit `0` still selects an unknown host width. **Validation** - On Windows, `cargo test --locked -p victory` passed all 27 tests. - The CLI regression covers malformed values in ordinary translation and `--warm all`, including an unpaired UTF-16 surrogate. It uses empty synthetic inputs and an isolated cache. A separate CLI smoke check verified that a padded explicit zero takes precedence over the alias in both modes. Codex contributed the implementation, independent review, and verification.
Trim whitespace and report invalid values when resolving the host-wave override and its alias before either translate mode. Related to #282.

Co-authored-by: Codex <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:49:12 +00:00
github manually merged commit 26d4073bb3 into a-publier 2026-11-27 00:57:58 +00:00
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 21:44 UTC · original

Tested 7e19aa5 against a-publier cd8dfc0 on Windows 11 with an RX 7900 XT, using release builds of both.

Malformed values. I ran victory translate on an empty dir with an isolated cache. Base ran plain only; the PR ran plain and with --warm all:

  • "", abc, 32-64, 64 lanes, wave64, -1, 4294967296: base prints nothing. The PR prints one ignoring VICTORY_HOST_WAVE=... line and exits 0, the same as when the variable is unset. Both PR modes behave the same.
  • With VICTORY_HOST_WAVE=" 32 " and VICTORY_HOST_MAX_WAVE=64, base prints the alias line and uses 64. The PR uses 32 and prints the "over" line.

Valid values. I ran a whole-archive translate --validate --list of shaders.rpf and compared emitted hashes per program (25694 emitted programs):

  • VICTORY_HOST_WAVE=32: identical to base. The same holds for =64.
  • " 32 ": base matches unset, so 364 CS hashes differ from =32. The PR matches =32 exactly. This is the only output change I found, and it is the intended one.
  • Validation counts are the same on all six runs.

Two things to know:

  • 16 and 128 are valid integers, so they are accepted without a message on both sides. From reading the code, emission only special-cases 32, so any other non-zero value (for example a typo like 6 or 640) translates like 64. The value still goes into the translation fingerprint, so it gets its own cache entries. I did not run a translate with these values.
  • An empty value (for example VICTORY_HOST_WAVE= victory translate ... in a POSIX shell) now prints a warning. Base was silent. The result is still "unset", so this is only a visible change.

Tests:

  • I ran cargo test --locked -p victory 3 times each for PR and base, interleaved. Everything passed on both sides.
  • I adapted the three host-wave tests to base's &str signature. All three fail on base.
  • clippy and rustfmt: nothing new.

Not tested: a game run, --pipelines, and non-UTF-8 values on Linux.

**@⁠adrianmjim** on GitHub · 2026-11-26 21:44 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/303#issuecomment-7204014916) Tested 7e19aa5 against a-publier cd8dfc0 on Windows 11 with an RX 7900 XT, using release builds of both. Malformed values. I ran `victory translate` on an empty dir with an isolated cache. Base ran plain only; the PR ran plain and with `--warm all`: - `""`, `abc`, `32-64`, `64 lanes`, `wave64`, `-1`, `4294967296`: base prints nothing. The PR prints one `ignoring VICTORY_HOST_WAVE=...` line and exits 0, the same as when the variable is unset. Both PR modes behave the same. - With `VICTORY_HOST_WAVE=" 32 "` and `VICTORY_HOST_MAX_WAVE=64`, base prints the alias line and uses 64. The PR uses 32 and prints the "over" line. Valid values. I ran a whole-archive `translate --validate --list` of shaders.rpf and compared emitted hashes per program (25694 emitted programs): - `VICTORY_HOST_WAVE=32`: identical to base. The same holds for `=64`. - `" 32 "`: base matches unset, so 364 CS hashes differ from `=32`. The PR matches `=32` exactly. This is the only output change I found, and it is the intended one. - Validation counts are the same on all six runs. Two things to know: - `16` and `128` are valid integers, so they are accepted without a message on both sides. From reading the code, emission only special-cases 32, so any other non-zero value (for example a typo like `6` or `640`) translates like 64. The value still goes into the translation fingerprint, so it gets its own cache entries. I did not run a translate with these values. - An empty value (for example `VICTORY_HOST_WAVE= victory translate ...` in a POSIX shell) now prints a warning. Base was silent. The result is still "unset", so this is only a visible change. Tests: - I ran `cargo test --locked -p victory` 3 times each for PR and base, interleaved. Everything passed on both sides. - I adapted the three host-wave tests to base's `&str` signature. All three fail on base. - clippy and rustfmt: nothing new. Not tested: a game run, `--pipelines`, and non-UTF-8 values on Linux.
This discussion has been locked. Commenting is limited to contributors.
No description provided.