Launcher: only options changed since the last PLAY win over the F1 menu (LAUNCHER-CHOSEN-SWITCHES) #3061

Merged
TheStonedGamer merged 2 commits from upstream-pr/3061 into main 2026-12-02 15:21:32 +00:00
TheStonedGamer commented 2026-12-02 07:32:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheStonedGamer on 2026-12-02T07:32:35Z.


Claimed in the coordination issue as: LAUNCHER-CHOSEN-SWITCHES (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7338303972)

Fixes #2953
Fixes #2987

What and why

Launcher.bat (tools/leonida_launcher.py) passes every option at every start (-Dlss, -FrameGen, -SmoothMotion, -SeriesS, -Resolution ...). Under D3D12-MENU-LAST-CHOICE-WINS (cf15c2c6e) each of them counts as typed, so it wins over the F1 menu's value and the menu file drops that value: a DLSS mode, frame generation or Smooth Motion picked in F1 is replaced by the launcher's at the next PLAY, though nothing was changed in the launcher.

This keeps that rule and fixes what the launcher reports as typed:

  • The launcher keeps the switches of its last PLAY (launcher.json, last_switches, written once the game started) and passes -Chosen with those whose value changed since (none for none).
  • scripts/play-d3d12.ps1 -Chosen: only those count as typed (-Typed to play-nvidia.ps1). A start by hand, without -Chosen, counts its typed switches as before.
  • An option changed in the launcher wins as a typed switch does; one turned off there (e.g. -NoDlss dropped) is chosen too, so its default beats the menu's value; unchanged options leave the menu's values standing.
  • The first PLAY after this change (or of a fresh install) has nothing to compare with: no option counts as typed and the F1 menu's values stand. A launcher option changed before that first PLAY wins from the next change on.

Tested

  • python -m unittest tests.test_leonida_launcher tests.test_win_launchers: OK, with two new tests (test_only_switches_changed_since_the_last_play_are_chosen: first PLAY, same options, changed / added / removed switch, corrupt record; test_play_command_names_the_chosen_switches). Both fail on main (no chosen_switches, no -Chosen).
  • python -m unittest tests.test_play_nvidia_menu_choice: OK (the play-nvidia.ps1 contract is unchanged).
  • End to end, scripts/play-d3d12.ps1 -DryRun -SeriesS -FrameGen 4 against a menu file with LEONIDA_FRAME_GEN=2 (MEASURED): -Chosen none: the menu's 2 stands; -Chosen FrameGen: "LEONIDA_FRAME_GEN 2 -> 4 (-FrameGen)"; without -Chosen (by hand): 2 -> 4 as on main.
  • python -I scripts/check_no_game_data.py on the changed files: clean.

GPUs tested: n/a (launcher and script logic; dry runs only)

AI-assisted: yes (implementation: Claude Opus 5.5 via Claude Code; separate read-only reviewer agent: Claude Opus, whose two notes are addressed: the record is written only once the game started, and the first-PLAY behaviour is stated above)

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, including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md (n/a: no translator change).

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5601942302 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3061). Originally posted by [TheStonedGamer](https://github.com/TheStonedGamer) on 2026-12-02T07:32:35Z. --- Claimed in the coordination issue as: LAUNCHER-CHOSEN-SWITCHES (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7338303972) Fixes #2953 Fixes #2987 ### What and why `Launcher.bat` (`tools/leonida_launcher.py`) passes every option at every start (`-Dlss`, `-FrameGen`, `-SmoothMotion`, `-SeriesS`, `-Resolution` ...). Under D3D12-MENU-LAST-CHOICE-WINS (cf15c2c6e) each of them counts as typed, so it wins over the F1 menu's value and the menu file drops that value: a DLSS mode, frame generation or Smooth Motion picked in F1 is replaced by the launcher's at the next PLAY, though nothing was changed in the launcher. This keeps that rule and fixes what the launcher reports as typed: - The launcher keeps the switches of its last PLAY (`launcher.json`, `last_switches`, written once the game started) and passes `-Chosen` with those whose value changed since (`none` for none). - `scripts/play-d3d12.ps1 -Chosen`: only those count as typed (`-Typed` to play-nvidia.ps1). A start by hand, without `-Chosen`, counts its typed switches as before. - An option changed in the launcher wins as a typed switch does; one turned off there (e.g. `-NoDlss` dropped) is chosen too, so its default beats the menu's value; unchanged options leave the menu's values standing. - The first PLAY after this change (or of a fresh install) has nothing to compare with: no option counts as typed and the F1 menu's values stand. A launcher option changed before that first PLAY wins from the next change on. ### Tested - `python -m unittest tests.test_leonida_launcher tests.test_win_launchers`: OK, with two new tests (`test_only_switches_changed_since_the_last_play_are_chosen`: first PLAY, same options, changed / added / removed switch, corrupt record; `test_play_command_names_the_chosen_switches`). Both fail on `main` (no `chosen_switches`, no `-Chosen`). - `python -m unittest tests.test_play_nvidia_menu_choice`: OK (the play-nvidia.ps1 contract is unchanged). - End to end, `scripts/play-d3d12.ps1 -DryRun -SeriesS -FrameGen 4` against a menu file with `LEONIDA_FRAME_GEN=2` (MEASURED): `-Chosen none`: the menu's 2 stands; `-Chosen FrameGen`: "LEONIDA_FRAME_GEN 2 -> 4 (-FrameGen)"; without `-Chosen` (by hand): 2 -> 4 as on `main`. - `python -I scripts/check_no_game_data.py` on the changed files: clean. GPUs tested: n/a (launcher and script logic; dry runs only) AI-assisted: yes (implementation: Claude Opus 5.5 via Claude Code; separate read-only reviewer agent: Claude Opus, whose two notes are addressed: the record is written only once the game started, and the first-PLAY behaviour is stated above) ### 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, including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md` (n/a: no translator change). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
imShangLi commented 2026-12-02 09:27:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-02T09:27:06Z.


VERIFY-3061 — Linux, Fedora 45, CPython 3.15.2, no Tkinter, no pwsh (PowerShell), no GPU device, no game files

Verdict: PASS with caveats. The change implements what it says and the two new tests are genuine (they fail on the base with exactly the missing feature and pass with the pull request); the red/green verdict is red then green. The caveats are a real over-reporting edge case in chosen_switches (turning DLSS off after it was on with a mode reports both Dlss and NoDlss as chosen, so the F1 menu drops settings the launcher did not touch — tools/leonida_launcher.py:193, effect via scripts/play-d3d12.ps1:126-131 and d3d12/scripts/play-nvidia.ps1:563-564), a description/code wording mismatch ("written once the game started" vs. written when the launch process spawns, tools/leonida_launcher.py:618-619), and the whole .ps1/menu path being unverifiable here (no PowerShell).

head 246528624c6a79c71b293232721c0de3317a5d1c ("Launcher: the last PLAY's switches are kept only once the game started"), base (GitHub base.sha) = merge base = 229d352ee38a49f3f743ead80857bc48dd18d176 (the merge of #3058). origin/main has since advanced to a917c54d and already contains 229d352e, so the pull request now sits directly on main; the diff against it is unchanged. Two commits (bc1393ef, 24652862), three files, +72/−5: tools/leonida_launcher.py (+40/−3), scripts/play-d3d12.ps1 (+9/−2), tests/test_leonida_launcher.py (+23/−0). No comments, no reviews on the pull request.

1. What it changes

Launcher.bat (tools/leonida_launcher.py) passes every option at every start (-Dlss, -FrameGen, -SmoothMotion, -SeriesS, -Resolution …). Under D3D12-MENU-LAST-CHOICE-WINS (cf15c2c6e) each counts as typed, so it wins over the F1 menu's saved value and the menu file drops that value — a DLSS mode, frame generation or Smooth Motion picked in F1 is replaced by the launcher's at the next PLAY even though nothing changed in the launcher. The pull request keeps that rule and fixes what the launcher reports as typed:

  • The launcher remembers the switch_args of its last PLAY in launcher.json as last_switches (tools/leonida_launcher.py:63), written after the launch (see below), and passes -Chosen to scripts/play-d3d12.ps1 with only the switches whose value changed since (none for none): chosen_switches (:182-193) and play_command (:204-211), called from the Play button (:611).
  • scripts/play-d3d12.ps1 takes [string]$Chosen (:83) and, when it is present, builds $launch.Typed from it instead of from all bound parameters (:125-131); only those count as typed for the F1 menu. A start by hand (no -Chosen) counts its own switches as before.

2. The claims, checked one by one

  • "each of them counts as typed, so it wins over the F1 menu's value" — true on the base: the old play-d3d12.ps1 set $launch.Typed = @($PSBoundParameters.Keys | …), i.e. every switch the launcher passed. cf15c2c6e and the $switchSettings/$chosenNow logic in play-nvidia.ps1:542-591 are the "typed wins" rule. Checked by reading the old and new play-d3d12.ps1.
  • "The launcher keeps the switches of its last PLAY (last_switches, written once the game started)" — the record exists (:63, written at :618-619, saved via save_settings). The "once the game started" wording is not what the code does: the record is written right after self.run(...) returns, i.e. as soon as the powershell launch process spawns (:618), not when the game itself starts. The comment at :616-617 says "only once it started" — the code's "it" is the launch process. So a launch that spawns powershell but then fails (a build error, a bad path, the title crashing at startup) still records the switches. In practice this is benign: if nothing is changed before the next PLAY, nothing is chosen and the untouched menu file's values stand, which is what a failed start should leave. But the description overstates the code.
  • "passes -Chosen with those whose value changed since (none for none)" — play_command adds ["-Chosen", ",".join(chosen) or "none"] (:208-209); chosen_switches compares switch_values of the current args and the parsed last (:193). Verified by the new test test_play_command_names_the_chosen_switches (the command carries -Chosen FrameGen, -Chosen none, and no -Chosen when chosen is None).
  • "scripts/play-d3d12.ps1 -Chosen: only those count as typed (-Typed to play-nvidia.ps1)" — :126-131: when -Chosen is bound, $typedHere is the parsed list, and $launch.Typed maps SeriesS→SeriesX, SmoothMotion→NoSmoothMotion, the rest unchanged. Verified by reading the script.
  • "A start by hand, without -Chosen, counts its typed switches as before" — $typedHere = @($PSBoundParameters.Keys) when -Chosen is absent (:126-128), the pre-change behaviour. Verified by reading; backward compatible.
  • "An option changed in the launcher wins; one turned off there is chosen too" — chosen_switches returns a switch present in either side whose value differs, so a switch that disappears (turned off) is chosen. Verified by test_only_switches_changed_since_the_last_play_are_chosen (changed value, turned on, turned off).
  • "The first PLAY after this change (or of a fresh install) has nothing to compare with" — chosen_switches(args, "") returns [] (an empty last yields no record) and a corrupt record ("not json") also returns [] (:185-191). Verified by the test.
  • "Fixes #2953, #2987" — both issues are open and describe exactly this symptom: #2953 "Settings in F1 menu fail to save… reverts them to what they were the last time the game booted"; #2987 "Can't choose dlss in settings… it's still game own". I fetched both (read-only). The mechanism this pull request changes is consistent with both; I cannot confirm the issues are closed without running the title.
  • The end-to-end play-d3d12.ps1 -DryRun numbers in "Tested" — not re-checked: that needs PowerShell (no pwsh here) and I have no Windows box.
  • "Both fail on main (no chosen_switches, no -Chosen)" — confirmed on the red side (see §3): the failures are AttributeError: module 'leonida_launcher' has no attribute 'chosen_switches' and TypeError: play_command() got an unexpected keyword argument 'chosen'.

3. What the tests do here

python3 -I scripts/red_green.py pr3061 --base 229d352e --no-fetch --work-dir /home/shangli/oc-workspace/gta6/rg-3061 --no-cargo (the pull request is stacked, so the base is its GitHub base 229d352e, and I passed the local ref because --no-fetch):

side tests in tests/test_leonida_launcher.py result
red (229d352e + only the PR's test hunks) 18 2 errors — test_only_switches_changed_since_the_last_play_are_chosen (AttributeError: no attribute 'chosen_switches'), test_play_command_names_the_chosen_switches (TypeError: play_command() got an unexpected keyword argument 'chosen'); 16 pass
green (24652862, the pull request head) 18 all 18 pass

Verdict: red then green — exactly the two new tests go red→green, 0 regressions, 16 pass on both sides. The red side's failures are the missing feature, not a skip or a no-op.

The pull request changes no Rust crate and no other Python test file, so the verifier ran only this file. On the head, the full launcher suite is 18/18; test_win_launchers.py (5 tests, 4 skipped) and test_play_nvidia_menu_choice.py (16 tests, all skipped) skip on Linux for lack of pwsh — the author's python -m unittest tests.test_play_nvidia_menu_choice: OK was on Windows. python3 -I -m unittest discover -s tests -p "test_docs_*.py" -v: 57/57 OK. python3 -I scripts/check_no_game_data.py tools/leonida_launcher.py scripts/play-d3d12.ps1 tests/test_leonida_launcher.py: exit 0.

4. Anything wrong, with file and line

  • Over-reporting when the DLSS mode flips between "on with a mode" and "off" — chosen_switches (tools/leonida_launcher.py:193) takes the union of the current and previous switch names, and switch_args uses different names for the same setting's on/off states (-Dlss <mode> vs -NoDlss, tools/leonida_launcher.py:143-147). So going from -Dlss performance to -NoDlss returns ["Dlss", "NoDlss"] (and the reverse too) — I verified this directly: chosen_switches(["-NoDlss"], '["-Dlss","performance"]') → ["Dlss","NoDlss"]. In play-d3d12.ps1:129-131 both pass through to $launch.Typed, and in play-nvidia.ps1 the $switchSettings entry for Dlss (:563) is a superset of the one for NoDlss (:564): Dlss names LEONIDA_RENDER_SCALE, LEONIDA_RENDER_SCALE_MIN, LEONIDA_OWN_UPSCALER, LEONIDA_FSR_UPSCALER, LEONIDA_OUTPUT in addition to LEONIDA_UPSCALE. So when the launcher turns DLSS off it only passed -NoDlss, yet the menu drops those five settings too, and they fall to the script's defaults. This is a residual of the very bug the pull request fixes, narrow to the on↔off transition (a repeated off state compares NoDlss to NoDlss and is fine), and it only over-reaches, never under-reaches — but it contradicts "only options changed since the last PLAY win". The fix would be to map -Dlss/-NoDlss (and the other paired names) to one canonical setting name before comparing, the way play-d3d12.ps1:129-131 already maps SeriesS→SeriesX and SmoothMotion→NoSmoothMotion (those two pairs happen to collapse to one setting each, so they do not over-report). I could not confirm the final runtime effect (no PowerShell, no game); what I did confirm is that the chosen set includes both names.
  • Description/code wording mismatch — "written once the game started" (pull request description, "What and why") vs. the record being written once the launch process spawns (tools/leonida_launcher.py:618-619). Benign as analysed in §2, but the description does not match the code.
  • No Depends on: #N in the pull request body, although the pull request was opened with base 229d352e (the merge of #3058) — CONTRIBUTING.md asks for Depends on: on every pull request built on another. Since main now contains 229d352e this is moot, but it was a stacked PR.
  • The new tests do not cover the DLSS on↔off pair — test_only_switches_changed_since_the_last_play_are_chosen covers a changed value, a switch turned on and a switch turned off, but only for FrameGen, Log and SmoothMotion, none of which use a paired on/off name except SmoothMotion (whose off state has no switch of its own). The Dlss/NoDlss and SeriesS/SeriesX pairs are not tested; the latter is harmless (both map to SeriesX), the former is the over-reporting above.

5. What I did not check

  • No PowerShell (pwsh): I could not run scripts/play-d3d12.ps1 or d3d12/scripts/play-nvidia.ps1, so I could not re-run the author's end-to-end -DryRun claim, nor confirm that a -Chosen list maps through $launch.Typed to the menu exactly as read. test_win_launchers.py and test_play_nvidia_menu_choice.py (the latter is the direct test of the menu logic this interacts with) both skip here.
  • No game and no GPU: the F1 menu and leonida-settings.txt live in the title; I could not check that a chosen switch really wins over the menu's saved value in a running game, nor that dropping a setting from the menu file changes the runtime outcome. The DLSS over-reporting consequence in §4 is exactly such a thing.
  • No Windows: play-d3d12.ps1 is a Windows script; I only read it.
  • No GUI: the Play button wiring, last_switches persistence across launcher restarts with a real launcher.json, and the record-on-failed-start behaviour need Tkinter and a display; none here.
  • The author's own "MEASURED" end-to-end numbers — I checked them only for internal consistency with the code, not by running them.
  • Whether #2953/#2987 are actually closed by this change — the mechanism is consistent, but only a run of the title on Windows can show the menu keeping a chosen value.
  • The other two PRs' code this is stacked on (#3056, #3058) and the Rust crates — not run; the change is confined to the launcher.
  • The pull request's GitHub discussion — there were none (0 issue comments, 0 reviews, 0 review comments); the coordination issue and the claimed items were not read beyond the pull request body's own link.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7340916664 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3061#issuecomment-7340916664). Originally posted by [imShangLi](https://github.com/imShangLi) on 2026-12-02T09:27:06Z. --- ## VERIFY-3061 — Linux, Fedora 45, CPython 3.15.2, no Tkinter, no pwsh (PowerShell), no GPU device, no game files **Verdict: PASS with caveats.** The change implements what it says and the two new tests are genuine (they fail on the base with exactly the missing feature and pass with the pull request); the red/green verdict is `red then green`. The caveats are a real over-reporting edge case in `chosen_switches` (turning DLSS off after it was on with a mode reports **both** `Dlss` and `NoDlss` as chosen, so the F1 menu drops settings the launcher did not touch — `tools/leonida_launcher.py:193`, effect via `scripts/play-d3d12.ps1:126-131` and `d3d12/scripts/play-nvidia.ps1:563-564`), a description/code wording mismatch ("written once the game started" vs. written when the launch process spawns, `tools/leonida_launcher.py:618-619`), and the whole `.ps1`/menu path being unverifiable here (no PowerShell). head `246528624c6a79c71b293232721c0de3317a5d1c` ("Launcher: the last PLAY's switches are kept only once the game started"), base (GitHub `base.sha`) = merge base = `229d352ee38a49f3f743ead80857bc48dd18d176` (the merge of #3058). `origin/main` has since advanced to `a917c54d` and already contains `229d352e`, so the pull request now sits directly on `main`; the diff against it is unchanged. Two commits (`bc1393ef`, `24652862`), three files, +72/−5: `tools/leonida_launcher.py` (+40/−3), `scripts/play-d3d12.ps1` (+9/−2), `tests/test_leonida_launcher.py` (+23/−0). No comments, no reviews on the pull request. ### 1. What it changes `Launcher.bat` (`tools/leonida_launcher.py`) passes **every** option at **every** start (`-Dlss`, `-FrameGen`, `-SmoothMotion`, `-SeriesS`, `-Resolution` …). Under `D3D12-MENU-LAST-CHOICE-WINS` (`cf15c2c6e`) each counts as *typed*, so it wins over the F1 menu's saved value and the menu file drops that value — a DLSS mode, frame generation or Smooth Motion picked in F1 is replaced by the launcher's at the next PLAY even though nothing changed in the launcher. The pull request keeps that rule and fixes what the launcher reports as typed: - The launcher remembers the `switch_args` of its last PLAY in `launcher.json` as `last_switches` (`tools/leonida_launcher.py:63`), written after the launch (see below), and passes `-Chosen` to `scripts/play-d3d12.ps1` with only the switches whose value changed since (`none` for none): `chosen_switches` (`:182-193`) and `play_command` (`:204-211`), called from the Play button (`:611`). - `scripts/play-d3d12.ps1` takes `[string]$Chosen` (`:83`) and, when it is present, builds `$launch.Typed` from it instead of from all bound parameters (`:125-131`); only those count as typed for the F1 menu. A start by hand (no `-Chosen`) counts its own switches as before. ### 2. The claims, checked one by one - **"each of them counts as typed, so it wins over the F1 menu's value"** — true on the base: the old `play-d3d12.ps1` set `$launch.Typed = @($PSBoundParameters.Keys | …)`, i.e. every switch the launcher passed. `cf15c2c6e` and the `$switchSettings`/`$chosenNow` logic in `play-nvidia.ps1:542-591` are the "typed wins" rule. Checked by reading the old and new `play-d3d12.ps1`. - **"The launcher keeps the switches of its last PLAY (`last_switches`, written once the game started)"** — the record exists (`:63`, written at `:618-619`, saved via `save_settings`). **The "once the game started" wording is not what the code does**: the record is written right after `self.run(...)` returns, i.e. as soon as the `powershell` launch process **spawns** (`:618`), not when the game itself starts. The comment at `:616-617` says "only once it started" — the code's "it" is the launch process. So a launch that spawns `powershell` but then fails (a build error, a bad path, the title crashing at startup) still records the switches. In practice this is benign: if nothing is changed before the next PLAY, nothing is chosen and the untouched menu file's values stand, which is what a failed start should leave. But the description overstates the code. - **"passes `-Chosen` with those whose value changed since (`none` for none)"** — `play_command` adds `["-Chosen", ",".join(chosen) or "none"]` (`:208-209`); `chosen_switches` compares `switch_values` of the current `args` and the parsed `last` (`:193`). Verified by the new test `test_play_command_names_the_chosen_switches` (the command carries `-Chosen FrameGen`, `-Chosen none`, and no `-Chosen` when `chosen` is `None`). - **"`scripts/play-d3d12.ps1 -Chosen`: only those count as typed (`-Typed` to play-nvidia.ps1)"** — `:126-131`: when `-Chosen` is bound, `$typedHere` is the parsed list, and `$launch.Typed` maps `SeriesS`→`SeriesX`, `SmoothMotion`→`NoSmoothMotion`, the rest unchanged. Verified by reading the script. - **"A start by hand, without `-Chosen`, counts its typed switches as before"** — `$typedHere = @($PSBoundParameters.Keys)` when `-Chosen` is absent (`:126-128`), the pre-change behaviour. Verified by reading; backward compatible. - **"An option changed in the launcher wins; one turned off there is chosen too"** — `chosen_switches` returns a switch present in either side whose value differs, so a switch that disappears (turned off) is chosen. Verified by `test_only_switches_changed_since_the_last_play_are_chosen` (changed value, turned on, turned off). - **"The first PLAY after this change (or of a fresh install) has nothing to compare with"** — `chosen_switches(args, "")` returns `[]` (an empty `last` yields no record) and a corrupt record (`"not json"`) also returns `[]` (`:185-191`). Verified by the test. - **"Fixes #2953, #2987"** — both issues are open and describe exactly this symptom: #2953 "Settings in F1 menu fail to save… reverts them to what they were the last time the game booted"; #2987 "Can't choose dlss in settings… it's still game own". I fetched both (read-only). The mechanism this pull request changes is consistent with both; I cannot confirm the issues are closed without running the title. - **The end-to-end `play-d3d12.ps1 -DryRun` numbers in "Tested"** — not re-checked: that needs PowerShell (no `pwsh` here) and I have no Windows box. - **"Both fail on `main` (no `chosen_switches`, no `-Chosen`)"** — confirmed on the red side (see §3): the failures are `AttributeError: module 'leonida_launcher' has no attribute 'chosen_switches'` and `TypeError: play_command() got an unexpected keyword argument 'chosen'`. ### 3. What the tests do here `python3 -I scripts/red_green.py pr3061 --base 229d352e --no-fetch --work-dir /home/shangli/oc-workspace/gta6/rg-3061 --no-cargo` (the pull request is stacked, so the base is its GitHub base `229d352e`, and I passed the local ref because `--no-fetch`): | side | tests in `tests/test_leonida_launcher.py` | result | |---|---|---| | red (`229d352e` + only the PR's test hunks) | 18 | **2 errors** — `test_only_switches_changed_since_the_last_play_are_chosen` (`AttributeError: no attribute 'chosen_switches'`), `test_play_command_names_the_chosen_switches` (`TypeError: play_command() got an unexpected keyword argument 'chosen'`); 16 pass | | green (`24652862`, the pull request head) | 18 | all 18 pass | Verdict: **`red then green`** — exactly the two new tests go red→green, 0 regressions, 16 pass on both sides. The red side's failures are the missing feature, not a skip or a no-op. The pull request changes no Rust crate and no other Python test file, so the verifier ran only this file. On the head, the full launcher suite is 18/18; `test_win_launchers.py` (5 tests, 4 skipped) and `test_play_nvidia_menu_choice.py` (16 tests, all skipped) skip on Linux for lack of `pwsh` — the author's `python -m unittest tests.test_play_nvidia_menu_choice: OK` was on Windows. `python3 -I -m unittest discover -s tests -p "test_docs_*.py" -v`: 57/57 OK. `python3 -I scripts/check_no_game_data.py tools/leonida_launcher.py scripts/play-d3d12.ps1 tests/test_leonida_launcher.py`: exit 0. ### 4. Anything wrong, with file and line - **Over-reporting when the DLSS mode flips between "on with a mode" and "off"** — `chosen_switches` (`tools/leonida_launcher.py:193`) takes the union of the current and previous switch names, and `switch_args` uses **different** names for the same setting's on/off states (`-Dlss <mode>` vs `-NoDlss`, `tools/leonida_launcher.py:143-147`). So going from `-Dlss performance` to `-NoDlss` returns `["Dlss", "NoDlss"]` (and the reverse too) — I verified this directly: `chosen_switches(["-NoDlss"], '["-Dlss","performance"]')` → `["Dlss","NoDlss"]`. In `play-d3d12.ps1:129-131` both pass through to `$launch.Typed`, and in `play-nvidia.ps1` the `$switchSettings` entry for `Dlss` (`:563`) is a **superset** of the one for `NoDlss` (`:564`): `Dlss` names `LEONIDA_RENDER_SCALE`, `LEONIDA_RENDER_SCALE_MIN`, `LEONIDA_OWN_UPSCALER`, `LEONIDA_FSR_UPSCALER`, `LEONIDA_OUTPUT` in addition to `LEONIDA_UPSCALE`. So when the launcher turns DLSS off it only passed `-NoDlss`, yet the menu drops those five settings too, and they fall to the script's defaults. This is a residual of the very bug the pull request fixes, narrow to the on↔off transition (a repeated off state compares `NoDlss` to `NoDlss` and is fine), and it only over-reaches, never under-reaches — but it contradicts "only options changed since the last PLAY win". The fix would be to map `-Dlss`/`-NoDlss` (and the other paired names) to one canonical setting name before comparing, the way `play-d3d12.ps1:129-131` already maps `SeriesS`→`SeriesX` and `SmoothMotion`→`NoSmoothMotion` (those two pairs happen to collapse to one setting each, so they do **not** over-report). I could not confirm the final runtime effect (no PowerShell, no game); what I did confirm is that the chosen set includes both names. - **Description/code wording mismatch** — "written once the game started" (pull request description, "What and why") vs. the record being written once the launch process spawns (`tools/leonida_launcher.py:618-619`). Benign as analysed in §2, but the description does not match the code. - **No `Depends on: #N` in the pull request body**, although the pull request was opened with base `229d352e` (the merge of #3058) — `CONTRIBUTING.md` asks for `Depends on:` on every pull request built on another. Since `main` now contains `229d352e` this is moot, but it was a stacked PR. - **The new tests do not cover the DLSS on↔off pair** — `test_only_switches_changed_since_the_last_play_are_chosen` covers a changed value, a switch turned on and a switch turned off, but only for `FrameGen`, `Log` and `SmoothMotion`, none of which use a paired on/off name except SmoothMotion (whose off state has no switch of its own). The `Dlss`/`NoDlss` and `SeriesS`/`SeriesX` pairs are not tested; the latter is harmless (both map to `SeriesX`), the former is the over-reporting above. ### 5. What I did not check - **No PowerShell (`pwsh`)**: I could not run `scripts/play-d3d12.ps1` or `d3d12/scripts/play-nvidia.ps1`, so I could not re-run the author's end-to-end `-DryRun` claim, nor confirm that a `-Chosen` list maps through `$launch.Typed` to the menu exactly as read. `test_win_launchers.py` and `test_play_nvidia_menu_choice.py` (the latter is the direct test of the menu logic this interacts with) both skip here. - **No game and no GPU**: the F1 menu and `leonida-settings.txt` live in the title; I could not check that a chosen switch really wins over the menu's saved value in a running game, nor that dropping a setting from the menu file changes the runtime outcome. The DLSS over-reporting consequence in §4 is exactly such a thing. - **No Windows**: `play-d3d12.ps1` is a Windows script; I only read it. - **No GUI**: the Play button wiring, `last_switches` persistence across launcher restarts with a real `launcher.json`, and the record-on-failed-start behaviour need Tkinter and a display; none here. - **The author's own "MEASURED" end-to-end numbers** — I checked them only for internal consistency with the code, not by running them. - **Whether #2953/#2987 are actually closed by this change** — the mechanism is consistent, but only a run of the title on Windows can show the menu keeping a chosen value. - **The other two PRs' code this is stacked on** (`#3056`, `#3058`) and the Rust crates — not run; the change is confined to the launcher. - **The pull request's GitHub discussion** — there were none (0 issue comments, 0 reviews, 0 review comments); the coordination issue and the claimed items were not read beyond the pull request body's own link.
MoonEyes commented 2026-12-02 15:09:25 +00:00 (Migrated from github.com)

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


Merging. Head 246528624 merges cleanly with main 83046a713 and does not force a rebase of #2566. Third-party verification by MoonEyes' agent (https://github.com/ProjectLeonida/mandy/pull/3061#issuecomment-7340916664): targeted test red before the fix and green after, on head 246528624c; CI green including no-game-data; no open review or question. AI-assisted (Claude Code). Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7349826052 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3061#issuecomment-7349826052). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T15:09:25Z. --- Merging. Head `246528624` merges cleanly with `main` `83046a713` and does not force a rebase of #2566. Third-party verification by MoonEyes' agent (https://github.com/ProjectLeonida/mandy/pull/3061#issuecomment-7340916664): targeted test red before the fix and green after, on head 246528624c6a79c71b293232721c0de3317a5d1c; CI green including no-game-data; no open review or question. AI-assisted (Claude Code). Merged by MoonEyes. AI-assisted (Claude Code).
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!3061
No description provided.