victory-hle: stop on unparseable switches and single-read env toggles #202

Manually merged
github merged 2 commits from github-bot/gh-202 into gh-pr/202/base 2026-12-02 18:32:56 +00:00 AGit
Owner

@⁠waldirjunior on GitHub · 2026-12-02 10:09 UTC · original
waldirjunior:fix/victory-hle-toggle-parsing → main · +791 −152 · 15 files · 2 commits · merged 2026-12-02 17:36 UTC

What

Addresses part of docs/TASKS.md item "victory-hle's switches in the toggle inventory" (Related to #65).

Under docs/AGENTS.md rule 2, every environment switch must be read in one place with one default, and a set value that fails to parse must stop the start instead of silently falling back to the default. This PR validates all parsed victory-hle switches eagerly at startup before the title is loaded, before vkback-unix / unixgate is opened, and before DirectStorage worker threads are spawned (following the Result<_, String> startup check pattern from PR #34), consolidates duplicated path reads behind OnceLock helpers, and cleans up the victory-hle policy inventory.

Changes

  • Eager startup validation (crates/victory-hle/src/env.rs, apps/victory/src/run.rs):
    • Added victory_hle::env::Switch<T> (holding name, default, parser, and OnceLock<T> in one place), parse_var, parse_trace_level, parse_auto_or_range, and pub fn validate_switches() -> Result<(), String>.
    • Wired victory_hle::env::validate_switches().map_err(anyhow::Error::msg)?; at the start of apps/victory/src/run.rs (before CPU checks, title loading, vkback-unix, or worker threads) so invalid or non-UTF-8 values stop the start cleanly with exit code 1 instead of panicking lazily in worker threads or across extern "system" FFI boundaries.
  • Whole class of parsed victory-hle switches covered (11 switches):
    • VICTORY_DSP_GAIN (crates/victory-hle/src/modules/dsp.rs): finite positive f32 (v.is_finite() && v > 0.0, default 1.0).
    • VICTORY_DSTORAGE_IO (crates/victory-hle/src/modules/dstorage.rs): one, handles, overlapped, or direct (default handles).
    • VICTORY_WALLS_TRACE (crates/victory-hle/src/modules/dstorage.rs): 0..=2 (default 0).
    • VICTORY_DSTORAGE_TRACE (crates/victory-hle/src/modules/dstorage.rs): 0..=2 (default 0).
    • VICTORY_DSTORAGE_RETRIES (crates/victory-hle/src/modules/dstorage.rs): u32 (default 12, accepts 0, rejects negative/non-numeric).
    • VICTORY_MAP_THREADS (crates/victory-hle/src/modules/xmem.rs, xmem/pool.rs): auto or 1..=32 (default 8; removes silent .clamp(1, 32)).
    • VICTORY_IMAGE_WATCH (crates/victory-hle/src/image_watch.rs): comma-separated name=hex[:1|2|4|8] entries (rejects empty/malformed entries instead of silently discarding them).
    • VICTORY_KEYS (crates/victory-hle/src/modules/gameinput.rs, diagnostics feature): comma-separated <seconds>:<key> or <from>-<to>:<key> entries (rejects empty entries, invalid times, to < from, and unknown keys).
    • VICTORY_PROCESS_PRIORITY (crates/victory-hle/src/runtime.rs): normal/0 or above_normal/1 (default above normal).
    • VICTORY_HOST_PADS (crates/victory-hle/src/modules/gameinput.rs): on or off (default on).
    • VICTORY_UMEM_SO (crates/victory-hle/src/modules/umem.rs): non-empty valid UTF-8 path (default /tmp/libumem_unix.so; rejects non-UTF-8 and blank values instead of silently falling back).
  • Remaining victory-hle environment variables (rule 22 scope accounting):
    • 13 boolean/flag switches (VICTORY_DSTORAGE_HALF, VICTORY_EFFICIENCY_MODE, VICTORY_UMEM_CPU_PROBE, VICTORY_PORT_CONSTANTS, VICTORY_INPLACE_COMMIT, VICTORY_TITLE_PRIORITIES, VICTORY_DSP_CONVOLVE, VICTORY_ONE_PAD, VICTORY_SECTION_WINDOW, VICTORY_STREAM_NOTICE, VICTORY_MAP_LEAN, VICTORY_STREAM_PRIORITY, VKB_STRICT): intentionally kept as 0/1 flags consistent with greenfield/umem/src/switches.rs (Kind::Flag accepts t != "0", tested by switches::tests::set_and_parse) and greenfield/umem/src/loud.rs (which shares VKB_STRICT). The five ab switches among them are also slated for removal in docs/TASKS.md.
    • 4 raw OS path switches (VICTORY_DSTORAGE_LOG, VICTORY_AUDIO_CAPTURE, VICTORY_KEYS_FILE, VICTORY_XMA_DUMP): read via var_os with no text parsing. VICTORY_DSTORAGE_LOG (dstorage/stream_log.rs) and VICTORY_AUDIO_CAPTURE (audio/capture.rs) are consolidated into single OnceLock-cached helpers (path(), output_path()).
    • 2 internal IPC (external) variables (VICTORY_AUDIO_CAPTURE_OF, VICTORY_RELAUNCHED_FROM): set internally by our own child-process spawns.
  • Rule 2 comments and policy tables:
    • Added owner and removal conditions at every touched switch definition.
    • Updated greenfield/tools/policy/toggles.txt: removed stale pre-#79 comment and aligned inaccurate kinds/notes (VICTORY_DSTORAGE_IO tune -> ab, VICTORY_EFFICIENCY_MODE mode -> option, VICTORY_PROCESS_PRIORITY tune -> option, VICTORY_STREAM_PRIORITY tune -> debug, VICTORY_UMEM_SO gpu -> path, plus updated notes).
    • Lowered greenfield/tools/policy/oversize.txt counts where files shrank: crates/victory-hle/src/modules/xmem.rs (2521 -> 2519) and crates/victory-hle/src/modules/dstorage.rs (1820 -> 1817).
  • Unit tests: every parser (parse_var, parse_gain, Io::parse, parse_walls_trace, parse_dstorage_trace, parse_retries, parse_map_threads, parse_words, host::parse_keys, parse_process_priority, parse_host_pads, parse_so_path) and validate_switches / validate_switches_with are tested directly against production definitions (Switch::parse_raw).

This intentionally keeps #65 and the docs/TASKS.md item open: removing the answered ab switches and adding owner/removal comments to the untouched switches remain separate follow-up work.

The reference

No console, vkd3d-proton, or D3D12-path counterpart (rule 12): this enforces our own rule 2 environment-switch policy in victory-hle and keeps the repository's policy tables accurate.

Evidence

Unit tests, end-to-end startup rejection under Proton Wine, policy checks, full tools/build.sh builds, and all workspace clippy checks are sufficient here (rule 27): default behaviour when switches are unset or valid is unchanged, and every parsed switch and validate_switches is exercised directly by unit tests. No Vulkan calls or SPIR-V output are touched, so no Vulkan validation run is needed (rule 30).

Verified on Linux x86_64 (rustc 1.98.1, cargo-xwin 0.24.1, Proton Experimental Wine):

  • Full tools/build.sh builds (4/4 pass):
    • cargo xwin build --profile diag -p victory --target x86_64-pc-windows-msvc --features diagnostics -j 6 — passed.
    • (cd greenfield/wine && cargo build --release -p vkback-unix -j 6) — passed.
    • (cd greenfield/vkback && cargo build --release --bin vk-store -j 6) — passed.
    • (cd greenfield/vkback/translate && cargo build --release --bins -j 6) — passed.
  • All CI clippy jobs (-D warnings, 5/5 + default-features PE check pass):
    • cargo xwin clippy --workspace --all-targets --all-features --target x86_64-pc-windows-msvc --locked -- -D warnings — 0 warnings.
    • cargo xwin clippy -p victory-hle -p victory --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings (without diagnostics) — 0 warnings.
    • cargo clippy -p victory-shader -p victory-formats -p victory-core -p xtask --all-targets --locked -- -D warnings — 0 warnings.
    • (cd greenfield && cargo clippy --workspace --all-targets --locked -- -D warnings) — 0 warnings.
    • (cd greenfield/wine && cargo clippy --workspace --all-targets --locked -- -D warnings) — 0 warnings.
    • (cd greenfield/vkback/translate && cargo clippy --workspace --all-targets --locked -- -D warnings) — 0 warnings.
  • Native and policy tests (all pass):
    • cargo test -p victory-shader -p victory-formats -p victory-core -p xtask --locked — passed (victory-core: 13, victory-formats: 49 passed / 5 ignored, victory-shader: 240 passed / 2 ignored, xtask: 6 including repository_passes_policy and lint_tables_match).
    • (cd greenfield && cargo test -p umem -p frame -p vkback --lib --locked) — passed (umem: 13, frame: 22, vkback: 168 passed / 3 ignored).
    • (cd greenfield && cargo test -p vkback --test policy --locked -- --nocapture) — 6/6 passed (xmem.rs 2519/2519, dstorage.rs 1817/1817, gameinput.rs 1485/1500, toggles_registered clean).
    • cargo xtask policy — passed (asset policy: 532 files ok).
  • Windows victory-hle unit tests and E2E startup check under Proton Experimental Wine:
    • Compiled with cargo xwin test -p victory-hle --features diagnostics --target x86_64-pc-windows-msvc --no-run -j 6.
    • Unfiltered full suite (victory_hle.exe): 187 passed, 0 failed, 2 ignored (benchmarks read_bench and map_bench).
    • Filtered switch-test run (env::tests dsp_gain dstorage_io dstorage_trace dstorage_retries map_threads words_are_read process_priority umem_so_path only_an_explicit_switch victory_keys): 19 passed, 0 failed, 170 filtered out (including the Windows-only non-UTF-8 OsString tests for parse_var and VICTORY_UMEM_SO).
    • End-to-end startup check (VICTORY_WALLS_TRACE=bogus VICTORY_DSP_GAIN=-1 VICTORY_DSTORAGE_RETRIES=many victory.exe run nonexistent.exe): exited immediately with code 1, printing all three switch errors before attempting to open the executable or start vkback-unix.

Checklist (docs/AGENTS.md)

  • One topic (rule 31); docs/TASKS.md not edited, the fixed item named above (rule 29)
  • "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen (it drops the maintainers' commits)
  • No fallback or second path for a case that can't happen, in title data or in our own setup (rule 33); unexpected input fails loudly (rule 9)
  • Constants come from the console, the hardware or the title's data, not tuned by eye or ear (rule 9b) — no new constants introduced; VICTORY_DSP_GAIN retains its textbook 1.0 default while rejecting non-positive/non-finite values at startup
  • Every touched switch is listed, read in one place with owner/removal comments, and every parsed victory-hle switch stops the start on a bad value (rule 2; remaining untouched switches tracked in #65)
  • Queues and other externally synchronized Vulkan objects are used under their lock (rule 35) — no Vulkan objects touched
  • Every unsafe block has a // SAFETY: comment; no raw pointer around the borrow checker (rule 36) — no unsafe added or changed
  • Clippy clean; tests call the production code; TRANSLATOR_VERSION bumped if the translator's output changes (rule 27) — translator untouched
  • Comments say what is true now and name functions, not line numbers (rule 3)
  • Nothing from the title, and no pointers to where non-free data can be found (hard constraints)
**@⁠waldirjunior** on GitHub · 2026-12-02 10:09 UTC · [original](https://github.com/vktory6/VKtory/pull/202) `waldirjunior:fix/victory-hle-toggle-parsing` → `main` · +791 −152 · 15 files · 2 commits · merged 2026-12-02 17:36 UTC ## What Addresses part of `docs/TASKS.md` item **"victory-hle's switches in the toggle inventory"** (Related to #65). Under `docs/AGENTS.md` rule 2, every environment switch must be read in one place with one default, and a set value that fails to parse must stop the start instead of silently falling back to the default. This PR validates all parsed `victory-hle` switches eagerly at startup before the title is loaded, before `vkback-unix` / `unixgate` is opened, and before DirectStorage worker threads are spawned (following the `Result<_, String>` startup check pattern from PR #34), consolidates duplicated path reads behind `OnceLock` helpers, and cleans up the `victory-hle` policy inventory. ### Changes - **Eager startup validation (`crates/victory-hle/src/env.rs`, `apps/victory/src/run.rs`):** - Added `victory_hle::env::Switch<T>` (holding name, default, parser, and `OnceLock<T>` in one place), `parse_var`, `parse_trace_level`, `parse_auto_or_range`, and `pub fn validate_switches() -> Result<(), String>`. - Wired `victory_hle::env::validate_switches().map_err(anyhow::Error::msg)?;` at the start of `apps/victory/src/run.rs` (before CPU checks, title loading, `vkback-unix`, or worker threads) so invalid or non-UTF-8 values stop the start cleanly with exit code `1` instead of panicking lazily in worker threads or across `extern "system"` FFI boundaries. - **Whole class of parsed `victory-hle` switches covered (11 switches):** - `VICTORY_DSP_GAIN` (`crates/victory-hle/src/modules/dsp.rs`): finite positive `f32` (`v.is_finite() && v > 0.0`, default `1.0`). - `VICTORY_DSTORAGE_IO` (`crates/victory-hle/src/modules/dstorage.rs`): `one`, `handles`, `overlapped`, or `direct` (default `handles`). - `VICTORY_WALLS_TRACE` (`crates/victory-hle/src/modules/dstorage.rs`): `0..=2` (default `0`). - `VICTORY_DSTORAGE_TRACE` (`crates/victory-hle/src/modules/dstorage.rs`): `0..=2` (default `0`). - `VICTORY_DSTORAGE_RETRIES` (`crates/victory-hle/src/modules/dstorage.rs`): `u32` (default `12`, accepts `0`, rejects negative/non-numeric). - `VICTORY_MAP_THREADS` (`crates/victory-hle/src/modules/xmem.rs`, `xmem/pool.rs`): `auto` or `1..=32` (default `8`; removes silent `.clamp(1, 32)`). - `VICTORY_IMAGE_WATCH` (`crates/victory-hle/src/image_watch.rs`): comma-separated `name=hex[:1|2|4|8]` entries (rejects empty/malformed entries instead of silently discarding them). - `VICTORY_KEYS` (`crates/victory-hle/src/modules/gameinput.rs`, `diagnostics` feature): comma-separated `<seconds>:<key>` or `<from>-<to>:<key>` entries (rejects empty entries, invalid times, `to < from`, and unknown keys). - `VICTORY_PROCESS_PRIORITY` (`crates/victory-hle/src/runtime.rs`): `normal`/`0` or `above_normal`/`1` (default above normal). - `VICTORY_HOST_PADS` (`crates/victory-hle/src/modules/gameinput.rs`): `on` or `off` (default `on`). - `VICTORY_UMEM_SO` (`crates/victory-hle/src/modules/umem.rs`): non-empty valid UTF-8 path (default `/tmp/libumem_unix.so`; rejects non-UTF-8 and blank values instead of silently falling back). - **Remaining `victory-hle` environment variables (rule 22 scope accounting):** - **13 boolean/flag switches** (`VICTORY_DSTORAGE_HALF`, `VICTORY_EFFICIENCY_MODE`, `VICTORY_UMEM_CPU_PROBE`, `VICTORY_PORT_CONSTANTS`, `VICTORY_INPLACE_COMMIT`, `VICTORY_TITLE_PRIORITIES`, `VICTORY_DSP_CONVOLVE`, `VICTORY_ONE_PAD`, `VICTORY_SECTION_WINDOW`, `VICTORY_STREAM_NOTICE`, `VICTORY_MAP_LEAN`, `VICTORY_STREAM_PRIORITY`, `VKB_STRICT`): intentionally kept as `0`/`1` flags consistent with `greenfield/umem/src/switches.rs` (`Kind::Flag` accepts `t != "0"`, tested by `switches::tests::set_and_parse`) and `greenfield/umem/src/loud.rs` (which shares `VKB_STRICT`). The five `ab` switches among them are also slated for removal in `docs/TASKS.md`. - **4 raw OS path switches** (`VICTORY_DSTORAGE_LOG`, `VICTORY_AUDIO_CAPTURE`, `VICTORY_KEYS_FILE`, `VICTORY_XMA_DUMP`): read via `var_os` with no text parsing. `VICTORY_DSTORAGE_LOG` (`dstorage/stream_log.rs`) and `VICTORY_AUDIO_CAPTURE` (`audio/capture.rs`) are consolidated into single `OnceLock`-cached helpers (`path()`, `output_path()`). - **2 internal IPC (`external`) variables** (`VICTORY_AUDIO_CAPTURE_OF`, `VICTORY_RELAUNCHED_FROM`): set internally by our own child-process spawns. - **Rule 2 comments and policy tables:** - Added owner and removal conditions at every touched switch definition. - Updated `greenfield/tools/policy/toggles.txt`: removed stale pre-#79 comment and aligned inaccurate kinds/notes (`VICTORY_DSTORAGE_IO` `tune` -> `ab`, `VICTORY_EFFICIENCY_MODE` `mode` -> `option`, `VICTORY_PROCESS_PRIORITY` `tune` -> `option`, `VICTORY_STREAM_PRIORITY` `tune` -> `debug`, `VICTORY_UMEM_SO` `gpu` -> `path`, plus updated notes). - Lowered `greenfield/tools/policy/oversize.txt` counts where files shrank: `crates/victory-hle/src/modules/xmem.rs` (`2521` -> `2519`) and `crates/victory-hle/src/modules/dstorage.rs` (`1820` -> `1817`). - **Unit tests:** every parser (`parse_var`, `parse_gain`, `Io::parse`, `parse_walls_trace`, `parse_dstorage_trace`, `parse_retries`, `parse_map_threads`, `parse_words`, `host::parse_keys`, `parse_process_priority`, `parse_host_pads`, `parse_so_path`) and `validate_switches` / `validate_switches_with` are tested directly against production definitions (`Switch::parse_raw`). This intentionally keeps #65 and the `docs/TASKS.md` item open: removing the answered `ab` switches and adding owner/removal comments to the untouched switches remain separate follow-up work. ## The reference No console, vkd3d-proton, or D3D12-path counterpart (rule 12): this enforces our own rule 2 environment-switch policy in `victory-hle` and keeps the repository's policy tables accurate. ## Evidence Unit tests, end-to-end startup rejection under Proton Wine, policy checks, full `tools/build.sh` builds, and all workspace clippy checks are sufficient here (rule 27): default behaviour when switches are unset or valid is unchanged, and every parsed switch and `validate_switches` is exercised directly by unit tests. No Vulkan calls or SPIR-V output are touched, so no Vulkan validation run is needed (rule 30). Verified on Linux x86_64 (`rustc 1.98.1`, `cargo-xwin 0.24.1`, Proton Experimental Wine): - **Full `tools/build.sh` builds (4/4 pass):** - `cargo xwin build --profile diag -p victory --target x86_64-pc-windows-msvc --features diagnostics -j 6` — passed. - `(cd greenfield/wine && cargo build --release -p vkback-unix -j 6)` — passed. - `(cd greenfield/vkback && cargo build --release --bin vk-store -j 6)` — passed. - `(cd greenfield/vkback/translate && cargo build --release --bins -j 6)` — passed. - **All CI clippy jobs (`-D warnings`, 5/5 + default-features PE check pass):** - `cargo xwin clippy --workspace --all-targets --all-features --target x86_64-pc-windows-msvc --locked -- -D warnings` — 0 warnings. - `cargo xwin clippy -p victory-hle -p victory --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings` (without `diagnostics`) — 0 warnings. - `cargo clippy -p victory-shader -p victory-formats -p victory-core -p xtask --all-targets --locked -- -D warnings` — 0 warnings. - `(cd greenfield && cargo clippy --workspace --all-targets --locked -- -D warnings)` — 0 warnings. - `(cd greenfield/wine && cargo clippy --workspace --all-targets --locked -- -D warnings)` — 0 warnings. - `(cd greenfield/vkback/translate && cargo clippy --workspace --all-targets --locked -- -D warnings)` — 0 warnings. - **Native and policy tests (all pass):** - `cargo test -p victory-shader -p victory-formats -p victory-core -p xtask --locked` — passed (`victory-core`: 13, `victory-formats`: 49 passed / 5 ignored, `victory-shader`: 240 passed / 2 ignored, `xtask`: 6 including `repository_passes_policy` and `lint_tables_match`). - `(cd greenfield && cargo test -p umem -p frame -p vkback --lib --locked)` — passed (`umem`: 13, `frame`: 22, `vkback`: 168 passed / 3 ignored). - `(cd greenfield && cargo test -p vkback --test policy --locked -- --nocapture)` — 6/6 passed (`xmem.rs` 2519/2519, `dstorage.rs` 1817/1817, `gameinput.rs` 1485/1500, `toggles_registered` clean). - `cargo xtask policy` — passed (`asset policy: 532 files ok`). - **Windows `victory-hle` unit tests and E2E startup check under Proton Experimental Wine:** - Compiled with `cargo xwin test -p victory-hle --features diagnostics --target x86_64-pc-windows-msvc --no-run -j 6`. - Unfiltered full suite (`victory_hle.exe`): **187 passed, 0 failed, 2 ignored** (benchmarks `read_bench` and `map_bench`). - Filtered switch-test run (`env::tests dsp_gain dstorage_io dstorage_trace dstorage_retries map_threads words_are_read process_priority umem_so_path only_an_explicit_switch victory_keys`): **19 passed, 0 failed, 170 filtered out** (including the Windows-only non-UTF-8 `OsString` tests for `parse_var` and `VICTORY_UMEM_SO`). - End-to-end startup check (`VICTORY_WALLS_TRACE=bogus VICTORY_DSP_GAIN=-1 VICTORY_DSTORAGE_RETRIES=many victory.exe run nonexistent.exe`): exited immediately with code `1`, printing all three switch errors before attempting to open the executable or start `vkback-unix`. ## Checklist (docs/AGENTS.md) - [x] One topic (rule 31); `docs/TASKS.md` not edited, the fixed item named above (rule 29) - [x] "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen (it drops the maintainers' commits) - [x] No fallback or second path for a case that can't happen, in title data or in our own setup (rule 33); unexpected input fails loudly (rule 9) - [x] Constants come from the console, the hardware or the title's data, not tuned by eye or ear (rule 9b) — no new constants introduced; `VICTORY_DSP_GAIN` retains its textbook `1.0` default while rejecting non-positive/non-finite values at startup - [x] Every touched switch is listed, read in one place with owner/removal comments, and every parsed `victory-hle` switch stops the start on a bad value (rule 2; remaining untouched switches tracked in #65) - [x] Queues and other externally synchronized Vulkan objects are used under their lock (rule 35) — no Vulkan objects touched - [x] Every `unsafe` block has a `// SAFETY:` comment; no raw pointer around the borrow checker (rule 36) — no `unsafe` added or changed - [x] Clippy clean; tests call the production code; `TRANSLATOR_VERSION` bumped if the translator's output changes (rule 27) — translator untouched - [x] Comments say what is true now and name functions, not line numbers (rule 3) - [x] Nothing from the title, and no pointers to where non-free data can be found (hard constraints)
AGENTS.md rule 2 requires each environment switch to be read in one place
with one default and to stop the start when a set value does not parse
instead of silently falling back to the default (docs/TASKS.md
'victory-hle's switches in the toggle inventory').

- Add crate::env::{parse_or, parse_var} so every parsed victory-hle switch
  returns its default when unset and panics naming the variable and bad
  value when non-UTF-8 or invalid.
- Apply it to the whole class of parsed victory-hle switches:
  VICTORY_DSP_GAIN (finite f32), VICTORY_DSTORAGE_IO (known I/O mode),
  VICTORY_WALLS_TRACE (u8), VICTORY_DSTORAGE_TRACE (u8),
  VICTORY_DSTORAGE_RETRIES (u32), and VICTORY_MAP_THREADS (auto or 1..=32).
- Read VICTORY_DSTORAGE_LOG (stream_log.rs) and VICTORY_AUDIO_CAPTURE
  (audio/capture.rs) in one helper each instead of two call sites.
- Clean up stale pre-#79 comments and inaccurate notes/kinds for
  victory-hle entries in greenfield/tools/policy/toggles.txt, and lower
  dstorage.rs's count from 1820 to 1818 in oversize.txt.
- Add unit tests calling the production parsers directly (env, dsp,
  dstorage, xmem).

No Vulkan calls or SPIR-V output are touched, so no validation run is
needed (rule 30).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 10:12:41 +00:00
Address review findings on PR #202 so invalid switch values stop the start cleanly before title loading, vkback-unix, or worker threads exist (AGENTS.md rule 2, following PR #34):

- Replace lazy panic-on-read parsing with victory_hle::env::Switch<T> and pub fn validate_switches() -> Result<(), String>, called at the top of apps/victory/src/run.rs before loading the exe, opening unixgate, or starting DirectStorage workers.
- Cover all 11 parsed victory-hle switches (rule 22): add VICTORY_IMAGE_WATCH, VICTORY_KEYS, VICTORY_PROCESS_PRIORITY, VICTORY_HOST_PADS, and VICTORY_UMEM_SO alongside VICTORY_DSP_GAIN, VICTORY_DSTORAGE_IO, VICTORY_WALLS_TRACE, VICTORY_DSTORAGE_TRACE, VICTORY_DSTORAGE_RETRIES, and VICTORY_MAP_THREADS.
- Tighten domain checks: VICTORY_DSP_GAIN requires finite positive f32 (> 0.0); VICTORY_WALLS_TRACE and VICTORY_DSTORAGE_TRACE enforce 0..=2; extract and test parse_retries directly.
- Cache audio::capture::output_path() in OnceLock; add Rule 2 owner/removal comments on touched switch definitions; fix inconsistent kinds/notes in toggles.txt; lower oversize.txt for xmem.rs (2519) and dstorage.rs (1817).
- Expand unit tests calling production Switch/parse_* functions directly, including validate_switches coverage for every parsed switch.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 17:37 UTC · original

Merged, thanks: every victory-hle switch is read once and a value that does not parse stops the start (rule 2). #224 can merge main now, as you planned.

**@⁠vktory6** on GitHub · 2026-12-02 17:37 UTC · [original](https://github.com/vktory6/VKtory/pull/202#issuecomment-7353481542) Merged, thanks: every victory-hle switch is read once and a value that does not parse stops the start (rule 2). #224 can merge main now, as you planned.
github-bot changed target branch from main to gh-pr/202/base 2026-12-02 18:32:54 +00:00
github manually merged commit 965e1b8d6e into gh-pr/202/base 2026-12-02 18:32:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.