Skip to content

launcher: honor -NoFrameGen across settings and restart - #2647

Open
louisdibiasi wants to merge 1 commit into
ProjectLeonida:mainfrom
louisdibiasi:fix/windows-no-frame-gen-current
Open

louisdibiasi wants to merge 1 commit into
ProjectLeonida:mainfrom
louisdibiasi:fix/windows-no-frame-gen-current

Conversation

@louisdibiasi

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: Keep -NoFrameGen effective after saved F1 settings and through F1 restart

What and why

Saved F1 settings and -More can set LEONIDA_FRAME_GEN after the launcher has handled -NoFrameGen. The F1 restart command also drops the switch. Apply the DLSS frame generation opt-out after settings are loaded and carry it into the restart arguments. An explicit -FsrFrameGen remains available with the DLSS opt-out.

Tested

  • python -I tests/test_play_nvidia_no_frame_gen.py -v reproduced the opt-out failures on 060c47160 and passed seven synthetic dry-run cases in each shell with the fix. Cases cover defaults, saved settings, -More, restart arguments, and explicit FSR 3 selection alongside -NoFrameGen.
  • Windows PowerShell 5.1.26100.9818 and PowerShell 7.6.10 on Windows 11, with Python 3.12.10. All 19 existing tests in test_win_launchers.py, test_leonida_launcher.py, and test_build_batch_launch.py passed. The changed-file game-data scan passed.
  • The tests verify launcher settings and generated restart arguments. Live F1 restart, on-device frame generation, and gameplay FPS were outside the test scope.

GPUs tested: n/a (synthetic launcher dry runs).

AI-assisted: Yes, with OpenAI Codex (GPT-6).

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys, or decryption.

Keep the DLSS frame generation opt-out after loading settings and in the F1 restart command. Verify the opt-out alongside the FSR 3 launcher option using synthetic PowerShell dry runs.
@merzleckeier

Copy link
Copy Markdown
Contributor

Independent dry-run compatibility check with #2626. I tested exact heads 2ac782d0 and fcc044cd against main 060c47160. Git merged both launcher changes cleanly (tree 052517f97). PowerShell 7.4.21 on CachyOS with synthetic file paths containing spaces and apostrophes.

MEASURED. After the initial dry run I took LEONIDA_MENU_ARGS verbatim and invoked the launcher again through PowerShell with those arguments and -DryRun. The saved F1 value for DLSS generation changed from 3 to 5 between runs, and the first run tried setting it to 4 through -More.

The seven opt-out cases also passed with #2647 alone and with both applied, using the original fixture with its shell lookup adapted to native PowerShell. Synthetic dry runs only. AI-assisted with OpenAI Codex.

@ecox982745

Copy link
Copy Markdown
Contributor

Independent native Windows restart replay for #2647 and #2626. I used heads 2ac782d0 and fcc044cdc on 452d1d1b6 (clean combined tree 1f77c7107), Windows PowerShell 5.1.26100.10068 and PowerShell 7.6.9. The executable and SDK fixture paths contained spaces and apostrophes. I changed the saved F1 DLSS value from 3 to 5 between the first dry run and replay of the exact generated arguments. The initial command also requested 4 via -More.

  • On main, the initial opt-out emitted 4, and the replay emitted 5. Motion blur was enabled initially and dropped on replay.
  • With both patches, -NoFrameGen and -MotionBlur each appeared once in the generated command. Both settings remained effective on replay. An explicit -FsrFrameGen also survived, and the defaults still used the saved DLSS value on replay.
  • All 12 replay cases behaved as expected across both shells and both trees. On the combined tree, the four launcher regression files passed 21 tests total, including the seven opt-out cases in each shell.

Synthetic dry runs only. No game launch or GPU rendering. AI-assisted with OpenAI Codex (GPT-6.2 Sol).

@fiestorra

Copy link
Copy Markdown
Contributor

Verified on main 452d1d1b6, Windows 11 with Windows PowerShell available (which is where this test actually runs the script):

git merge-tree origin/main refs/pull/2647/head   -> clean
cherry-pick its commit                           -> clean
python3 -m pytest tests/test_play_nvidia_no_frame_gen.py -q  -> 1 passed, 16 subtests

The diff is two lines in d3d12/scripts/play-nvidia.ps1:

if ($NoFrameGen) { $settings.Remove('LEONIDA_FRAME_GEN') }
if ($NoFrameGen) { $again += '-NoFrameGen' }

which is the whole point: -NoFrameGen now clears the setting instead of only overriding it for the current launch, and survives the re-invocation. That is the bug shape where a flag "works" until the script restarts itself.

Why this one is worth a maintainer's time: the test is not a mock. It skips unless os.name == "nt" and PowerShell is on PATH, and then it runs the script through subprocess, so the 16 subtests are assertions about the real shell behaviour rather than about a Python model of it. Most flag-plumbing tests in this tree cannot say that.

Not tested: on Linux, where the test skips by design, and against the real title - no game data is used.

Written with an AI assistant.

@KelboLive

Copy link
Copy Markdown

Independent check on Windows, at 2ac782d0c: the new test fails under the default PowerShell execution policy, and a one-flag fix makes it pass.

  • python -I tests/test_play_nvidia_no_frame_gen.py on Windows 11 with powershell.exe 5.1: FAIL — File ...\play-nvidia.ps1 cannot be loaded because running scripts is disabled on this system (policy Restricted).
  • The invocation in the test is [shell, "-NoProfile", "-NonInteractive", "-Command", DRY_RUN]; Windows PowerShell applies the policy when -Command loads the script with &.
  • With -ExecutionPolicy Bypass added to that argv (local test change, not pushed):
[shell, "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", DRY_RUN]

the test is 1 test, OK in 0.8 s.

Suggested fix: add -ExecutionPolicy Bypass (both powershell.exe and pwsh.exe accept it), so the test runs on default contributor machines, not only where the policy is already relaxed.

Environment: Windows 11 Pro 10.0.26200.9711, Windows PowerShell 5.1.

AI-assisted: yes (opencode).

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants