launcher: -NoFrameGen wins over -More's LEONIDA_FRAME_GEN (carry of #2647) #3104

Open
MoonEyes wants to merge 5 commits from upstream-pr/3104 into main
MoonEyes commented 2026-12-02 11:03:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T11:03:25Z.


Claimed in the coordination issue as: the original author's claim in #2570 ("Keep -NoFrameGen effective after saved F1 settings and through F1 restart", https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7249530332)

What and why

Carry of #2647 (louisdibiasi), unchanged since 29 November. This branch is main plus the head of #2647 (the author's commit is kept), the conflict in d3d12/scripts/play-nvidia.ps1 resolved, and two commits of mine.

Since #2647 was opened, main took two of its three parts: the restart replays -NoFrameGen through LEONIDA_MENU_ARGS, and a typed switch wins over the saved F1 menu. What main still lacks is the case andrew-ai confirmed: -NoFrameGen with -More @{LEONIDA_FRAME_GEN='4'} still starts frame generation, because -More is applied after the switch. So:

  • The merge keeps main's side of the restart lines (the author's restart line is redundant now) and keeps the author's line that removes LEONIDA_FRAME_GEN after the -More loop.
  • That line now skips a start made by the menu's SAVE AND RESTART (-MenuRestart): that start replays -NoFrameGen, and there the menu's saved values win, so frame generation turned on in the F1 menu would otherwise be dropped on every restart. A test case covers it.
  • The test's PowerShell child runs with a process-scoped -ExecutionPolicy Bypass (KelboLive's review): the default Restricted policy refused to run the copied launcher.

Tested

Windows 11, RTX 4060 8 GB, driver 610.88, on main 895c472fa plus this branch:

  • python -I tests/test_play_nvidia_no_frame_gen.py: OK.
  • Red: with main's play-nvidia.ps1, only the extra_opt_out case fails (LEONIDA_FRAME_GEN=4 is emitted); with the launcher before the -MenuRestart guard, only menu_restart_opt_out fails.
  • python -I tests/test_ci_registration.py: OK. python -I scripts/check_no_game_data.py on both changed files: clean.
  • In game, 330 s after entering the world, scripts/play-d3d12.ps1 -SeriesS -Resolution 1080 -NoFrameGen -More @{LEONIDA_FRAME_GEN='4'} (the fixed case), built from this branch with DLSS: no device loss, no unhandled exception, process alive at the time limit; the runtime's settings line has the other -More values and no LEONIDA_FRAME_GEN; rendering 17.4 frames/s median over the last 240 s. One run, picture not checked.
  • Not run: the full suite, CI.

GPUs tested: NVIDIA GeForce RTX 4060 8 GB, driver 610.88, Windows 11

AI-assisted: yes. Models: Claude Opus 5.5 in Claude Code (carry, conflict resolution, fixes, tests, in-game run); separate read-only reviewer agent: Claude Opus 5.5 (it found the SAVE AND RESTART case).

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md. (n/a: launcher script and test)

Supersedes #2647 once merged; the original stays open until a maintainer decides.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5605102189 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3104). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T11:03:25Z. --- Claimed in the coordination issue as: the original author's claim in #2570 ("Keep -NoFrameGen effective after saved F1 settings and through F1 restart", https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7249530332) ### What and why Carry of #2647 (louisdibiasi), unchanged since 29 November. This branch is `main` plus the head of #2647 (the author's commit is kept), the conflict in `d3d12/scripts/play-nvidia.ps1` resolved, and two commits of mine. Since #2647 was opened, `main` took two of its three parts: the restart replays `-NoFrameGen` through `LEONIDA_MENU_ARGS`, and a typed switch wins over the saved F1 menu. What `main` still lacks is the case andrew-ai confirmed: `-NoFrameGen` with `-More @{LEONIDA_FRAME_GEN='4'}` still starts frame generation, because `-More` is applied after the switch. So: - The merge keeps `main`'s side of the restart lines (the author's restart line is redundant now) and keeps the author's line that removes `LEONIDA_FRAME_GEN` after the `-More` loop. - That line now skips a start made by the menu's SAVE AND RESTART (`-MenuRestart`): that start replays `-NoFrameGen`, and there the menu's saved values win, so frame generation turned on in the F1 menu would otherwise be dropped on every restart. A test case covers it. - The test's PowerShell child runs with a process-scoped `-ExecutionPolicy Bypass` (KelboLive's review): the default Restricted policy refused to run the copied launcher. ### Tested Windows 11, RTX 4060 8 GB, driver 610.88, on `main` `895c472fa` plus this branch: - `python -I tests/test_play_nvidia_no_frame_gen.py`: OK. - Red: with `main`'s `play-nvidia.ps1`, only the `extra_opt_out` case fails (`LEONIDA_FRAME_GEN=4` is emitted); with the launcher before the `-MenuRestart` guard, only `menu_restart_opt_out` fails. - `python -I tests/test_ci_registration.py`: OK. `python -I scripts/check_no_game_data.py` on both changed files: clean. - In game, 330 s after entering the world, `scripts/play-d3d12.ps1 -SeriesS -Resolution 1080 -NoFrameGen -More @{LEONIDA_FRAME_GEN='4'}` (the fixed case), built from this branch with DLSS: no device loss, no unhandled exception, process alive at the time limit; the runtime's settings line has the other `-More` values and no `LEONIDA_FRAME_GEN`; rendering 17.4 frames/s median over the last 240 s. One run, picture not checked. - Not run: the full suite, CI. GPUs tested: NVIDIA GeForce RTX 4060 8 GB, driver 610.88, Windows 11 AI-assisted: yes. Models: Claude Opus 5.5 in Claude Code (carry, conflict resolution, fixes, tests, in-game run); separate read-only reviewer agent: Claude Opus 5.5 (it found the SAVE AND RESTART case). ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`. (n/a: launcher script and test) Supersedes #2647 once merged; the original stays open until a maintainer decides. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
OreoFR commented 2026-12-02 12:19:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-02T12:19:02Z.


Verified by OreoFR (oreofr-agent, AI-assisted; third-party red/green). Head e38bcf0cda3d91b831db4a5c999786490fb6f6d0 merged into main f6dd2242e02b5f579d245f1c19dd5150d42e00a1 with no conflicts. Windows 11, Python 3.12, CPU only.

  • Green: tests/test_play_nvidia_no_frame_gen.py OK.
  • Red, with main's d3d12/scripts/play-nvidia.ps1 restored: FAILED (failures=1). That is the extra_opt_out case the description names.
    The in-game run of 330 s is already on the PR. Safe to merge: it merges cleanly, CI is green, and the change is a launcher line plus its test. Not merged by me.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345158954 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3104#issuecomment-7345158954). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-02T12:19:02Z. --- **Verified by OreoFR** (oreofr-agent, AI-assisted; third-party red/green). Head `e38bcf0cda3d91b831db4a5c999786490fb6f6d0` merged into main `f6dd2242e02b5f579d245f1c19dd5150d42e00a1` with no conflicts. Windows 11, Python 3.12, CPU only. - Green: `tests/test_play_nvidia_no_frame_gen.py` OK. - Red, with main's `d3d12/scripts/play-nvidia.ps1` restored: FAILED (failures=1). That is the `extra_opt_out` case the description names. The in-game run of 330 s is already on the PR. Safe to merge: it merges cleanly, CI is green, and the change is a launcher line plus its test. Not merged by me.
fiestorra commented 2026-12-02 23:30:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T23:30:30Z.


VERIFY-3104 — Windows nativo: red then green

Own commit e38bcf0cd — play-nvidia.ps1 (+4/−1), tests/test_play_nvidia_no_frame_gen.py (+4)

Ran at the head

python -I tests/test_play_nvidia_no_frame_gen.py     OK

Negative control (the commit's hunk in play-nvidia.ps1 reverted, the tests kept):

FAIL: test_opt_out_overrides_saved_settings_and_survives_restart
Ran 1 test — FAILED (failures=2)

It bites.

What the change is: -NoFrameGen also clears the menu's frame generation — with SAVE AND RESTART, the saved settings would otherwise bring it back after the player asked for it off. Four lines in the script, and the test that fails when they are removed is exactly the restart case, not the plain case.

Why this class of bug is worth a test: the flag is honoured at launch and then silently undone by a restart — the player's choice survives in the settings file and loses at the next save, which reads as "the flag works" right up until it does not. This is the third PR tonight in the same family (#3233's -PcGlyphs, #3247's -More), and they share a shape: the restart replays a known list, and anything the launch accepted that is not on it is lost.

What I could not test: an actual F1 SAVE AND RESTART in a running title; the test builds the restart command.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7362088310 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3104#issuecomment-7362088310). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T23:30:30Z. --- ## VERIFY-3104 — Windows nativo: `red then green` | | | |---|---| | Own commit | `e38bcf0cd` — `play-nvidia.ps1` (+4/−1), `tests/test_play_nvidia_no_frame_gen.py` (+4) | **Ran at the head** ``` python -I tests/test_play_nvidia_no_frame_gen.py OK ``` **Negative control** (the commit's hunk in `play-nvidia.ps1` reverted, the tests kept): ``` FAIL: test_opt_out_overrides_saved_settings_and_survives_restart Ran 1 test — FAILED (failures=2) ``` **It bites.** **What the change is**: `-NoFrameGen` **also clears the menu's frame generation** — with SAVE AND RESTART, the saved settings would otherwise bring it back **after the player asked for it off.** **Four lines in the script**, and the test that fails when they are removed is exactly the restart case, not the plain case. **Why this class of bug is worth a test**: the flag is honoured at launch and then **silently undone by a restart** — **the player's choice survives in the settings file and loses at the next save**, which reads as "the flag works" right up until it does not. **This is the third PR tonight in the same family** (#3233's `-PcGlyphs`, #3247's `-More`), and they share a shape: **the restart replays a known list, and anything the launch accepted that is not on it is lost.** **What I could not test**: an actual F1 SAVE AND RESTART in a running title; the test builds the restart command. Written with an AI assistant.
merzleckeier commented 2026-12-03 00:16:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T00:16:01Z.

Review: COMMENTED


Merge-order finding for e38bcf0c against main at d5b30be1 (#3247). The -More loop conflicts. I kept main’s loop, which preserves values saved by the menu on restart, and applied this PR’s -NoFrameGen guard directly after it.

That resolution leaves a restart regression. Starting with -NoFrameGen -More @{LEONIDA_FRAME_GEN='4'} suppresses FG the first time, but the emitted LEONIDA_MENU_ARGS now replays both options because of #3247. I evaluated those exact args in a second dry run with no menu frame-generation choice. It emitted LEONIDA_FRAME_GEN=4. The existing test passes because it models a restart with an explicit saved value.

A scratch guard that skips clearing the value only when -MenuRestart is set and $menu.Contains('LEONIDA_FRAME_GEN') stayed off when the menu had no choice. A saved 3 still enabled 3×, and an empty saved value still left it off. This checks a first dry run and actual replay of its generated arguments. The opt-out and launcher suites passed under Linux PowerShell (six passed, five Windows-only skips, with the opt-out test’s platform gate adjusted in the scratch copy). AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6161424951 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3104#pullrequestreview-6161424951). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T00:16:01Z. **Review:** COMMENTED --- Merge-order finding for `e38bcf0c` against `main` at `d5b30be1` (#3247). The `-More` loop conflicts. I kept main’s loop, which preserves values saved by the menu on restart, and applied this PR’s `-NoFrameGen` guard directly after it. That resolution leaves a restart regression. Starting with `-NoFrameGen -More @{LEONIDA_FRAME_GEN='4'}` suppresses FG the first time, but the emitted `LEONIDA_MENU_ARGS` now replays both options because of #3247. I evaluated those exact args in a second dry run with no menu frame-generation choice. It emitted `LEONIDA_FRAME_GEN=4`. The existing test passes because it models a restart with an explicit saved value. A scratch guard that skips clearing the value only when `-MenuRestart` is set and `$menu.Contains('LEONIDA_FRAME_GEN')` stayed off when the menu had no choice. A saved `3` still enabled 3×, and an empty saved value still left it off. This checks a first dry run and actual replay of its generated arguments. The opt-out and launcher suites passed under Linux PowerShell (six passed, five Windows-only skips, with the opt-out test’s platform gate adjusted in the scratch copy). AI-assisted.
fiestorra commented 2026-12-03 01:33:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T01:33:42Z.


#3247 moved the file under this one, and the rebase needs two resolutions — here is what the first one is

git rebase origin/main on this branch stops twice, because it is two commits (2ac782d0c, e38bcf0cd) and both touch the same two places in play-nvidia.ps1 that #3247 rewrote.

The first stop is mechanical, and I resolved it before aborting to write this — the file keeps main's -More handling and adds this pull request's removal after it:

# -More wins over the menu, except on a SAVE AND RESTART: …        ← main, from #3247
foreach ($k in $More.Keys) { if (-not ($MenuRestart -and $menu.Contains($k))) { $settings[$k] = $More[$k] } }
if ($NoFrameGen) { $settings.Remove('LEONIDA_FRAME_GEN') }        ← this pull request

and, further down, the replay line goes before the unconditional -MenuRestart:

if ($NoFrameGen) { $again += '-NoFrameGen' }
$again += '-MenuRestart'                                          ← main

The second commit then conflicts again in the same region (e38bcf0cd, "does not undo the menu's frame generation after SAVE AND RESTART"), and that one I did not resolve, because resolving it by guessing would be worse than leaving it to its author: the two commits are this pull request's own decomposition, and the second one's intent is about what the restart does when the menu saved a frame generation value — a decision, not a conflict marker.

So the rebase is not done, and I am saying so rather than pushing a version I could not run green. What I did run tonight, before #3247 landed, is in my earlier comment: tests/test_play_nvidia_no_frame_gen.py OK with the commit's hunk and failing when it is reverted.

The other three pull requests #3247 touched are handled: #3233 and #3253 are rebased and green on the fork (branches pr-3233-rebased fcaed1015 and pr-3253-rebased 185575f27), and #3115/#3124 conflict in files #3247 did not touch (leonida-lua/src/sandbox.rs, leonida-loader/src/hooks.rs), so their rebases are their own.

A note for whoever owns the launcher: play-nvidia.ps1 is now the file with the most open pull requests against it — this one, #3233, #3253, #3235 and #3263 — and every merge into it re-opens the others. Landing them in one batch, in the order #3233 → #3253 → this one, costs one rebase each and no more.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7364480699 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3104#issuecomment-7364480699). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T01:33:42Z. --- ## `#3247` moved the file under this one, and the rebase needs two resolutions — here is what the first one is **`git rebase origin/main` on this branch stops twice**, because **it is two commits** (`2ac782d0c`, `e38bcf0cd`) **and both touch the same two places in `play-nvidia.ps1` that `#3247` rewrote.** **The first stop is mechanical, and I resolved it before aborting to write this** — **the file keeps `main`'s `-More` handling and adds this pull request's removal after it**: ```powershell # -More wins over the menu, except on a SAVE AND RESTART: … ← main, from #3247 foreach ($k in $More.Keys) { if (-not ($MenuRestart -and $menu.Contains($k))) { $settings[$k] = $More[$k] } } if ($NoFrameGen) { $settings.Remove('LEONIDA_FRAME_GEN') } ← this pull request ``` **and, further down, the replay line goes before the unconditional `-MenuRestart`**: ```powershell if ($NoFrameGen) { $again += '-NoFrameGen' } $again += '-MenuRestart' ← main ``` **The second commit then conflicts again in the same region** (`e38bcf0cd`, "does not undo the menu's frame generation after SAVE AND RESTART"), **and that one I did not resolve**, **because resolving it by guessing would be worse than leaving it to its author**: **the two commits are this pull request's own decomposition, and the second one's intent is about what the restart does when the menu saved a frame generation value** — **a decision, not a conflict marker.** **So the rebase is not done, and I am saying so rather than pushing a version I could not run green.** **What I did run tonight, before `#3247` landed, is in my earlier comment**: **`tests/test_play_nvidia_no_frame_gen.py` OK with the commit's hunk and failing when it is reverted.** **The other three pull requests `#3247` touched are handled**: **`#3233` and `#3253` are rebased and green on the fork** (branches `pr-3233-rebased` `fcaed1015` and `pr-3253-rebased` `185575f27`), **and `#3115`/`#3124` conflict in files `#3247` did not touch** (`leonida-lua/src/sandbox.rs`, `leonida-loader/src/hooks.rs`), **so their rebases are their own.** **A note for whoever owns the launcher**: **`play-nvidia.ps1` is now the file with the most open pull requests against it** — **this one, `#3233`, `#3253`, `#3235` and `#3263`** — **and every merge into it re-opens the others.** **Landing them in one batch, in the order `#3233` → `#3253` → this one, costs one rebase each and no more.**
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/3104:upstream-pr/3104'
git switch 'upstream-pr/3104'

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/3104'
git switch 'upstream-pr/3104'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3104'
git switch 'upstream-pr/3104'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3104'
git switch 'main'
git merge --squash 'upstream-pr/3104'
git switch 'main'
git merge --ff-only 'upstream-pr/3104'
git switch 'main'
git merge 'upstream-pr/3104'
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
ProjectLeonida/mandy!3104
No description provided.