Fix F1 settings persistence, reset state sync, and launcher script parity #2868

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

@⁠steven-seagull27 on GitHub · 2026-11-29 18:22 UTC · original
steven-seagull27:fix/2839-f1-settings-save-and-close → main · +330 −17 · 4 files · 1 commits · open

Fixes #2775 and addresses #2839.

Summary

1. Clear explicitly unset F1 settings even when listed in KEPT (#2839)

  • apps/victory/src/play.rs: Track non-VICTORY_MENU_ variables explicitly cleared with NAME= in victory-settings.txt or --set (explicitly_unset + env_removals), and remove them from the child environment case-insensitively even when listed in KEPT (such as VICTORY_ADAPTER reset back to AUTO and VICTORY_VEHICLE_AUTO_CENTER toggled back OFF). Intact KEPT path/environment overrides still survive when not explicitly cleared.
  • scripts/play-foxhound.ps1: Track explicitly cleared keys from victory-settings.txt and -More and remove them from Env: even if present in $paths (including VICTORY_ADAPTER).
  • Intentionally left VICTORY_FORCE_MFG_RTX40 (play.rs) untouched so there is no conflict with #2576.

2. Launcher script parity for VICTORY_MENU_S_RES and fsr4 (#2839)

  • scripts/play-foxhound.ps1: Read and apply VICTORY_MENU_S_RES (Series S picture size) and propagate it to VICTORY_MENU_S_RES / VICTORY_DLSS_MODE matching apps/victory/src/play.rs. Accept 'fsr4' in -FgType and VICTORY_MENU_FG_TYPE, and wire VICTORY_PC_FSR=1, VICTORY_FSR_FRAMEGEN=4, VICTORY_FIDELITYFX_DIR, and VICTORY_MENU_FRAMEGEN to match play.rs.
  • scripts/play-gta6-framegen.ps1: Accept 'fsr4' in GTA6_FG_TYPE and VICTORY_MENU_FG_TYPE so FSR 4 selection persists cleanly across launches.

3. Fix F1 menu reset() state sync and change_and_save() note preservation (#2839)

  • crates/victory-gpu/src/host/menu.rs:
    • reset() now restores self.values to ITEMS play defaults, applies changed live settings immediately, clears any inherited VICTORY_ADAPTER override, and resets self.started = self.values.clone() so subsequent edits before restarting write an accurate diff.
    • change_and_save() preserves specific non-empty notes set by change() (such as "RESTART REQUIRED TO ENABLE FRAME GENERATION") when save() succeeds instead of clobbering them with "SAVED. APPLIES AT THE NEXT START".

4. Add "SAVE AND CLOSE GAME" F1 menu action (#2775)

  • crates/victory-gpu/src/host/menu.rs: Added "SAVE AND CLOSE GAME" (with ABOUT_SAVE_CLOSE fitting within COLUMNS using existing font glyphs) alongside the other save actions while keeping "CLOSE" (close menu overlay) as the last row. On Enter, it calls self.save() and, if saving succeeds, logs and exits immediately via TerminateProcess(GetCurrentProcess(), 0) (matching restart_as so Streamline DLL unload never hangs).

Verification

  • cargo test --locked -j 2 -p victory-gpu --lib -- menu --nocapture --test-threads=1 — 17 passed, 0 failed (including new synthetic unit tests for reset(), change_and_save() note preservation, and save_and_close_game() subprocess exit + failure path).
  • cargo test --locked -j 2 -p victory --bin victory -- --test-threads=1 — 79 passed, 0 failed (including new synthetic unit test for explicitly_unset / env_removals overriding KEPT case-insensitively).
  • cargo clippy --locked -j 2 -p victory-gpu -p victory --bins --tests — 0 warnings in touched files.
  • PowerShell AST syntax check on scripts/play-foxhound.ps1 and scripts/play-gta6-framegen.ps1 — passed.
  • git diff --check — clean.
**@⁠steven-seagull27** on GitHub · 2026-11-29 18:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2868) `steven-seagull27:fix/2839-f1-settings-save-and-close` → `main` · +330 −17 · 4 files · 1 commits · open Fixes #2775 and addresses #2839. ## Summary ### 1. Clear explicitly unset F1 settings even when listed in `KEPT` (`#2839`) - **`apps/victory/src/play.rs`**: Track non-`VICTORY_MENU_` variables explicitly cleared with `NAME=` in `victory-settings.txt` or `--set` (`explicitly_unset` + `env_removals`), and remove them from the child environment case-insensitively even when listed in `KEPT` (such as `VICTORY_ADAPTER` reset back to `AUTO` and `VICTORY_VEHICLE_AUTO_CENTER` toggled back `OFF`). Intact `KEPT` path/environment overrides still survive when not explicitly cleared. - **`scripts/play-foxhound.ps1`**: Track explicitly cleared keys from `victory-settings.txt` and `-More` and remove them from `Env:` even if present in `$paths` (including `VICTORY_ADAPTER`). - Intentionally left `VICTORY_FORCE_MFG_RTX40` (`play.rs`) untouched so there is no conflict with #2576. ### 2. Launcher script parity for `VICTORY_MENU_S_RES` and `fsr4` (`#2839`) - **`scripts/play-foxhound.ps1`**: Read and apply `VICTORY_MENU_S_RES` (Series S picture size) and propagate it to `VICTORY_MENU_S_RES` / `VICTORY_DLSS_MODE` matching `apps/victory/src/play.rs`. Accept `'fsr4'` in `-FgType` and `VICTORY_MENU_FG_TYPE`, and wire `VICTORY_PC_FSR=1`, `VICTORY_FSR_FRAMEGEN=4`, `VICTORY_FIDELITYFX_DIR`, and `VICTORY_MENU_FRAMEGEN` to match `play.rs`. - **`scripts/play-gta6-framegen.ps1`**: Accept `'fsr4'` in `GTA6_FG_TYPE` and `VICTORY_MENU_FG_TYPE` so FSR 4 selection persists cleanly across launches. ### 3. Fix F1 menu `reset()` state sync and `change_and_save()` note preservation (`#2839`) - **`crates/victory-gpu/src/host/menu.rs`**: - `reset()` now restores `self.values` to `ITEMS` play defaults, applies changed live settings immediately, clears any inherited `VICTORY_ADAPTER` override, and resets `self.started = self.values.clone()` so subsequent edits before restarting write an accurate diff. - `change_and_save()` preserves specific non-empty notes set by `change()` (such as `"RESTART REQUIRED TO ENABLE FRAME GENERATION"`) when `save()` succeeds instead of clobbering them with `"SAVED. APPLIES AT THE NEXT START"`. ### 4. Add `"SAVE AND CLOSE GAME"` F1 menu action (`#2775`) - **`crates/victory-gpu/src/host/menu.rs`**: Added `"SAVE AND CLOSE GAME"` (with `ABOUT_SAVE_CLOSE` fitting within `COLUMNS` using existing font glyphs) alongside the other save actions while keeping `"CLOSE"` (close menu overlay) as the last row. On Enter, it calls `self.save()` and, if saving succeeds, logs and exits immediately via `TerminateProcess(GetCurrentProcess(), 0)` (matching `restart_as` so Streamline DLL unload never hangs). ## Verification - `cargo test --locked -j 2 -p victory-gpu --lib -- menu --nocapture --test-threads=1` — 17 passed, 0 failed (including new synthetic unit tests for `reset()`, `change_and_save()` note preservation, and `save_and_close_game()` subprocess exit + failure path). - `cargo test --locked -j 2 -p victory --bin victory -- --test-threads=1` — 79 passed, 0 failed (including new synthetic unit test for `explicitly_unset` / `env_removals` overriding `KEPT` case-insensitively). - `cargo clippy --locked -j 2 -p victory-gpu -p victory --bins --tests` — 0 warnings in touched files. - PowerShell AST syntax check on `scripts/play-foxhound.ps1` and `scripts/play-gta6-framegen.ps1` — passed. - `git diff --check` — clean.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 18:23:27 +00:00
github-bot changed title from Fix F1 settings persistence, reset, script parity, and add SAVE AND CLOSE GAME to Fix F1 settings persistence, reset state sync, and launcher script parity 2026-11-29 20:46:11 +00:00
github-bot force-pushed github-bot/gh-2868 from d799917eff to 2b7bb1c3a1 2026-11-29 20:46:12 +00:00 Compare
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-29 20:41 UTC · original

Rebased onto origin/main (cec481f4) and narrowed scope now that "SAVE AND CLOSE GAME" and the bottom save-row ordering landed upstream in cec481f4.

Retained changes (2b7bb1c3)

  • Explicit NAME= unsets overriding KEPT in apps/victory/src/play.rs and scripts/play-foxhound.ps1 (addresses #2839).
  • Launcher script parity for VICTORY_MENU_S_RES and 'fsr4' in scripts/play-foxhound.ps1 and scripts/play-gta6-framegen.ps1.
  • F1 menu state fixes in crates/victory-gpu/src/host/menu.rs: reset() syncs values, live settings, VICTORY_ADAPTER, and started; change_and_save() preserves non-empty notes set by change() on save.
  • Synthetic unit tests covering explicit KEPT unsets (play.rs), reset() state sync, and change_and_save() note preservation (menu.rs).

Verification

  • cargo test --locked -j 3 -p victory — 83 passed, 0 failed.
  • cargo test --locked -j 3 -p victory-gpu --lib -- menu --test-threads=1 — 16 passed, 0 failed.
  • cargo clippy --locked -j 3 -p victory -p victory-gpu --all-targets — 0 warnings in touched files.
  • PowerShell AST syntax check on scripts/play-foxhound.ps1 and scripts/play-gta6-framegen.ps1 — passed.
  • git diff --check — clean.
**@⁠steven-seagull27** on GitHub · 2026-11-29 20:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2868#issuecomment-7262280071) Rebased onto `origin/main` (`cec481f4`) and narrowed scope now that `"SAVE AND CLOSE GAME"` and the bottom save-row ordering landed upstream in `cec481f4`. ### Retained changes (`2b7bb1c3`) - **Explicit `NAME=` unsets overriding `KEPT`** in `apps/victory/src/play.rs` and `scripts/play-foxhound.ps1` (addresses `#2839`). - **Launcher script parity** for `VICTORY_MENU_S_RES` and `'fsr4'` in `scripts/play-foxhound.ps1` and `scripts/play-gta6-framegen.ps1`. - **F1 menu state fixes** in `crates/victory-gpu/src/host/menu.rs`: `reset()` syncs `values`, live settings, `VICTORY_ADAPTER`, and `started`; `change_and_save()` preserves non-empty notes set by `change()` on save. - **Synthetic unit tests** covering explicit `KEPT` unsets (`play.rs`), `reset()` state sync, and `change_and_save()` note preservation (`menu.rs`). ### Verification - `cargo test --locked -j 3 -p victory` — 83 passed, 0 failed. - `cargo test --locked -j 3 -p victory-gpu --lib -- menu --test-threads=1` — 16 passed, 0 failed. - `cargo clippy --locked -j 3 -p victory -p victory-gpu --all-targets` — 0 warnings in touched files. - PowerShell AST syntax check on `scripts/play-foxhound.ps1` and `scripts/play-gta6-framegen.ps1` — passed. - `git diff --check` — clean.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-30 12:10 UTC · original

I reproduced one #2839 persistence case on release/main 41adb551 and repeated it with 2b7bb1c applied. The same fixture executes the checked-in PowerShell settings read, -More handling and environment update statements with a generated settings file and a temporary process environment.

Input, with an adapter already inherited Main With this PR
Saved file ends with VICTORY_ADAPTER= Keeps the old adapter Clears it
A saved adapter followed by -More VICTORY_ADAPTER= Keeps the old adapter Clears it
Saved empty, then -More victory_adapter=reselected Selects the later value Selects the later value
No saved or command-line value for the adapter Preserves the inherited value Preserves the inherited value

The fixture also confirmed that the unrelated inherited VICTORY_STREAMLINE_DIR value stayed present in all eight runs. Both updated PowerShell scripts parsed successfully.

I applied #2256 9b2b3ff and this PR on current main in both orders. Both produced tree 006559cf6373. On the combined tree 19 F1 menu tests and 29 play tests passed on Windows, including the save-failure and reset cases. These checks use generated settings and cover launcher and menu logic.

The PR check stopped in Clippy on victory-loader's unused unwind_copy, which also reproduces on clean main.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-30 12:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2868#issuecomment-7278054462) I reproduced one #2839 persistence case on release/main `41adb551` and repeated it with `2b7bb1c` applied. The same fixture executes the checked-in PowerShell settings read, `-More` handling and environment update statements with a generated settings file and a temporary process environment. | Input, with an adapter already inherited | Main | With this PR | | --- | --- | --- | | Saved file ends with `VICTORY_ADAPTER=` | Keeps the old adapter | Clears it | | A saved adapter followed by `-More VICTORY_ADAPTER=` | Keeps the old adapter | Clears it | | Saved empty, then `-More victory_adapter=reselected` | Selects the later value | Selects the later value | | No saved or command-line value for the adapter | Preserves the inherited value | Preserves the inherited value | The fixture also confirmed that the unrelated inherited `VICTORY_STREAMLINE_DIR` value stayed present in all eight runs. Both updated PowerShell scripts parsed successfully. I applied #2256 `9b2b3ff` and this PR on current main in both orders. Both produced tree `006559cf6373`. On the combined tree 19 F1 menu tests and 29 `play` tests passed on Windows, including the save-failure and reset cases. These checks use generated settings and cover launcher and menu logic. The [PR check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46307894587/job/141487351757) stopped in Clippy on `victory-loader`'s unused `unwind_copy`, which also reproduces on clean main. AI-assisted with OpenAI Codex.
github-bot force-pushed github-bot/gh-2868 from 2b7bb1c3a1 to 133e16a581 2026-11-30 18:34:27 +00:00 Compare
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-30 18:33 UTC · original

Thanks @andrewpozdnakov7-jpg for reproducing #2839 and verifying the persistence/unset matrix and #2256 combination!

Rebased cleanly onto latest main (e1251c31 -> 133e16a5):

  • Adapted the launcher changes to scripts/play-nvidia.ps1 (renamed from scripts/play-foxhound.ps1 in 84bd61e2), keeping VICTORY_MENU_S_RES parity and explicit NAME= unsets across $paths and the play shader-key defaults (#4067), while dropping the play-nvidia.ps1 fsr4 hunks already merged upstream (f580ddb7).
  • Integrated Menu::reset_at state sync (values, live env switches, VICTORY_ADAPTER, started) and Menu::change_and_save note preservation with #2256's save/reset error handling and test_env_lock serialization in crates/victory-gpu/src/host/menu.rs.

Verification

  • cargo test -p victory-gpu --lib -- menu — 30 passed, 0 failed.
  • cargo test -p victory --bin victory — 92 passed, 0 failed.
  • cargo clippy -p victory-gpu -p victory --lib --bins --tests — 0 warnings in touched files.
  • cargo run -p xtask -- policy --staged & PowerShell AST parse on scripts/play-nvidia.ps1 / scripts/play-gta6-framegen.ps1 — passed.
**@⁠steven-seagull27** on GitHub · 2026-11-30 18:33 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2868#issuecomment-7288032672) Thanks `@andrewpozdnakov7-jpg` for reproducing `#2839` and verifying the persistence/unset matrix and `#2256` combination! Rebased cleanly onto latest `main` (`e1251c31` -> `133e16a5`): - Adapted the launcher changes to `scripts/play-nvidia.ps1` (renamed from `scripts/play-foxhound.ps1` in `84bd61e2`), keeping `VICTORY_MENU_S_RES` parity and explicit `NAME=` unsets across `$paths` and the play shader-key defaults (`#4067`), while dropping the `play-nvidia.ps1` `fsr4` hunks already merged upstream (`f580ddb7`). - Integrated `Menu::reset_at` state sync (`values`, live env switches, `VICTORY_ADAPTER`, `started`) and `Menu::change_and_save` note preservation with `#2256`'s save/reset error handling and `test_env_lock` serialization in `crates/victory-gpu/src/host/menu.rs`. ### Verification - `cargo test -p victory-gpu --lib -- menu` — 30 passed, 0 failed. - `cargo test -p victory --bin victory` — 92 passed, 0 failed. - `cargo clippy -p victory-gpu -p victory --lib --bins --tests` — 0 warnings in touched files. - `cargo run -p xtask -- policy --staged` & PowerShell AST parse on `scripts/play-nvidia.ps1` / `scripts/play-gta6-framegen.ps1` — passed.
github-bot force-pushed github-bot/gh-2868 from 133e16a581 to 4b17794491 2026-12-01 00:58:00 +00:00 Compare
github-bot force-pushed github-bot/gh-2868 from 4b17794491 to a7bbce0ed0 2026-12-01 01:52:41 +00:00 Compare
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 15:11 UTC · original

On a7bbce0e, the environment cleanup matches names without case, but the launcher settings map still matches --set keys by case. With a saved VICTORY_ADAPTER, --set victory_adapter= removes the inherited value and then the saved setting puts the adapter back. Mixed-case repeated assignments can also preserve an earlier value.

21fd0fe0 normalizes Victory switch names before applying the command-line overrides. A focused Windows fixture used the exact settings and environment code with synthetic values. The saved adapter now clears, and the last assignment wins in either case order. Clearing an inherited adapter and running without an override behaved the same before and after. The staged asset policy passed.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 15:11 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2868#issuecomment-7315502729) On `a7bbce0e`, the environment cleanup matches names without case, but the launcher settings map still matches `--set` keys by case. With a saved `VICTORY_ADAPTER`, `--set victory_adapter=` removes the inherited value and then the saved setting puts the adapter back. Mixed-case repeated assignments can also preserve an earlier value. [21fd0fe0](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/21fd0fe0f60ad4124f3e443ca247e5ae3d83d9ba) normalizes Victory switch names before applying the command-line overrides. A focused Windows fixture used the exact settings and environment code with synthetic values. The saved adapter now clears, and the last assignment wins in either case order. Clearing an inherited adapter and running without an override behaved the same before and after. The staged asset policy passed. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host/menu.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/2868/head:github-bot/gh-2868'
git switch 'github-bot/gh-2868'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2868'
git switch 'github-bot/gh-2868'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2868'
git switch 'github-bot/gh-2868'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2868'
git switch 'main'
git merge --squash 'github-bot/gh-2868'
git switch 'main'
git merge --ff-only 'github-bot/gh-2868'
git switch 'main'
git merge 'github-bot/gh-2868'
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!2868
No description provided.