Preserve the FSR 3 SDK path through F1 restart #3214

Closed
ubiquitarianism wants to merge 4 commits from upstream-pr/3214 into main
ubiquitarianism commented 2026-12-02 19:40:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-12-02T19:40:14Z.


Claimed as D3D12-FSR3-SDK-RESTART in the coordination issue.

What and why

If FSR 3 frame generation starts disabled, the launcher can clear a custom LEONIDA_FIDELITYFX_DIR during environment export. When F1 saves and enables FSR 3, the restarted launcher can then miss the installed SDK and leave frame generation off. SDK validation also bypassed directory overrides supplied through -More.

  • Resolve the effective directory from the merged settings, then -FidelityFxDir and the inherited environment. Use the default SDK directory when FSR 3 is requested and no custom directory is selected. An explicit empty -More or saved setting clears the custom directory.
  • Resolve relative paths from the first launch's working directory and export the result even when FSR 3 starts off. F1 inherits it through the runtime environment, keeping SDK paths out of the generated PowerShell command.
  • Check both required DLLs as literal file paths so brackets in directory names work and directories named like the DLLs fail validation.

This addresses the synthetic FSR 3 SDK restart reproduction. The reporter's settings are unknown. The Series X F1 DLSS work has a separate claim.

Tested

  • With the original launcher, all four original regression cases failed. With daa480890, the five extended filesystem and restart cases failed. With 593777235, both explicit-clear cases failed.
  • On 2229cfedd, all seven regression subcases passed, as did all 17 tests in tests/test_play_nvidia_menu_choice.py and all six in tests/test_win_launchers.py.
  • Clean-room scan and git diff --check passed. Git merge checks against #3209 and #3210 were clean.

GPUs tested None. The Windows PowerShell tests use a stub runtime and synthetic files.

AI-assisted Codex GPT-6.2 Sol for implementation, independent read-only review, and review fixes.

Checklist

  • Based on current main at b41763227.
  • Single topic.
  • Clean-room checked.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5613427211 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3214). Originally posted by [ubiquitarianism](https://github.com/ubiquitarianism) on 2026-12-02T19:40:14Z. --- Claimed as [D3D12-FSR3-SDK-RESTART](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7356243913) in the coordination issue. ### What and why If FSR 3 frame generation starts disabled, the launcher can clear a custom `LEONIDA_FIDELITYFX_DIR` during environment export. When F1 saves and enables FSR 3, the restarted launcher can then miss the installed SDK and leave frame generation off. SDK validation also bypassed directory overrides supplied through `-More`. - Resolve the effective directory from the merged settings, then `-FidelityFxDir` and the inherited environment. Use the default SDK directory when FSR 3 is requested and no custom directory is selected. An explicit empty `-More` or saved setting clears the custom directory. - Resolve relative paths from the first launch's working directory and export the result even when FSR 3 starts off. F1 inherits it through the runtime environment, keeping SDK paths out of the generated PowerShell command. - Check both required DLLs as literal file paths so brackets in directory names work and directories named like the DLLs fail validation. This addresses the synthetic FSR 3 SDK restart reproduction. The reporter's settings are unknown. The Series X F1 DLSS work has a separate claim. ### Tested - With the original launcher, all four original regression cases failed. With `daa480890`, the five extended filesystem and restart cases failed. With `593777235`, both explicit-clear cases failed. - On `2229cfedd`, all seven regression subcases passed, as did all 17 tests in `tests/test_play_nvidia_menu_choice.py` and all six in `tests/test_win_launchers.py`. - Clean-room scan and `git diff --check` passed. Git merge checks against #3209 and #3210 were clean. **GPUs tested** None. The Windows PowerShell tests use a stub runtime and synthetic files. **AI-assisted** Codex GPT-6.2 Sol for implementation, independent read-only review, and review fixes. ### Checklist - [x] Based on current `main` at `b41763227`. - [x] Single topic. - [x] Clean-room checked.
merzleckeier commented 2026-12-02 19:49:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T19:49:44Z.


Independent regression and merge check on 2229cfedd. I ran the seven FSR SDK restart subcases with PowerShell 7.7.0 on Linux. In the scratch harness I enabled the Windows-gated fixture and used pwsh for its powershell.exe command. The launcher source, inputs, and assertions were the same for the control and the PR, apart from the launcher revision under test.

Six subcases failed with main (b41763227), and all seven passed on this head. Both trial merges were clean, and all seven assertions also passed with the launcher from each merged tree separately: #3209 at a3e0db68 and #3210 at 917cb9e32. This exercises the PowerShell restart path with synthetic DLL files and a stub runtime.

Windows CI follow-up. The native check log identifies three failures at tests/test_play_nvidia_menu_choice.py:254. PowerShell returned the full runneradmin directory name while the Python fixture expected RUNNER~1. The relevant records show frame generation off before restart and on after it. The assertion should compare the directories by identity, for example Path(actual_sdk).samefile(expected_sdk) when an SDK path is expected. Keep the explicit None and frame-generation assertions. I verified samefile() with a generated short-name alias using Windows CPython under Wine.

AI-assisted: OpenAI Codex (GPT-6).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7356788427 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3214#issuecomment-7356788427). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T19:49:44Z. --- Independent regression and merge check on `2229cfedd`. I ran the seven FSR SDK restart subcases with PowerShell 7.7.0 on Linux. In the scratch harness I enabled the Windows-gated fixture and used `pwsh` for its `powershell.exe` command. The launcher source, inputs, and assertions were the same for the control and the PR, apart from the launcher revision under test. Six subcases failed with `main` (`b41763227`), and all seven passed on this head. Both trial merges were clean, and all seven assertions also passed with the launcher from each merged tree separately: #3209 at `a3e0db68` and #3210 at `917cb9e32`. This exercises the PowerShell restart path with synthetic DLL files and a stub runtime. **Windows CI follow-up.** The [native `check` log](https://github.com/ProjectLeonida/mandy/actions/runs/46954596319/job/143725325009#step:7:1) identifies three failures at `tests/test_play_nvidia_menu_choice.py:254`. PowerShell returned the full `runneradmin` directory name while the Python fixture expected `RUNNER~1`. The relevant records show frame generation off before restart and on after it. The assertion should compare the directories by identity, for example `Path(actual_sdk).samefile(expected_sdk)` when an SDK path is expected. Keep the explicit `None` and frame-generation assertions. I verified `samefile()` with a generated short-name alias using Windows CPython under Wine. AI-assisted: OpenAI Codex (GPT-6).
fiestorra commented 2026-12-02 20:49:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T20:49:26Z.


VERIFY-3214 — Windows nativo: red then green en la elección del menú F1

Head (this PR)
Merge base b41763227 = current main
Merged onto main — clean, no overlap

Ran (native Windows, real PowerShell)

python -I tests/test_play_nvidia_menu_choice.py      Ran 17 tests in 18.3s — OK
d3d12/scripts/play-nvidia.ps1 parses with 0 errors

Negative control (play-nvidia.ps1 reverted to main, the PR's tests kept):

FAIL: test_fsr_sdk_path_survives_the_menus_restart   (x3 subtests)
Ran 17 tests — FAILED

The change reads right, and the default is not lost: the moved block keeps $settings.LEONIDA_FIDELITYFX_DIR in the runtime's environment even with FSR off, resolves a relative directory to an absolute one with GetUnresolvedProviderPathFromPSPath (which does not require the folder to exist, so a typo still gets a clean message later), and an explicitly empty -More / saved value clears an inherited $env:LEONIDA_FIDELITYFX_DIR (Remove). amd-sdk\FidelityFX\bin is still the fallback at line 697 for the FSR-on case, so moving the block did not drop it.

One case the test does not cover, worth a look: with FSR on and no explicit directory, line 697 uses the default for the file check but never writes it into $settings, so a restarted runtime still relies on its own default relative to the runtime's working directory — which is the thing this PR is about. It is the pre-existing behaviour rather than a regression, but it is the same class of bug.

What I could not test

  • A real restart with the F1 menu: the test launches the script twice with a synthetic runtime and compares the SDK path and frame-generation flag.
  • FSR 3 itself: no AMD SDK files here, no game run.

Verdict: red then green on native Windows.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358374022 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3214#issuecomment-7358374022). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T20:49:26Z. --- ## VERIFY-3214 — Windows nativo: `red then green` en la elección del menú F1 | | | |---|---| | Head | `(this PR)` | | Merge base | `b41763227` = current `main` | | Merged onto | `main` — clean, no overlap | **Ran (native Windows, real PowerShell)** ``` python -I tests/test_play_nvidia_menu_choice.py Ran 17 tests in 18.3s — OK d3d12/scripts/play-nvidia.ps1 parses with 0 errors ``` **Negative control** (`play-nvidia.ps1` reverted to `main`, the PR's tests kept): ``` FAIL: test_fsr_sdk_path_survives_the_menus_restart (x3 subtests) Ran 17 tests — FAILED ``` **The change reads right, and the default is not lost**: the moved block keeps `$settings.LEONIDA_FIDELITYFX_DIR` in the runtime's environment even with FSR off, resolves a **relative** directory to an absolute one with `GetUnresolvedProviderPathFromPSPath` (which does not require the folder to exist, so a typo still gets a clean message later), and an explicitly empty `-More` / saved value clears an inherited `$env:LEONIDA_FIDELITYFX_DIR` (`Remove`). **`amd-sdk\FidelityFX\bin` is still the fallback** at line 697 for the FSR-on case, so moving the block did not drop it. **One case the test does not cover, worth a look**: with FSR **on** and **no** explicit directory, line 697 uses the default for the file check but never writes it into `$settings`, so a restarted runtime still relies on its own default relative to the runtime's working directory — which is the thing this PR is about. It is the pre-existing behaviour rather than a regression, but it is the same class of bug. ## What I could not test - **A real restart with the F1 menu**: the test launches the script twice with a synthetic runtime and compares the SDK path and frame-generation flag. - **FSR 3 itself**: no AMD SDK files here, no game run. Verdict: **red then green** on native Windows. Written with an AI assistant.
lixonik commented 2026-12-02 21:03:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T21:03:13Z.


Verified PR #3214 (2229cfedd) merged cleanly onto main (8a9235d02) on native Windows 10 x64:

  • Clean-room check: python -I scripts/check_no_game_data.py PASS.
  • Green (merged 2229cfedd onto 8a9235d02): python -I tests/test_play_nvidia_menu_choice.py -- 17 tests, OK (19.14 s, including test_fsr_sdk_path_survives_the_menus_restart across all subtests).
  • Red -> Green proof (main d3d12/scripts/play-nvidia.ps1 + PR tests): test_fsr_sdk_path_survives_the_menus_restart fails across the inherited, -FidelityFxDir, and -More @{LEONIDA_FIDELITYFX_DIR=...} subtests.

Verdict: PASS (native Windows PowerShell/Python tests; no game launch).

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358720540 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3214#issuecomment-7358720540). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T21:03:13Z. --- Verified PR #3214 (`2229cfedd`) merged cleanly onto `main` (`8a9235d02`) on native Windows 10 x64: - **Clean-room check:** `python -I scripts/check_no_game_data.py` PASS. - **Green (merged `2229cfedd` onto `8a9235d02`):** `python -I tests/test_play_nvidia_menu_choice.py` -- **17 tests, OK** (19.14 s, including `test_fsr_sdk_path_survives_the_menus_restart` across all subtests). - **Red -> Green proof (`main` `d3d12/scripts/play-nvidia.ps1` + PR tests):** `test_fsr_sdk_path_survives_the_menus_restart` fails across the inherited, `-FidelityFxDir`, and `-More @{LEONIDA_FIDELITYFX_DIR=...}` subtests. Verdict: **PASS** (native Windows PowerShell/Python tests; no game launch). AI-assisted: yes (Antigravity -- Gemini 4 Neon).
MoonEyes commented 2026-12-02 22:00:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T22:00:18Z.


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360087853 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3214#issuecomment-7360087853). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T22:00:18Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
fiestorra commented 2026-12-03 02:08:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T02:08:45Z.


A rebase and nothing else: the conflict is one file, and the two intents do not overlap

Verified the branch against the current main (d15e048a7, after #3182):

d3d12/scripts/play-nvidia.ps1         | 27 ++++++++----
tests/test_play_nvidia_menu_choice.py | 70 ++++++++++++++++++++++++++++

What it does, from its own diff: an explicit SDK directory stays in the runtime's environment even with FSR off; relative paths are resolved here, in the script's working directory, rather than wherever the launcher happens to be; and an empty -More or a saved value clears the inherited LEONIDA_FIDELITYFX_DIR — a path-resolution change with 70 lines of tests behind it.

And why the conflict is mechanical: #3182 replaced the launcher; this replaces how one of the paths among its settings is resolved. The two do not overlap — play-nvidia.ps1's hunk is about $settings, $menu and $env:LEONIDA_FIDELITYFX_DIR, and none of those is the launcher the rewrite changed.

So a rebase onto d15e048a7 should apply with at most one hunk to look at, and tests/test_play_nvidia_menu_choice.py will tell you if it did.

It is not redundant, unlike #3192 — I checked that one too, and it landed inside #3182 whole, test class included.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7365135031 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3214#issuecomment-7365135031). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T02:08:45Z. --- ## A rebase and nothing else: the conflict is one file, and the two intents do not overlap **Verified the branch against the current `main` (`d15e048a7`, after `#3182`)**: ``` d3d12/scripts/play-nvidia.ps1 | 27 ++++++++---- tests/test_play_nvidia_menu_choice.py | 70 ++++++++++++++++++++++++++++ ``` **What it does, from its own diff**: **an explicit SDK directory stays in the runtime's environment even with FSR off**; **relative paths are resolved here, in the script's working directory, rather than wherever the launcher happens to be**; **and an empty `-More` or a saved value clears the inherited `LEONIDA_FIDELITYFX_DIR`** — **a path-resolution change with 70 lines of tests behind it.** **And why the conflict is mechanical**: **`#3182` replaced the launcher; this replaces how one of the paths among its settings is resolved.** **The two do not overlap** — **`play-nvidia.ps1`'s hunk is about `$settings`, `$menu` and `$env:LEONIDA_FIDELITYFX_DIR`**, **and none of those is the launcher the rewrite changed.** **So a rebase onto `d15e048a7` should apply with at most one hunk to look at**, **and `tests/test_play_nvidia_menu_choice.py` will tell you if it did.** **It is not redundant, unlike `#3192`** — **I checked that one too, and it landed inside `#3182` whole, test class included.**
merzleckeier commented 2026-12-03 09:51:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T09:51:50Z.


Rebase check for 2229cfed against d9b618f1: I resolved the single play-nvidia.ps1 conflict locally, keeping current main’s ray-tracing comment and this PR’s path-handling block. The combined launcher still loses a relative SDK path passed via -More. Main now serializes that table into LEONIDA_MENU_ARGS, so SAVE AND RESTART replays the relative value from the new working directory and overrides the absolute path the first launch exported.

PowerShell 7.7 with synthetic SDK files and a stub runtime: the old PR head kept the SDK and enabled FSR on restart. The combined launcher resolved ./SDK files in the wrong directory and left FSR off. In a local control I left the SDK key out of the replayed -More while retaining the other entries. The relative SDK, typed path, inherited path and explicit-clear cases all behaved as intended. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7374381892 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3214#issuecomment-7374381892). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T09:51:50Z. --- Rebase check for `2229cfed` against `d9b618f1`: I resolved the single `play-nvidia.ps1` conflict locally, keeping current main’s ray-tracing comment and this PR’s path-handling block. The combined launcher still loses a relative SDK path passed via `-More`. Main now serializes that table into `LEONIDA_MENU_ARGS`, so SAVE AND RESTART replays the relative value from the new working directory and overrides the absolute path the first launch exported. PowerShell 7.7 with synthetic SDK files and a stub runtime: the old PR head kept the SDK and enabled FSR on restart. The combined launcher resolved `./SDK files` in the wrong directory and left FSR off. In a local control I left the SDK key out of the replayed `-More` while retaining the other entries. The relative SDK, typed path, inherited path and explicit-clear cases all behaved as intended. AI-assisted with OpenAI Codex.
MoonEyes commented 2026-12-03 18:03:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T18:03:20Z.


Thanks for the work on this. This pull request has a merge conflict with the current main and has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latest main into your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7387524950 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3214#issuecomment-7387524950). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T18:03:20Z. --- Thanks for the work on this. This pull request has a merge conflict with the current `main` and has had no new commit, comment or review for more than 5 hours, so I am closing it to keep the list of open pull requests manageable. This is not a judgement of the change. Whenever you like, merge the latest `main` into your branch, resolve the conflict, and reopen it (or open a new pull request that links this one). Please re-run the relevant tests on the new head; a reviewer will look at it when time allows, with no guarantee of timing or outcome. --- _Generated by [Claude Code](https://claude.ai/code)_

Pull request closed

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!3214
No description provided.