Preserve Windows D3D12 launch failure status #3210

Merged
ubiquitarianism merged 2 commits from upstream-pr/3210 into main 2026-12-02 20:56:22 +00:00
ubiquitarianism commented 2026-12-02 19:30:12 +00:00 (Migrated from github.com)

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


Claimed as D3D12-SERIES-X-2160-STARTUP.

What and why

  • Return the native runtime’s exit code from scripts/play-d3d12.ps1, play-nvidia.ps1, and the documented Series X 2160p preset, with or without -Log. A runtime spawn failure and an explicit render height above the console’s output now return nonzero status with a diagnostic.
  • Record launcher_exited with the launcher’s exit code when the game gate misses an early exit before observing the runtime process. The gate’s verdict logic is unchanged.
  • The native runtime already fails when a required package dependency is missing. An independently run, no-game fixture for that failure returned 0 through the Windows launcher on upstream main and 1 with this fix in both log modes.
  • The cause of the reported Series X 2160p retail exit remains unknown. Precompilation warnings are covered by complementary work in #3027.

Tested

  • Windows 11, with 9 Windows launcher tests, 35 game gate tests, 16 F1 menu tests, and 26 launcher tests passing.
  • Red/green against main at b41763227 and the previous candidate. The synthetic game gate run captured exit status 23 in the launcher_exited event.
  • The changed-file clean-room scan (python -I scripts/check_no_game_data.py) and git diff --check passed. Verification used no game files.

GPUs tested were none. The tests exercised launch and reporting behavior.

AI-assisted with OpenAI Codex (GPT-6.2 Sol) for implementation and independent reviews, including the follow-up review on the published head.

Checklist

  • Based on current main.
  • One topic.
  • Clean-room requirements verified.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5613279011 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3210). Originally posted by [ubiquitarianism](https://github.com/ubiquitarianism) on 2026-12-02T19:30:12Z. --- Claimed as [D3D12-SERIES-X-2160-STARTUP](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7355584254). ### What and why - Return the native runtime’s exit code from `scripts/play-d3d12.ps1`, `play-nvidia.ps1`, and the documented Series X 2160p preset, with or without `-Log`. A runtime spawn failure and an explicit render height above the console’s output now return nonzero status with a diagnostic. - Record `launcher_exited` with the launcher’s exit code when the game gate misses an early exit before observing the runtime process. The gate’s verdict logic is unchanged. - The native runtime already fails when a required package dependency is missing. An independently run, no-game fixture for that failure returned `0` through the Windows launcher on upstream `main` and `1` with this fix in both log modes. - The cause of the reported Series X 2160p retail exit remains unknown. Precompilation warnings are covered by complementary work in #3027. ### Tested - Windows 11, with 9 Windows launcher tests, 35 game gate tests, 16 F1 menu tests, and 26 launcher tests passing. - Red/green against `main` at `b41763227` and the previous candidate. The synthetic game gate run captured exit status `23` in the `launcher_exited` event. - The changed-file clean-room scan (`python -I scripts/check_no_game_data.py`) and `git diff --check` passed. Verification used no game files. GPUs tested were none. The tests exercised launch and reporting behavior. AI-assisted with OpenAI Codex (GPT-6.2 Sol) for implementation and independent reviews, including the follow-up review on the published head. ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] Clean-room requirements verified.
merzleckeier commented 2026-12-02 19:45:31 +00:00 (Migrated from github.com)

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


Independent check on 917cb9e32 against b41763227. I used PowerShell 7.7.0 on Linux, a stub for Windows build detection, and a synthetic child returning 23. The top-level wrapper returned 0 on main and 23 with the PR, both with and without -Log. The documented 2160p preset also changed from 0 to 23. Series S with explicit -Resolution 2160 changed from 0 to 1 without starting the child.

One existing preflight gap remains in d3d12/scripts/play-nvidia.ps1:161. With simulated Windows build 19045 and no D3D12Core.dll, play-d3d12.ps1 gives the expected Agility SDK diagnostic and returns 0 without starting the child. The conflicting -Dlss quality -NoDlss preflight at line 109 also returns 0. Both results were the same on main. I consider these separate preflight follow-ups to the runtime-exit fix.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7356674738 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3210#issuecomment-7356674738). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T19:45:31Z. --- Independent check on `917cb9e32` against `b41763227`. I used PowerShell 7.7.0 on Linux, a stub for Windows build detection, and a synthetic child returning 23. The top-level wrapper returned 0 on `main` and 23 with the PR, both with and without `-Log`. The documented 2160p preset also changed from 0 to 23. Series S with explicit `-Resolution 2160` changed from 0 to 1 without starting the child. One existing preflight gap remains in `d3d12/scripts/play-nvidia.ps1:161`. With simulated Windows build 19045 and no `D3D12Core.dll`, `play-d3d12.ps1` gives the expected Agility SDK diagnostic and returns 0 without starting the child. The conflicting `-Dlss quality -NoDlss` preflight at line 109 also returns 0. Both results were the same on `main`. I consider these separate preflight follow-ups to the runtime-exit fix. AI-assisted: OpenAI Codex (GPT-6).
ecox982745 commented 2026-12-02 20:02:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-12-02T20:02:30Z.


Native Windows integration check at 917cb9e32 (base b41763227) with #3027 299e84b11. I resolved the existing #3172 precompile-text conflict in a scratch tree as described in #3027. The #3210 process-exit changes stayed intact.

All 16 checks passed across #3210 alone and the combined tree, in Windows PowerShell 5.1 and PowerShell 7, with or without -Log and with default/full or used-only warm-up. The synthetic shaders command exited 37 and warm exited 42. The combined tree warned once for each phase, ran the title stub, and returned the stub's own exit 23 in all 8 combined cases. The title stub’s stderr followed the requested log mode. CPU-only, no game files. AI-assisted validation.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7357119981 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3210#issuecomment-7357119981). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-12-02T20:02:30Z. --- Native Windows integration check at `917cb9e32` (base `b41763227`) with #3027 `299e84b11`. I resolved the existing #3172 precompile-text conflict in a scratch tree as described in #3027. The #3210 process-exit changes stayed intact. All 16 checks passed across #3210 alone and the combined tree, in Windows PowerShell 5.1 and PowerShell 7, with or without `-Log` and with default/full or used-only warm-up. The synthetic shaders command exited 37 and warm exited 42. The combined tree warned once for each phase, ran the title stub, and returned the stub's own exit 23 in all 8 combined cases. The title stub’s stderr followed the requested log mode. CPU-only, no game files. AI-assisted validation.
TurboTheTurtle commented 2026-12-02 20:26:35 +00:00 (Migrated from github.com)

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


tested: #3210 on RTX 5080 16 GB (Windows 11, NVIDIA 621.47), same - the four suites the description names are green on both trees, and the head adds 23 tests over main with no regressions.

Counts, python -I per file, head 917cb9e32 against main at f37c4a87d:

File head main rc
tests/test_win_launchers.py 9 5 0 on both
tests/test_game_gate.py 35 (2 skipped) 26 (1 skipped) 0 on both
tests/test_leonida_launcher.py 26 16 0 on both
tests/test_play_nvidia_menu_choice.py 16 16 0 on both

The 9, 35 and 26 match the description, and the menu suite is unchanged at 16. The two added skips in the game-gate file are the only difference in the skip count.

Start through d3d12/scripts/play-X-2160p.ps1 -Exe <leonida.exe>, with and without -Log, on the diag build: exit status 1 on the head and 1 on main for the same fixture, which is the layer's own the title's own DLLs are missing: USER32.dll, winmm.dll, ... error with the package's DLLs not copied next to the build. So the propagation is the same here, and the two logs differ only by the LEONIDA_DLSS_DIR and LEONIDA_FRAME_GEN entries the DLSS path adds. No VK_ERROR_DEVICE_LOST, no unhandled exception, no device-removed data.

Machines and settings: Windows 11, hardware-accelerated GPU scheduling on (HwSchMode=2, HwScheme=2), page file 49,152 MB, the named adapter NVIDIA GeForce RTX 5080 (index 1 of 2, the panel is on the iGPU). No game files attached; only counts and exit statuses.

GPUs tested: NVIDIA GeForce RTX 5080, driver 621.47, Windows 11. AI-assisted: Qwen3.8-Flash-Next.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7357743736 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3210#issuecomment-7357743736). Originally posted by [TurboTheTurtle](https://github.com/TurboTheTurtle) on 2026-12-02T20:26:35Z. --- `tested: #3210 on RTX 5080 16 GB (Windows 11, NVIDIA 621.47), same` - the four suites the description names are green on both trees, and the head adds 23 tests over main with no regressions. Counts, `python -I` per file, head `917cb9e32` against `main` at `f37c4a87d`: | File | head | main | rc | |---|---:|---:|---| | `tests/test_win_launchers.py` | 9 | 5 | 0 on both | | `tests/test_game_gate.py` | 35 (2 skipped) | 26 (1 skipped) | 0 on both | | `tests/test_leonida_launcher.py` | 26 | 16 | 0 on both | | `tests/test_play_nvidia_menu_choice.py` | 16 | 16 | 0 on both | The 9, 35 and 26 match the description, and the menu suite is unchanged at 16. The two added skips in the game-gate file are the only difference in the skip count. Start through `d3d12/scripts/play-X-2160p.ps1 -Exe <leonida.exe>`, with and without `-Log`, on the diag build: exit status `1` on the head and `1` on main for the same fixture, which is the layer's own `the title's own DLLs are missing: USER32.dll, winmm.dll, ...` error with the package's DLLs not copied next to the build. So the propagation is the same here, and the two logs differ only by the `LEONIDA_DLSS_DIR` and `LEONIDA_FRAME_GEN` entries the DLSS path adds. No `VK_ERROR_DEVICE_LOST`, no unhandled exception, no device-removed data. Machines and settings: Windows 11, hardware-accelerated GPU scheduling on (`HwSchMode=2`, `HwScheme=2`), page file 49,152 MB, the named adapter `NVIDIA GeForce RTX 5080` (index 1 of 2, the panel is on the iGPU). No game files attached; only counts and exit statuses. GPUs tested: NVIDIA GeForce RTX 5080, driver 621.47, Windows 11. AI-assisted: Qwen3.8-Flash-Next.
fiestorra commented 2026-12-02 20:40:49 +00:00 (Migrated from github.com)

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


VERIFY-3210 — Windows nativo: red then green, y la cadena de estado comprobada de punta a punta

Head (this PR)
Merge base b41763227 = current main
Merged onto main b41763227 — merge-tree clean, git merge --no-ff clean

Ran (native Windows, real PowerShell — the tests that need it are skipUnless(POWERSHELL) and therefore skip on Linux)

python -I tests/test_win_launchers.py                                  Ran 9 tests in 17.7s — OK
python -I tests/test_win_launchers.py -k native_status -k spawn_failure -k explicit_height
                                                                        Ran 3 tests in 14.4s — OK
python -I tests/test_game_gate.py                                      Ran 35 tests in 6.1s — OK
PowerShell parse of all four changed scripts: 0 errors each

Negative control (the four .ps1 files reverted to main, the PR's tests kept):

FAIL: test_native_status_reaches_both_launchers_with_or_without_log
FAIL: test_spawn_failure_returns_nonzero            (x6 subtests, one per launcher)
FAIL: test_explicit_height_validation_fails_without_starting_the_runtime
Ran 9 tests — FAILED

The shape of the change is right: Start-Process ... -PassThru -Wait keeps the child's code, exit $process.ExitCode at the end of play-nvidia.ps1, exit 1 on a spawn failure and on the height check (both before the runtime starts), and exit $LASTEXITCODE in the Series X 2160p wrapper.

The one gap left, measured

Only play-X-2160p.ps1 got the exit $LASTEXITCODE line; the other eleven wrappers (play-S-*.ps1, play-X-*.ps1) still end on the & ...play-nvidia.ps1 ... line, so pwsh -File play-S-1080p.ps1 returns 0 after a preflight failure or a crashed runtime. That is the same gap I noted on #3220 — this PR closes it for one wrapper, and the fix is one line each (or a shared include). scripts/play-d3d12.ps1 and scripts/game-gate.ps1 are covered, which is the path the gate uses.

What I could not test

  • A real runtime crash carrying a known code: the tests use a synthetic leonida.exe that exits with a chosen code; no game run, no device removal.
  • Launcher.bat end to end: it starts the Python launcher.

Verdict: red then green on native Windows, with the three new tests actually executed.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358136220 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3210#issuecomment-7358136220). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T20:40:49Z. --- ## VERIFY-3210 — Windows nativo: `red then green`, y la cadena de estado comprobada de punta a punta | | | |---|---| | Head | `(this PR)` | | Merge base | `b41763227` = current `main` | | Merged onto | `main` `b41763227` — `merge-tree` clean, `git merge --no-ff` clean | **Ran (native Windows, real PowerShell — the tests that need it are `skipUnless(POWERSHELL)` and therefore skip on Linux)** ``` python -I tests/test_win_launchers.py Ran 9 tests in 17.7s — OK python -I tests/test_win_launchers.py -k native_status -k spawn_failure -k explicit_height Ran 3 tests in 14.4s — OK python -I tests/test_game_gate.py Ran 35 tests in 6.1s — OK PowerShell parse of all four changed scripts: 0 errors each ``` **Negative control** (the four `.ps1` files reverted to `main`, the PR's tests kept): ``` FAIL: test_native_status_reaches_both_launchers_with_or_without_log FAIL: test_spawn_failure_returns_nonzero (x6 subtests, one per launcher) FAIL: test_explicit_height_validation_fails_without_starting_the_runtime Ran 9 tests — FAILED ``` **The shape of the change is right**: `Start-Process ... -PassThru -Wait` keeps the child's code, `exit $process.ExitCode` at the end of `play-nvidia.ps1`, `exit 1` on a spawn failure and on the height check (both *before* the runtime starts), and `exit $LASTEXITCODE` in the Series X 2160p wrapper. ## The one gap left, measured **Only `play-X-2160p.ps1` got the `exit $LASTEXITCODE` line**; the other eleven wrappers (`play-S-*.ps1`, `play-X-*.ps1`) still end on the `& ...play-nvidia.ps1 ...` line, so `pwsh -File play-S-1080p.ps1` returns **0** after a preflight failure or a crashed runtime. That is the same gap I noted on #3220 — this PR closes it for one wrapper, and the fix is one line each (or a shared include). `scripts/play-d3d12.ps1` and `scripts/game-gate.ps1` are covered, which is the path the gate uses. ## What I could not test - **A real runtime crash carrying a known code**: the tests use a synthetic `leonida.exe` that exits with a chosen code; no game run, no device removal. - **`Launcher.bat` end to end**: it starts the Python launcher. Verdict: **red then green** on native Windows, with the three new tests actually executed. Written with an AI assistant.
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!3210
No description provided.