play: --set wins over the saved VICTORY_MENU_* values #2443

Open
github-bot wants to merge 1 commit from github-bot/gh-2443 into main AGit
Owner

@⁠HyperRamzey on GitHub · 2026-11-29 13:05 UTC · original
HyperRamzey:pr/play-set-menu-precedence → main · +98 −8 · 1 files · 1 commits · open

What

--set VICTORY_MENU_FPS=30 (and VICTORY_MENU_CONSOLE, _RES, _DLSS, ...) was read back from the menu file after the setters had run, so a value the F1 menu had once saved silently overwrote the one given on the command line. settings() read the saved choices from menu only; it now reads a VICTORY_MENU_* entry from --set first (last occurrence wins, spaces around key and value trimmed), then falls back to the menu file.

Why it matters

victory play --set VICTORY_MENU_CONSOLE=series-x --series-s kept starting as Series S, and --set VICTORY_MENU_FPS=30 kept the file's pacing once the menu had saved 60/120. Verified in game under Proton-CachyOS: with the fix, --set VICTORY_MENU_FPS=30 --set VICTORY_MENU_CONSOLE=series-s logs console=series-s, VICTORY_MENU_FPS=30, VICTORY_FRAME_INTERVAL_US=33333, and the F1 overlay reads 30.0 fps / 33.3 ms.

Tests

  • set_overrides_the_fps_the_menu_saved — file says 120, --set says 60 then 30: the interval is 33333 and the menu value is 30.
  • set_console_overrides_the_series_s_profile — --series-s plus the file's series-s, overridden to series-x: the Series X profile and its scene knobs.
  • an_invalid_set_menu_value_falls_back_as_before — a filter-rejected --set value changes nothing.

All play::tests pass under Wine (cargo xwin test -p victory), sabotage-checked: reverting to the menu-only lookup makes the fps and console tests fail.

Resolves

The behaviour the --set doc comment already promised. No dedicated issue was found; it is the switch-precedence defect behind several "the setting did not take" reports in the settings discussions.

Review feedback (ANDREANIADS)

An invalid --set must not mask the saved value. saved() now takes the last --set entry the same per-key filters accept; a rejected value is as if absent. Added an_invalid_set_value_does_not_mask_the_saved_one: a saved 4k plus --set VICTORY_MENU_RES=bogus resolves exactly as the file alone, and --set VICTORY_MENU_RES=1080to1440 followed by bogus keeps 1080to1440. Sabotage-checked: accepting any value makes the test fail with VICTORY_NATIVE_1440P=1 and the file's 4k overwritten.

All 32 play:: tests pass under Wine; the full victory suite shows only the two pre-existing Wine-environment failures (windows_is_not_wine, the System32 d3d12core copy test).

**@⁠HyperRamzey** on GitHub · 2026-11-29 13:05 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2443) `HyperRamzey:pr/play-set-menu-precedence` → `main` · +98 −8 · 1 files · 1 commits · open ## What `--set VICTORY_MENU_FPS=30` (and `VICTORY_MENU_CONSOLE`, `_RES`, `_DLSS`, ...) was read back from the menu file after the setters had run, so a value the F1 menu had once saved silently overwrote the one given on the command line. `settings()` read the saved choices from `menu` only; it now reads a `VICTORY_MENU_*` entry from `--set` first (last occurrence wins, spaces around key and value trimmed), then falls back to the menu file. ## Why it matters `victory play --set VICTORY_MENU_CONSOLE=series-x --series-s` kept starting as Series S, and `--set VICTORY_MENU_FPS=30` kept the file's pacing once the menu had saved 60/120. Verified in game under Proton-CachyOS: with the fix, `--set VICTORY_MENU_FPS=30 --set VICTORY_MENU_CONSOLE=series-s` logs `console=series-s`, `VICTORY_MENU_FPS=30`, `VICTORY_FRAME_INTERVAL_US=33333`, and the F1 overlay reads 30.0 fps / 33.3 ms. ## Tests - `set_overrides_the_fps_the_menu_saved` — file says 120, `--set` says 60 then 30: the interval is 33333 and the menu value is 30. - `set_console_overrides_the_series_s_profile` — `--series-s` plus the file's `series-s`, overridden to `series-x`: the Series X profile and its scene knobs. - `an_invalid_set_menu_value_falls_back_as_before` — a filter-rejected `--set` value changes nothing. All `play::tests` pass under Wine (`cargo xwin test -p victory`), sabotage-checked: reverting to the menu-only lookup makes the fps and console tests fail. ## Resolves The behaviour the `--set` doc comment already promised. No dedicated issue was found; it is the switch-precedence defect behind several "the setting did not take" reports in the settings discussions. ## Review feedback (ANDREANIADS) An invalid `--set` must not mask the saved value. `saved()` now takes the last `--set` entry the same per-key filters accept; a rejected value is as if absent. Added `an_invalid_set_value_does_not_mask_the_saved_one`: a saved `4k` plus `--set VICTORY_MENU_RES=bogus` resolves exactly as the file alone, and `--set VICTORY_MENU_RES=1080to1440` followed by `bogus` keeps `1080to1440`. Sabotage-checked: accepting any value makes the test fail with `VICTORY_NATIVE_1440P=1` and the file's `4k` overwritten. All 32 `play::` tests pass under Wine; the full `victory` suite shows only the two pre-existing Wine-environment failures (`windows_is_not_wine`, the System32 d3d12core copy test).
`--set VICTORY_MENU_FPS=30` was read back from the menu file after the
setters ran (`settings()` took the saved fps, console and resolution from
`menu` only), so the file's value was written over the one asked for.
Read a VICTORY_MENU_* entry from `--set` first (last one wins, spaces
trimmed), then the file.

Tests: fps 120 in the file overridden to 30 (VICTORY_FRAME_INTERVAL_US
33333), console=series-x over --series-s and the file's series-s, and an
invalid --set value falling back exactly as before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 13:06:15 +00:00
Author
Owner

@⁠ANDREANIADS on GitHub · 2026-11-29 13:20 UTC · original

The invalid-value test uses an empty menu. With VICTORY_MENU_RES=4k saved and o.res="1440", adding only --set VICTORY_MENU_RES=bogus changes the resolved value from 4k to 1440. I reproduced this in an isolated Rust test using parse_menu, the lookup and the resolution filter from 25e3d4a. With repeated --set values, 1080to1440, bogus also yields 1440, while bogus, 1080to1440 yields 1080to1440.

Could the regression test use a saved resolution distinct from the default? To preserve the last-occurrence rule, validate the last explicit resolution first, then fall back to the saved resolution if that value is rejected. Tested parsing only.

**@⁠ANDREANIADS** on GitHub · 2026-11-29 13:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2443#issuecomment-7256464495) The invalid-value test uses an empty menu. With `VICTORY_MENU_RES=4k` saved and `o.res="1440"`, adding only `--set VICTORY_MENU_RES=bogus` changes the resolved value from `4k` to `1440`. I reproduced this in an isolated Rust test using `parse_menu`, the lookup and the resolution filter from `25e3d4a`. With repeated `--set` values, `1080to1440, bogus` also yields `1440`, while `bogus, 1080to1440` yields `1080to1440`. Could the regression test use a saved resolution distinct from the default? To preserve the last-occurrence rule, validate the last explicit resolution first, then fall back to the saved resolution if that value is rejected. Tested parsing only.
github-bot force-pushed github-bot/gh-2443 from 25e3d4a749 to 4a81f5dc8b 2026-11-29 20:40:27 +00:00 Compare
Author
Owner

@⁠HyperRamzey on GitHub · 2026-11-29 20:37 UTC · original

Good catch — fixed. saved() now takes the last --set entry the same per-key filters accept, so a rejected value acts as absent: it falls back to an earlier --set of the same key, then to the saved value. With VICTORY_MENU_RES=4k saved, --set VICTORY_MENU_RES=bogus now resolves exactly as the file alone; 1080to1440, bogus keeps 1080to1440.

Added an_invalid_set_value_does_not_mask_the_saved_one covering both of your cases (the old test used an empty menu, as you noted). It fails under sabotage that accepts any value (VICTORY_NATIVE_1440P=1, file's 4k masked). All play:: tests pass under Wine. Pushed as 4a81f5dc.

**@⁠HyperRamzey** on GitHub · 2026-11-29 20:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2443#issuecomment-7262227786) Good catch — fixed. `saved()` now takes the last `--set` entry the same per-key filters accept, so a rejected value acts as absent: it falls back to an earlier `--set` of the same key, then to the saved value. With `VICTORY_MENU_RES=4k` saved, `--set VICTORY_MENU_RES=bogus` now resolves exactly as the file alone; `1080to1440, bogus` keeps `1080to1440`. Added `an_invalid_set_value_does_not_mask_the_saved_one` covering both of your cases (the old test used an empty menu, as you noted). It fails under sabotage that accepts any value (`VICTORY_NATIVE_1440P=1`, file's 4k masked). All `play::` tests pass under Wine. Pushed as 4a81f5dc.
This pull request has changes conflicting with the target branch.
  • apps/victory/src/play.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2443/head:github-bot/gh-2443'
git switch 'github-bot/gh-2443'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2443'
git switch 'github-bot/gh-2443'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2443'
git switch 'github-bot/gh-2443'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2443'
git switch 'main'
git merge --squash 'github-bot/gh-2443'
git switch 'main'
git merge --ff-only 'github-bot/gh-2443'
git switch 'main'
git merge 'github-bot/gh-2443'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2443
No description provided.