Return failure status for D3D12 launcher preflight errors #3220

Open
merzleckeier wants to merge 1 commit from upstream-pr/3220 into main
merzleckeier commented 2026-12-02 20:21:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T20:21:50Z.


Claimed in the coordination issue as D3D12-LAUNCHER-PREFLIGHT-STATUS.

Depends on: #3210 for propagating the resulting status through the public Windows wrapper and the Series X 2160p preset. Direct invocation of play-nvidia.ps1 benefits on its own.

What and why

Seven existing preflight checks print a diagnostic and abort the launch, but report status 0 to the caller. Report status 1 for the missing title, conflicting options, unavailable Cargo or runtime, and missing Agility SDK. Keep the missing-Agility dry run available as a settings preview.

Tested

  • Synthetic fixture with PowerShell 7.7.0 on Linux. All seven rejection cases failed on main because the status was 0. They report 1 with the change, and the preview reports 0 on both versions.
  • Launcher suite passed on the branch (5 passed, 2 Windows-only skips). The 20 switch checks, 3 line-ending tests, no-game-data and whitespace checks passed.
  • Clean local merge with #3210 at 917cb9e32. The public wrapper forwarded status 1 for both the DLSS conflict and missing Agility, and 0 for the dry-run preview. The Series X 2160p preset forwarded status 1 for missing Agility. Those integration runs used a mocked Windows build and empty executable fixtures under PowerShell on Linux.

GPUs tested: n/a (synthetic checks, no runtime process started).

AI-assisted: OpenAI GPT-6.2 through Codex. GPT-6.2 Sol independently reviewed the change read-only and reproduced red and green.

Checklist

  • Based on upstream main at b41763227.
  • One topic.
  • Synthetic fixtures only.
  • Translator rule: n/a.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5614042984 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3220). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T20:21:50Z. --- Claimed in the coordination issue as [D3D12-LAUNCHER-PREFLIGHT-STATUS](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7357526650). Depends on: #3210 for propagating the resulting status through the public Windows wrapper and the Series X 2160p preset. Direct invocation of `play-nvidia.ps1` benefits on its own. ### What and why Seven existing preflight checks print a diagnostic and abort the launch, but report status 0 to the caller. Report status 1 for the missing title, conflicting options, unavailable Cargo or runtime, and missing Agility SDK. Keep the missing-Agility dry run available as a settings preview. ### Tested - Synthetic fixture with PowerShell 7.7.0 on Linux. All seven rejection cases failed on `main` because the status was 0. They report 1 with the change, and the preview reports 0 on both versions. - Launcher suite passed on the branch (5 passed, 2 Windows-only skips). The 20 switch checks, 3 line-ending tests, no-game-data and whitespace checks passed. - Clean local merge with #3210 at `917cb9e32`. The public wrapper forwarded status 1 for both the DLSS conflict and missing Agility, and 0 for the dry-run preview. The Series X 2160p preset forwarded status 1 for missing Agility. Those integration runs used a mocked Windows build and empty executable fixtures under PowerShell on Linux. GPUs tested: n/a (synthetic checks, no runtime process started). AI-assisted: OpenAI GPT-6.2 through Codex. GPT-6.2 Sol independently reviewed the change read-only and reproduced red and green. ### Checklist - [x] Based on upstream `main` at `b41763227`. - [x] One topic. - [x] Synthetic fixtures only. - Translator rule: n/a.
fiestorra commented 2026-12-02 20:38:57 +00:00 (Migrated from github.com)

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


VERIFY-3220 — Windows nativo con PowerShell de verdad: el test del PR se ejecuta aquí, no se salta

Head (this PR)
Merge base b41763227 = current main

Ran

python -I tests/test_win_launchers.py                          Ran 7 tests in 6.29s — OK
python -I tests/test_win_launchers.py -k nvidia_preflight      Ran 1 test in 2.93s — OK   (not skipped)
d3d12/scripts/play-nvidia.ps1 parses with 0 errors

The skipUnless(POWERSHELL) guard is why the author could only run this on Linux as a skip: here the test really runs, and it runs the real script (copied to a temp scripts/ beside a synthetic title and a fake target\release\leonida.exe, with Get-CimInstance stubbed) through all eight cases — missing_title, dlss_and_height, fixed_and_dynamic, dlss_and_no_dlss, no_cargo, missing_runtime, missing_agility → exit 1, and preview → exit 0 — asserting the printed line for each.

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

FAIL: test_nvidia_preflight_failures_return_nonzero_and_keep_the_dry_run_preview   (x4 subtests)
Ran 7 tests — FAILED

What the exit code does downstream, measured rather than assumed

I probed whether exit 1 inside a script called with & can cut off its caller (it cannot: the child script ends, the caller's $LASTEXITCODE becomes 1 and it keeps running), so scripts/play-d3d12.ps1:134 (& ...play-nvidia.ps1 @launch) and scripts/game-gate.ps1:266 ($code = $LASTEXITCODE) do see the number.

One thing this PR does not reach: the play-S-*.ps1 / play-X-*.ps1 wrappers end on the & ...play-nvidia.ps1 ... line and never exit $LASTEXITCODE, so a wrapper run as pwsh -File play-S-1080p.ps1 still returns 0 after a preflight failure. That is outside this PR's stated scope, but if those wrappers are meant to report failure to a shell, they need the line.

What I could not test

  • A real launch: every case is synthetic (fake title, fake runtime); no game run.
  • Launcher.bat end to end: it starts the Python launcher, not this script.

Verdict: red then green on native Windows, with the PowerShell-dependent test actually executed.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358084273 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3220#issuecomment-7358084273). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T20:38:57Z. --- ## VERIFY-3220 — Windows nativo con PowerShell de verdad: el test del PR **se ejecuta aquí**, no se salta | | | |---|---| | Head | `(this PR)` | | Merge base | `b41763227` = current `main` | **Ran** ``` python -I tests/test_win_launchers.py Ran 7 tests in 6.29s — OK python -I tests/test_win_launchers.py -k nvidia_preflight Ran 1 test in 2.93s — OK (not skipped) d3d12/scripts/play-nvidia.ps1 parses with 0 errors ``` **The `skipUnless(POWERSHELL)` guard is why the author could only run this on Linux as a skip**: here the test really runs, and it runs the **real script** (copied to a temp `scripts/` beside a synthetic title and a fake `target\release\leonida.exe`, with `Get-CimInstance` stubbed) through all eight cases — `missing_title`, `dlss_and_height`, `fixed_and_dynamic`, `dlss_and_no_dlss`, `no_cargo`, `missing_runtime`, `missing_agility` → **exit 1**, and `preview` → **exit 0** — asserting the printed line for each. **Negative control** (`d3d12/scripts/play-nvidia.ps1` reverted to `main`, the PR's tests kept): ``` FAIL: test_nvidia_preflight_failures_return_nonzero_and_keep_the_dry_run_preview (x4 subtests) Ran 7 tests — FAILED ``` ## What the exit code does downstream, measured rather than assumed I probed whether `exit 1` inside a script called with `&` can cut off its caller (it cannot: the child script ends, the caller's `$LASTEXITCODE` becomes 1 and it keeps running), so `scripts/play-d3d12.ps1:134` (`& ...play-nvidia.ps1 @launch`) and `scripts/game-gate.ps1:266` (`$code = $LASTEXITCODE`) do see the number. **One thing this PR does not reach**: the `play-S-*.ps1` / `play-X-*.ps1` wrappers end on the `& ...play-nvidia.ps1 ...` line and never `exit $LASTEXITCODE`, so a wrapper run as `pwsh -File play-S-1080p.ps1` still returns 0 after a preflight failure. That is outside this PR's stated scope, but if those wrappers are meant to report failure to a shell, they need the line. ## What I could not test - **A real launch**: every case is synthetic (fake title, fake runtime); no game run. - **`Launcher.bat` end to end**: it starts the Python launcher, not this script. Verdict: **red then green** on native Windows, with the PowerShell-dependent test actually executed. Written with an AI assistant.
merzleckeier commented 2026-12-02 21:14:14 +00:00 (Migrated from github.com)

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


Additional coverage for 0beb7d26 on main 8877be37: I ran the checker with #3224 and #3227 combined, with PowerShell 7.7.0 on Linux. It reports red then green. Reversing each of the four PowerShell hunks independently (play-nvidia.ps1 lines 106, 146, 151 and 161) makes the new regression fail. All four report caught. Synthetic launcher fixtures only. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358990565 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3220#issuecomment-7358990565). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T21:14:14Z. --- Additional coverage for `0beb7d26` on `main` `8877be37`: I ran the checker with #3224 and #3227 combined, with PowerShell 7.7.0 on Linux. It reports `red then green`. Reversing each of the four PowerShell hunks independently (`play-nvidia.ps1` lines 106, 146, 151 and 161) makes the new regression fail. All four report `caught`. Synthetic launcher fixtures only. AI-assisted.
MoonEyes commented 2026-12-02 22:00:15 +00:00 (Migrated from github.com)

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


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:7360086921 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3220#issuecomment-7360086921). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T22:00:15Z. --- 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).
merzleckeier commented 2026-12-02 22:45:45 +00:00 (Migrated from github.com)

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


Linking the independent Windows verification in #3187. It includes this exact head 0beb7d26 merged onto main at 16243cd6 with #3187. All 10 launcher tests and all 4 Rust/Build Tools tests passed. The verification also exercises the missing-tool and missing-build exit paths through the launchers. It used synthetic launcher inputs on Windows 11 and PowerShell 5.1.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361126625 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3220#issuecomment-7361126625). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T22:45:45Z. --- Linking the [independent Windows verification in #3187](https://github.com/ProjectLeonida/mandy/pull/3187#issuecomment-7361013452). It includes this exact head `0beb7d26` merged onto `main` at `16243cd6` with #3187. All 10 launcher tests and all 4 Rust/Build Tools tests passed. The verification also exercises the missing-tool and missing-build exit paths through the launchers. It used synthetic launcher inputs on Windows 11 and PowerShell 5.1.
lixonik commented 2026-12-02 22:47:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T22:47:46Z.


Windows native verification (red -> green) -- PASS on head 0beb7d26d (merged cleanly via git merge --no-ff onto main 16243cd6e).

Checks (Windows 10 x64, Python 3.12)

  • python -I scripts/check_no_game_data.py -> PASS
  • Green (python -I tests/test_win_launchers.py -v on merged head 0beb7d26d): Ran 10 tests in 18.882s / OK
  • Red (reverted d3d12/scripts/play-nvidia.ps1 to main 16243cd6e, keeping the PR's tests/test_win_launchers.py): Ran 10 tests in 18.689s / FAILED (failures=7)

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361171276 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3220#issuecomment-7361171276). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T22:47:46Z. --- **Windows native verification (`red -> green`) -- PASS** on head `0beb7d26d` (merged cleanly via `git merge --no-ff` onto `main` `16243cd6e`). ### Checks (Windows 10 x64, Python 3.12) - `python -I scripts/check_no_game_data.py` -> **PASS** - **Green** (`python -I tests/test_win_launchers.py -v` on merged head `0beb7d26d`): **Ran 10 tests in 18.882s / OK** - **Red** (reverted `d3d12/scripts/play-nvidia.ps1` to `main` `16243cd6e`, keeping the PR's `tests/test_win_launchers.py`): **Ran 10 tests in 18.689s / FAILED (failures=7)** AI-assisted: yes (Antigravity -- Gemini 4 Neon).
MoonEyes commented 2026-12-03 15:26:48 +00:00 (Migrated from github.com)

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


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 0beb7d26d. 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:7383155232 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3220#issuecomment-7383155232). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T15:26:48Z. --- 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 `0beb7d26d`. 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.
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/3220:upstream-pr/3220'
git switch 'upstream-pr/3220'

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