translate: an unparsable VICTORY_HOST_WAVE is dropped without a word #282

Closed
opened 2026-11-26 18:52:44 +00:00 by github-bot · 0 comments
Owner

@⁠itsonewi on GitHub · 2026-11-26 18:51 UTC · original

What happens

apps/victory/src/translate/host_wave.rs:7:

let wave = wave.and_then(|value| value.parse::<u32>().ok());

The CLI help (apps/victory/src/main.rs:78-83) says "VICTORY_HOST_WAVE overrides the host wave width, including with --warm … Zero means unknown width", and the module does warn when the two spellings disagree (:9-21). But a value that does not parse — VICTORY_HOST_WAVE=64 with the trailing space of a copied line, =64 lanes, =wave64 — becomes None silently. If the alias is not set, translation and --warm then run with the width the code would have detected, and no message is printed at all.

Why it matters

The shader cache and the warm-up are keyed on the host width. A value that was meant to be set but is dropped translates (and caches) shaders for a different host than the user asked for, with the switch looking applied.

Suggested fix

trim() before parsing, and report through the existing warn callback when a value was given but is not a number, so a typo cannot pass as "unset".

AI use

Found by reading apps/victory/src/translate/host_wave.rs, apps/victory/src/main.rs and the call site in main.rs. No code was built or run.

**@⁠itsonewi** on GitHub · 2026-11-26 18:51 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/282) ## What happens `apps/victory/src/translate/host_wave.rs:7`: ```rust let wave = wave.and_then(|value| value.parse::<u32>().ok()); ``` The CLI help (`apps/victory/src/main.rs:78-83`) says "VICTORY_HOST_WAVE overrides the host wave width, including with --warm … Zero means unknown width", and the module does warn when the two spellings disagree (`:9-21`). But a value that does not parse — `VICTORY_HOST_WAVE=64 ` with the trailing space of a copied line, `=64 lanes`, `=wave64` — becomes `None` silently. If the alias is not set, translation and `--warm` then run with the width the code would have detected, and no message is printed at all. ## Why it matters The shader cache and the warm-up are keyed on the host width. A value that was meant to be set but is dropped translates (and caches) shaders for a different host than the user asked for, with the switch looking applied. ## Suggested fix `trim()` before parsing, and report through the existing `warn` callback when a value was given but is not a number, so a typo cannot pass as "unset". ## AI use Found by reading `apps/victory/src/translate/host_wave.rs`, `apps/victory/src/main.rs` and the call site in `main.rs`. No code was built or run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:52:44 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.