An unreadable VICTORY_AMBIENT_SETTLE, VICTORY_MOUSE_SENS or VICTORY_DSTORAGE_STAGING_MB is silently the default (for the first, silently off) #514

Open
opened 2026-11-27 08:10:10 +00:00 by github-bot · 0 comments
Owner

@⁠itsonewi on GitHub · 2026-11-27 08:05 UTC · original

What happens

Three VICTORY_* switches read a number and take the default (or, for the first, the old behaviour) when the value cannot be read, without saying anything:

VICTORY_AMBIENT_SETTLE — documented as on by default:

| VICTORY_AMBIENT_SETTLE | How fast light settles after walking indoors (on by default, 250,3; 0 turns it off) |

README.md:72, and the switch's own note says the same (crates/victory-gpu/src/ambient.rs:115-124: "unset: 250,3; 0: 0.04 of the way a frame, as before").

        let set = std::env::var("VICTORY_AMBIENT_SETTLE").unwrap_or_else(|_| "250,3".to_owned());
        let mut parts = set.split(',').map(|p| p.trim().parse::<f32>().ok());
        let ms = parts.next().flatten().filter(|v| v.is_finite() && *v > 0.0)?;

crates/victory-gpu/src/ambient.rs:136-138

The ? is inside get_or_init's closure, so an unreadable first field (250ms, 250 ms, 25O, an empty value, a locale's 250,3 read as 250.3 — all of which a reader can type) returns None from settle() with no log, and follow() then answers _ => 0.04 (:153-156): the "as before" path. A typo is indistinguishable from VICTORY_AMBIENT_SETTLE=0, and the default-on feature the switch was set for is off.

VICTORY_MOUSE_SENS (VICTORY_KBM_GTA, new in #295):

    static SENS: LazyLock<f32> = LazyLock::new(|| {
        std::env::var("VICTORY_MOUSE_SENS")
            .ok()
            .and_then(|s| s.trim().parse::<f32>().ok())
            .filter(|v| v.is_finite() && *v > 0.0)
            .unwrap_or(1.0)
    });

crates/victory-hle/src/modules/gameinput.rs:150-157 — VICTORY_MOUSE_SENS=1,5 or =high is 1.0 (the documented default, README.md:74), silently.

VICTORY_DSTORAGE_STAGING_MB:

        std::env::var("VICTORY_DSTORAGE_STAGING_MB").ok().and_then(|v| v.trim().parse::<u64>().ok()).unwrap_or(0)

crates/victory-hle/src/modules/dstorage.rs:238 — =256 MB (the unit the name already carries, so easy to type) is 0, i.e. "what the title asks for", silently.

The siblings all say something: VICTORY_FRAME_INTERVAL_MS warns and keeps the title's interval (crates/victory-gpu/src/frame.rs:39-45), VICTORY_OUTPUT / VICTORY_RENDER_SCALE / VICTORY_FFX_SCALE / VICTORY_UPSCALER print what was expected (crates/victory-loader/src/resolution.rs:51, :63, :75, :87), VICTORY_WINDOW_MAX warns (crates/victory-hle/src/modules/lifecycle.rs:182-190), and an unparseable VICTORY_HOST_WAVE was made to report itself in #303 (issue #282).

Why it matters

These are the switches a user sets by hand from a README table, where the failure mode is invisible: the run starts, nothing is logged, and the number the switch was meant to change is the old one. For VICTORY_AMBIENT_SETTLE that means "light settles the old way" (the thing the switch exists to change), and the reader has no way to tell that from the documented way to turn it off. For VICTORY_MOUSE_SENS, a comma decimal is the usual way to write 1.5 in half of Europe, and it is silently 1.0.

The three parse sites are one line each, in code that already logs (ambient.rs logs the value it did settle on at :141-146, so it is only the failure path that is quiet).

Suggested fix

Say it once per site, as frame.rs does — a tracing::warn! naming the switch, the value and what was used instead — or add the helper the tree keeps re-growing:

/// A number from `name`, or `default` with a warning that says so.
fn number<T: std::str::FromStr + Copy + std::fmt::Display>(name: &str, default: T) -> T { … }

and use it at the three sites (ambient.rs:136, gameinput.rs:152, dstorage.rs:238) plus the neighbours that come next. For VICTORY_AMBIENT_SETTLE, an unreadable value should say "the stand-in's light settles the old way" so it cannot be mistaken for the deliberate 0.

AI use

Found by an AI agent (Freebuff) reading a-publier at 4eb6cfd through the GitHub API, looking for the pattern of issues #281/#282 (reported by the same agent) after they were fixed: switches whose failure path is quieter than their success path. Deduplicated against the open and closed issues. Source only: no Windows build and no GPU here, so nothing was compiled or run — every claim above is a file:line you can check as quoted. Filed by the same agent that filed #280–#293, #301, #302, #311, #510 and #513.

**@⁠itsonewi** on GitHub · 2026-11-27 08:05 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/514) ## What happens Three `VICTORY_*` switches read a number and take the *default* (or, for the first, the old behaviour) when the value cannot be read, without saying anything: **`VICTORY_AMBIENT_SETTLE`** — documented as on by default: > | `VICTORY_AMBIENT_SETTLE` | How fast light settles after walking indoors (on by default, `250,3`; `0` turns it off) | `README.md:72`, and the switch's own note says the same (`crates/victory-gpu/src/ambient.rs:115-124`: "unset: 250,3; 0: 0.04 of the way a frame, as before"). ```rust let set = std::env::var("VICTORY_AMBIENT_SETTLE").unwrap_or_else(|_| "250,3".to_owned()); let mut parts = set.split(',').map(|p| p.trim().parse::<f32>().ok()); let ms = parts.next().flatten().filter(|v| v.is_finite() && *v > 0.0)?; ``` `crates/victory-gpu/src/ambient.rs:136-138` The `?` is inside `get_or_init`'s closure, so an unreadable first field (`250ms`, `250 ms`, `25O`, an empty value, a locale's `250,3` read as `250.3` — all of which a reader can type) returns `None` from `settle()` with no log, and `follow()` then answers `_ => 0.04` (`:153-156`): the "as before" path. A typo is indistinguishable from `VICTORY_AMBIENT_SETTLE=0`, and the default-on feature the switch was set for is off. **`VICTORY_MOUSE_SENS`** (`VICTORY_KBM_GTA`, new in #295): ```rust static SENS: LazyLock<f32> = LazyLock::new(|| { std::env::var("VICTORY_MOUSE_SENS") .ok() .and_then(|s| s.trim().parse::<f32>().ok()) .filter(|v| v.is_finite() && *v > 0.0) .unwrap_or(1.0) }); ``` `crates/victory-hle/src/modules/gameinput.rs:150-157` — `VICTORY_MOUSE_SENS=1,5` or `=high` is 1.0 (the documented default, `README.md:74`), silently. **`VICTORY_DSTORAGE_STAGING_MB`**: ```rust std::env::var("VICTORY_DSTORAGE_STAGING_MB").ok().and_then(|v| v.trim().parse::<u64>().ok()).unwrap_or(0) ``` `crates/victory-hle/src/modules/dstorage.rs:238` — `=256 MB` (the unit the name already carries, so easy to type) is 0, i.e. "what the title asks for", silently. The siblings all say something: `VICTORY_FRAME_INTERVAL_MS` warns and keeps the title's interval (`crates/victory-gpu/src/frame.rs:39-45`), `VICTORY_OUTPUT` / `VICTORY_RENDER_SCALE` / `VICTORY_FFX_SCALE` / `VICTORY_UPSCALER` print what was expected (`crates/victory-loader/src/resolution.rs:51`, `:63`, `:75`, `:87`), `VICTORY_WINDOW_MAX` warns (`crates/victory-hle/src/modules/lifecycle.rs:182-190`), and an unparseable `VICTORY_HOST_WAVE` was made to report itself in #303 (issue #282). ## Why it matters These are the switches a user sets by hand from a README table, where the failure mode is invisible: the run starts, nothing is logged, and the number the switch was meant to change is the old one. For `VICTORY_AMBIENT_SETTLE` that means "light settles the old way" (the thing the switch exists to change), and the reader has no way to tell that from the documented way to turn it off. For `VICTORY_MOUSE_SENS`, a comma decimal is the usual way to write 1.5 in half of Europe, and it is silently 1.0. The three parse sites are one line each, in code that already logs (`ambient.rs` logs the value it did settle on at `:141-146`, so it is only the failure path that is quiet). ## Suggested fix Say it once per site, as `frame.rs` does — a `tracing::warn!` naming the switch, the value and what was used instead — or add the helper the tree keeps re-growing: ```rust /// A number from `name`, or `default` with a warning that says so. fn number<T: std::str::FromStr + Copy + std::fmt::Display>(name: &str, default: T) -> T { … } ``` and use it at the three sites (`ambient.rs:136`, `gameinput.rs:152`, `dstorage.rs:238`) plus the neighbours that come next. For `VICTORY_AMBIENT_SETTLE`, an unreadable value should say "the stand-in's light settles the old way" so it cannot be mistaken for the deliberate `0`. ## AI use Found by an AI agent (Freebuff) reading `a-publier` at `4eb6cfd` through the GitHub API, looking for the pattern of issues #281/#282 (reported by the same agent) after they were fixed: switches whose failure path is quieter than their success path. Deduplicated against the open and closed issues. Source only: no Windows build and no GPU here, so nothing was compiled or run — every claim above is a `file:line` you can check as quoted. Filed by the same agent that filed #280–#293, #301, #302, #311, #510 and #513.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 08:10:11 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.