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

Open
HyperRamzey wants to merge 1 commit from upstream-pr/2443 into main
HyperRamzey commented 2026-11-29 13:05:44 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HyperRamzey on 2026-11-29T13:05:44Z.


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5550990924 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2443). Originally posted by [HyperRamzey](https://github.com/HyperRamzey) on 2026-11-29T13:05:44Z. --- ## 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).
ANDREANIADS commented 2026-11-29 13:20:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-29T13:20:24Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256464495 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2443#issuecomment-7256464495). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-29T13:20:24Z. --- 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.
HyperRamzey commented 2026-11-29 20:37:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HyperRamzey on 2026-11-29T20:37:24Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262227786 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2443#issuecomment-7262227786). Originally posted by [HyperRamzey](https://github.com/HyperRamzey) on 2026-11-29T20:37:24Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2443:upstream-pr/2443'
git switch 'upstream-pr/2443'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2443'
git switch 'upstream-pr/2443'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2443'
git switch 'upstream-pr/2443'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2443'
git switch 'main'
git merge --squash 'upstream-pr/2443'
git switch 'main'
git merge --ff-only 'upstream-pr/2443'
git switch 'main'
git merge 'upstream-pr/2443'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

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