d3d12 play-nvidia: typed SDK and glyph folders are made whole from the caller's folder (D3D12-LAUNCHER-RELATIVE-DIRS) #3240

Merged
LouisRiverstone merged 2 commits from upstream-pr/3240 into main 2026-12-03 15:49:54 +00:00
LouisRiverstone commented 2026-12-02 21:59:03 +00:00 (Migrated from github.com)

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


Claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7359960834 (D3D12-LAUNCHER-RELATIVE-DIRS).

Why

play-nvidia.ps1 makes only -Exe absolute (:110). The runtime starts after Push-Location $root, and the F1 menu's SAVE AND RESTART re-runs the script from there with LEONIDA_MENU_ARGS. So a relative folder typed for this start pointed under d3d12\ in two places:

  • -DlssDir and -StreamlineDir became a relative LEONIDA_DLSS_DIR and LEONIDA_STREAMLINE_DIR, read by the runtime from $root. This happened even on the first start.
  • -DlssDir, -StreamlineDir, -FidelityFxDir (and -PcGlyphs once #3233 replays it) were replayed on restart as typed.

What changed

  • d3d12/scripts/play-nvidia.ps1: right after -Exe is resolved, each of the four folders, if typed, is made whole against the caller's location with GetUnresolvedProviderPathFromPSPath. A folder that does not exist yet is still made whole, and ~ and PSDrive paths become real folder paths. Both the variable and $PSBoundParameters are updated, so the runtime and the restart get the same path. A path on a drive that does not exist stays as typed, so the later checks still name it.
  • tests/test_win_launchers.py: test_nvidia_relative_folders_are_made_whole_from_the_callers_folder makes a dry run from a separate caller folder whose name has an apostrophe. It checks the two runtime settings and the three replayed switches.

The edit does not overlap #3233's hunks (its line :742 and its test, which sits at a different place in the file), so the two merge in either order.

Verification (Windows 11, Windows PowerShell 5.1, Python 3.11; no game files, no GPU needed)

  • Red/green by hand: with only the .ps1 change reverted, the new test fails (LEONIDA_DLSS_DIR is sdk\dlss). With the change, it passes.
  • python -I tests/test_win_launchers.py OK; tests/test_play_nvidia_menu_choice.py OK.
  • Ran a dry run with -DlssDir 'Q:\nope' (a drive that does not exist): the value is kept as typed and the script does not throw.
  • python -I scripts/check_no_game_data.py on both files: exit 0. The .ps1 stays CRLF (1010/1010 lines).

Folders taken from LEONIDA_DLSS_DIR, LEONIDA_STREAMLINE_DIR or LEONIDA_FIDELITYFX_DIR in the environment are not changed. They reach the runtime and every restart unchanged, as before.

AI assistance

AI-assisted: written with Claude Code (Claude Opus 5.5). It was reviewed by a separate read-only reviewer agent (Claude Opus 5.5), which checked scoping in PowerShell 5.1 and pwsh, the effect on $PSBoundParameters readers, edge cases (UNC, ~, wildcards, PSDrives) and line endings, and found nothing blocking. Its one minor note, that a drive that does not exist threw, is handled.

The d3d12 (windows-latest) job fails on main until #3237 merges (E0599 in leonida-lua); this PR touches no Rust.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5615444095 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3240). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-12-02T21:59:03Z. --- Claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7359960834 (D3D12-LAUNCHER-RELATIVE-DIRS). ## Why `play-nvidia.ps1` makes only `-Exe` absolute (`:110`). The runtime starts after `Push-Location $root`, and the F1 menu's SAVE AND RESTART re-runs the script from there with `LEONIDA_MENU_ARGS`. So a relative folder typed for this start pointed under `d3d12\` in two places: - `-DlssDir` and `-StreamlineDir` became a relative `LEONIDA_DLSS_DIR` and `LEONIDA_STREAMLINE_DIR`, read by the runtime from `$root`. This happened even on the first start. - `-DlssDir`, `-StreamlineDir`, `-FidelityFxDir` (and `-PcGlyphs` once #3233 replays it) were replayed on restart as typed. ## What changed - `d3d12/scripts/play-nvidia.ps1`: right after `-Exe` is resolved, each of the four folders, if typed, is made whole against the caller's location with `GetUnresolvedProviderPathFromPSPath`. A folder that does not exist yet is still made whole, and `~` and PSDrive paths become real folder paths. Both the variable and `$PSBoundParameters` are updated, so the runtime and the restart get the same path. A path on a drive that does not exist stays as typed, so the later checks still name it. - `tests/test_win_launchers.py`: `test_nvidia_relative_folders_are_made_whole_from_the_callers_folder` makes a dry run from a separate caller folder whose name has an apostrophe. It checks the two runtime settings and the three replayed switches. The edit does not overlap #3233's hunks (its line `:742` and its test, which sits at a different place in the file), so the two merge in either order. ## Verification (Windows 11, Windows PowerShell 5.1, Python 3.11; no game files, no GPU needed) - Red/green by hand: with only the `.ps1` change reverted, the new test fails (`LEONIDA_DLSS_DIR` is `sdk\dlss`). With the change, it passes. - `python -I tests/test_win_launchers.py` OK; `tests/test_play_nvidia_menu_choice.py` OK. - Ran a dry run with `-DlssDir 'Q:\nope'` (a drive that does not exist): the value is kept as typed and the script does not throw. - `python -I scripts/check_no_game_data.py` on both files: exit 0. The `.ps1` stays CRLF (1010/1010 lines). Folders taken from `LEONIDA_DLSS_DIR`, `LEONIDA_STREAMLINE_DIR` or `LEONIDA_FIDELITYFX_DIR` in the environment are not changed. They reach the runtime and every restart unchanged, as before. ## AI assistance AI-assisted: written with Claude Code (Claude Opus 5.5). It was reviewed by a separate read-only reviewer agent (Claude Opus 5.5), which checked scoping in PowerShell 5.1 and pwsh, the effect on `$PSBoundParameters` readers, edge cases (UNC, `~`, wildcards, PSDrives) and line endings, and found nothing blocking. Its one minor note, that a drive that does not exist threw, is handled. The `d3d12 (windows-latest)` job fails on `main` until #3237 merges (E0599 in `leonida-lua`); this PR touches no Rust. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
merzleckeier commented 2026-12-02 22:01:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T22:01:14Z.

Review: COMMENTED


Reviewed 019d8d602 on f3865cae8. With Linux PowerShell 7.7.0 and synthetic files, the new test fails against the old launcher (LEONIDA_DLSS_DIR is still sdk\dlss) and passes with this PR. The launcher suite passed 5 tests with 5 Windows-only skips.

I also combined this with #3233 at 9f84a4498 and reran the launcher suite (6 passed, 5 Windows-only skips). In a separate round trip, I launched a dry run from a caller directory whose name contains an apostrophe with -PcGlyphs keyboard/custom, then passed the emitted LEONIDA_MENU_ARGS unchanged to another PowerShell process started from the runtime root. The stub received the exact absolute caller path and MenuRestart=true. This verifies the two changes work together for the relative glyph case.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6159798123 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3240#pullrequestreview-6159798123). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T22:01:14Z. **Review:** COMMENTED --- Reviewed `019d8d602` on `f3865cae8`. With Linux PowerShell 7.7.0 and synthetic files, the new test fails against the old launcher (`LEONIDA_DLSS_DIR` is still `sdk\dlss`) and passes with this PR. The launcher suite passed 5 tests with 5 Windows-only skips. I also combined this with #3233 at `9f84a4498` and reran the launcher suite (6 passed, 5 Windows-only skips). In a separate round trip, I launched a dry run from a caller directory whose name contains an apostrophe with `-PcGlyphs keyboard/custom`, then passed the emitted `LEONIDA_MENU_ARGS` unchanged to another PowerShell process started from the runtime root. The stub received the exact absolute caller path and `MenuRestart=true`. This verifies the two changes work together for the relative glyph case.
LouisRiverstone commented 2026-12-02 22:19:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-12-02T22:19:08Z.


The check job failed on the new test, not on the launcher. The runner's TEMP is in 8.3 form (RUNNER~1), while PowerShell's location spells the long name (runneradmin), so the expected paths in the test did not match. The launcher output was right: LEONIDA_DLSS_DIR and the replayed switches were absolute. The test now builds its expected paths from the temporary folder's real long path. I reproduced it locally with a TEMP given as LONGFO~1: the old test fails the way CI did, and the new one passes and still fails against main's launcher.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360527145 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3240#issuecomment-7360527145). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-12-02T22:19:08Z. --- The `check` job failed on the new test, not on the launcher. The runner's `TEMP` is in 8.3 form (`RUNNER~1`), while PowerShell's location spells the long name (`runneradmin`), so the expected paths in the test did not match. The launcher output was right: `LEONIDA_DLSS_DIR` and the replayed switches were absolute. The test now builds its expected paths from the temporary folder's real long path. I reproduced it locally with a `TEMP` given as `LONGFO~1`: the old test fails the way CI did, and the new one passes and still fails against `main`'s launcher.
LouisRiverstone commented 2026-12-02 22:24:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-12-02T22:24:03Z.


Rewrote the branch's commits without a co-author trailer, so the head SHA changed (now 3de2d3604). The tree is identical to the reviewed one.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360640160 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3240#issuecomment-7360640160). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-12-02T22:24:03Z. --- Rewrote the branch's commits without a co-author trailer, so the head SHA changed (now `3de2d3604`). The tree is identical to the reviewed one.
fiestorra commented 2026-12-02 23:00:16 +00:00 (Migrated from github.com)

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


VERIFY-3240 — Windows nativo: los tests pasan, y el caso que arregla no existe en esta máquina, medido

Own commit 3de2d3604 — tests/test_win_launchers.py, +2/−1
Merge base recent (f3865cae8 family)

Ran

python -I tests/test_win_launchers.py      Ran 10 tests — OK

The change, in full:

-            root = Path(td)
+            # The long name: a TEMP given in 8.3 form (RUNNER~1 on the CI) is what PowerShell's location spells out.
+            root = Path(os.path.realpath(td))

No control is possible here, and I measured why: earlier tonight I probed this machine's TEMP with GetShortPathNameW — C:\Users\Isegurav\AppData\Local\Temp has no 8.3 spelling (the short form is the same string), so realpath(td) == td and the changed line is a no-op on this host. The case it fixes only appears where the temp directory has a RUNNER~1 name — GitHub's Windows runners. red not constructible here is the honest verdict, not a pass I can vouch for.

Why the fix is right anyway: it is the same class as #3231 (which I verified in the same way tonight) — a test that compares a path PowerShell printed against a path Python built, where the two spellings differ only by 8.3 expansion. realpath is the one that resolves it.

What I could not test: the CI runner itself. A test that cannot fail on the machine where it is verified still protects the machine where it does — that is what this one buys, and it should say so in its own comment (it does).

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361438377 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3240#issuecomment-7361438377). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T23:00:16Z. --- ## VERIFY-3240 — Windows nativo: los tests pasan, y **el caso que arregla no existe en esta máquina**, medido | | | |---|---| | Own commit | `3de2d3604` — `tests/test_win_launchers.py`, +2/−1 | | Merge base | recent (`f3865cae8` family) | **Ran** ``` python -I tests/test_win_launchers.py Ran 10 tests — OK ``` **The change, in full**: ```diff - root = Path(td) + # The long name: a TEMP given in 8.3 form (RUNNER~1 on the CI) is what PowerShell's location spells out. + root = Path(os.path.realpath(td)) ``` **No control is possible here, and I measured why**: earlier tonight I probed this machine's `TEMP` with `GetShortPathNameW` — **`C:\Users\Isegurav\AppData\Local\Temp` has no 8.3 spelling** (the short form is the same string), so `realpath(td) == td` and the changed line is a **no-op on this host**. **The case it fixes only appears where the temp directory *has* a `RUNNER~1` name** — GitHub's Windows runners. **`red not constructible here` is the honest verdict, not a pass I can vouch for.** **Why the fix is right anyway**: it is the same class as #3231 (which I verified in the same way tonight) — **a test that compares a path PowerShell printed against a path Python built, where the two spellings differ only by 8.3 expansion**. `realpath` is the one that resolves it. **What I could not test**: the CI runner itself. **A test that cannot fail on the machine where it is verified still protects the machine where it does** — that is what this one buys, and it should say so in its own comment (it does). Written with an AI assistant.
LouisRiverstone commented 2026-12-03 02:11:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-12-03T02:11:12Z.


@fiestorra thanks, and fair: on a TEMP with no 8.3 name the change is a no-op, so red can't be built there. I built it locally by giving TEMP as LONGFO~1 (GetShortPathName of a long-named folder): the old test failed exactly as CI did (RUNNER~1 vs the long name), and the new one passes and still fails against main's launcher.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7365180283 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3240#issuecomment-7365180283). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-12-03T02:11:12Z. --- @fiestorra thanks, and fair: on a TEMP with no 8.3 name the change is a no-op, so red can't be built there. I built it locally by giving TEMP as `LONGFO~1` (`GetShortPathName` of a long-named folder): the old test failed exactly as CI did (`RUNNER~1` vs the long name), and the new one passes and still fails against `main`'s launcher.
lixonik commented 2026-12-03 06:37:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-03T06:37:59Z.


Windows native verification (red -> green) -- PASS on head 7bd205992 (merged cleanly via git merge --no-ff onto main d9b618f10).

Checks (Windows 10 x64, Python 3.12, PowerShell 5.1)

  • python -I scripts/check_no_game_data.py -> PASS
  • Green:
    • python -I tests/test_win_launchers.py -v -> Ran 13 tests in 18.414s / OK
  • Red (reverted d3d12/scripts/play-nvidia.ps1 to main d9b618f10, keeping the PR's tests):
    • tests/test_win_launchers.py -> Ran 13 tests in 18.864s / FAILED (failures=1) (exit 1)

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7370054676 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3240#issuecomment-7370054676). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-03T06:37:59Z. --- **Windows native verification (`red -> green`) -- PASS** on head `7bd205992` (merged cleanly via `git merge --no-ff` onto `main` `d9b618f10`). ### Checks (Windows 10 x64, Python 3.12, PowerShell 5.1) - `python -I scripts/check_no_game_data.py` -> **PASS** - **Green:** - `python -I tests/test_win_launchers.py -v` -> **Ran 13 tests in 18.414s / OK** - **Red** (reverted `d3d12/scripts/play-nvidia.ps1` to `main` `d9b618f10`, keeping the PR's tests): - `tests/test_win_launchers.py` -> **Ran 13 tests in 18.864s / FAILED (failures=1)** (exit `1`) AI-assisted: yes (Antigravity -- Gemini 4 Neon).
MoonEyes commented 2026-12-03 15:26:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T15:26:50Z.


In-game gate run on an RTX 4060 8 GB (driver 610.88, Windows 11), in a batch of #3220, #3240, #3253 and #3257 merged into main b053a1813; this PR tested at its current head 7bd205992. Series S 1080, DLSS FG 2x, launched through play-nvidia.ps1 with -SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed, scripted walk, 330 s.

  • Result: PASS. No device lost, no crash, no unhandled exception; the run ended on its time limit.
  • Median over the last 240 s: 17.3 fps (main alone today: 16-17.5); 19.9 frames per 1000 over 100 ms.
  • Not covered: the F1 menu was not pressed by hand, and this does not test the specific path the PR changes beyond a normal launch.

AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7383156166 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3240#issuecomment-7383156166). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T15:26:50Z. --- In-game gate run on an RTX 4060 8 GB (driver 610.88, Windows 11), in a batch of #3220, #3240, #3253 and #3257 merged into main `b053a1813`; this PR tested at its current head `7bd205992`. Series S 1080, DLSS FG 2x, launched through `play-nvidia.ps1` with `-SeriesS -Resolution 1080 -FrameGen 2 -PrecompileUsed`, scripted walk, 330 s. - Result: **PASS**. No device lost, no crash, no unhandled exception; the run ended on its time limit. - Median over the last 240 s: 17.3 fps (main alone today: 16-17.5); 19.9 frames per 1000 over 100 ms. - Not covered: the F1 menu was not pressed by hand, and this does not test the specific path the PR changes beyond a normal launch. AI-assisted (Claude Opus 5.5), run and read by MoonEyes' agent.
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!3240
No description provided.