Report Windows shader precompile failures #3027

Open
Kitrae wants to merge 1 commit from upstream-pr/3027 into main
Kitrae commented 2026-12-02 01:12:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kitrae on 2026-12-02T01:12:47Z.


Claimed in the coordination issue as: Report shader precompile failures in the normal Windows launcher

What and why

The Windows launcher now warns when shader translation or pipeline warm-up exits with an error. Each warning names the phase, includes its exit code, and tells the player to expect more compilation during play. The normal Play path still starts the game after either failure. Pipeline warm-up keeps main’s full default and its -PrecompileUsed option.

Tested

  • On Windows PowerShell, the public scripts/play-d3d12.ps1 entry point ran both precompile phases and launched a synthetic runtime. Exit 37 from shader translation and exit 42 from pipeline warm-up each produced the expected warning. A successful precompile produced neither warning.
  • Independently repeated both failure cases on the rebase base 516c9eaab and head f13910c3a. The two missing-warning assertions failed on the base and passed with the change. The reviewer also verified the warm-up arguments in default and -PrecompileUsed modes.
  • The launcher menu-choice tests, launcher Python tests, changed-path clean-room scan, and Git whitespace check passed.

GPUs tested: n/a for the synthetic launcher tests on Windows 11.

AI-assisted: yes (Codex GPT-6 with a separate GPT-6.2 Sol reviewer)

Checklist

  • Rebased on 516c9eaab and merges cleanly.
  • One topic.
  • The patch and tests contain only launcher code and synthetic data.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5597772301 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3027). Originally posted by [Kitrae](https://github.com/Kitrae) on 2026-12-02T01:12:47Z. --- Claimed in the coordination issue as: [Report shader precompile failures in the normal Windows launcher](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7331365288) ### What and why The Windows launcher now warns when shader translation or pipeline warm-up exits with an error. Each warning names the phase, includes its exit code, and tells the player to expect more compilation during play. The normal Play path still starts the game after either failure. Pipeline warm-up keeps main’s full default and its `-PrecompileUsed` option. ### Tested - On Windows PowerShell, the public `scripts/play-d3d12.ps1` entry point ran both precompile phases and launched a synthetic runtime. Exit 37 from shader translation and exit 42 from pipeline warm-up each produced the expected warning. A successful precompile produced neither warning. - Independently repeated both failure cases on the rebase base `516c9eaab` and head `f13910c3a`. The two missing-warning assertions failed on the base and passed with the change. The reviewer also verified the warm-up arguments in default and `-PrecompileUsed` modes. - The launcher menu-choice tests, launcher Python tests, changed-path clean-room scan, and Git whitespace check passed. GPUs tested: n/a for the synthetic launcher tests on Windows 11. AI-assisted: yes (Codex GPT-6 with a separate GPT-6.2 Sol reviewer) ### Checklist - [x] Rebased on `516c9eaab` and merges cleanly. - [x] One topic. - [x] The patch and tests contain only launcher code and synthetic data.
ecox982745 commented 2026-12-02 01:22:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-12-02T01:22:31Z.


Independent Windows check of 299e84b11 merged with main 5922f9fc5 (tree 24599f0f6). I invoked the unmodified public scripts/play-d3d12.ps1 with an isolated synthetic runtime under Windows PowerShell 5.1 and PowerShell 7.6.9. Each shell ran these four cases on both trees.

Case Main Main + PR
Precompile succeeds Both phase summaries, then run Both phase summaries, then run
Shaders exit 37 and warm-up exits 42 Both phase summaries, then run Both phase summaries and one warning per phase with its exit code, then run
-NoPrecompile with both failures configured Only run Only run
Both precompile phases fail and the runtime stub exits 17 Reached run. The outer PowerShell process returned 0 Reached run after both warnings. The outer PowerShell process returned 0

The successful and bypass cases had no precompile warnings. The runtime was a console stub and the title path was an empty stand-in. No game or GPU work ran.

AI-assisted with OpenAI Codex (GPT-6.2 Sol).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7331629423 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3027#issuecomment-7331629423). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-12-02T01:22:31Z. --- Independent Windows check of `299e84b11` merged with main `5922f9fc5` (tree `24599f0f6`). I invoked the unmodified public `scripts/play-d3d12.ps1` with an isolated synthetic runtime under Windows PowerShell 5.1 and PowerShell 7.6.9. Each shell ran these four cases on both trees. | Case | Main | Main + PR | | --- | --- | --- | | Precompile succeeds | Both phase summaries, then `run` | Both phase summaries, then `run` | | Shaders exit 37 and warm-up exits 42 | Both phase summaries, then `run` | Both phase summaries and one warning per phase with its exit code, then `run` | | `-NoPrecompile` with both failures configured | Only `run` | Only `run` | | Both precompile phases fail and the runtime stub exits 17 | Reached `run`. The outer PowerShell process returned 0 | Reached `run` after both warnings. The outer PowerShell process returned 0 | The successful and bypass cases had no precompile warnings. The runtime was a console stub and the title path was an empty stand-in. No game or GPU work ran. AI-assisted with OpenAI Codex (GPT-6.2 Sol).
andrew-ai commented 2026-12-02 01:26:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-02T01:26:20Z.


Checked benchmark-log compatibility on Windows at 299e84b11. I ran the public launcher in PowerShell 7 with a synthetic runtime, sending stdout to launcher.txt and stderr to leonida.log as the game gate does. Across shader failure (37), pipeline failure (42), and success, the gate parser recovered the expected shader counts, time and pipeline counts. Each failure warning appeared in launcher.txt, the success case had neither warning, and the synthetic runtime stderr marker arrived in leonida.log. All three cases reached run. This checked launcher output and the existing read_precompile parser without starting a game. Codex-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7331705480 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3027#issuecomment-7331705480). Originally posted by [andrew-ai](https://github.com/andrew-ai) on 2026-12-02T01:26:20Z. --- Checked benchmark-log compatibility on Windows at 299e84b11. I ran the public launcher in PowerShell 7 with a synthetic runtime, sending stdout to launcher.txt and stderr to leonida.log as the game gate does. Across shader failure (37), pipeline failure (42), and success, the gate parser recovered the expected shader counts, time and pipeline counts. Each failure warning appeared in launcher.txt, the success case had neither warning, and the synthetic runtime stderr marker arrived in leonida.log. All three cases reached run. This checked launcher output and the existing read_precompile parser without starting a game. Codex-assisted.
MoonEyes commented 2026-12-02 12:38:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:38:16Z.


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:7345640629 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3027#issuecomment-7345640629). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:38:16Z. --- 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).
MoonEyes commented 2026-12-02 18:00:29 +00:00 (Migrated from github.com)

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


Checked on Linux: head 299e84b11 no longer merges into current main 45dc41f95. Not run (the new test is Windows PowerShell only).

merge base 4ccf3fed8 (264 commits behind main)
git merge --no-edit refs/pull/3027/head on 45dc41f95
CONFLICT (content): Merge conflict in d3d12/scripts/play-nvidia.ps1
python -I scripts/check_no_game_data.py d3d12/scripts/play-nvidia.ps1 tests/test_play_d3d12_precompile.py   exit 0 (at the head)

The conflict is with #3172 (e71aa0ef, "Default to full D3D12 shader and pipeline precompilation", merged today). main moved the Write-Host 'Precompiling the pipelines earlier runs drew with ...' line into a new if ($precompileUsedOnly) { ... } else { ... } block further down, so the PR's hunk after the leonida shaders pipeline collides with that move. The resolution is small: keep main's text, put only the shader if ($LASTEXITCODE -ne 0) { Write-Warning ... } block after ForEach-Object { Write-Host " $_" } (around play-nvidia.ps1:894 on main), and drop the PR's copy of the Write-Host line. The warm-up hunk still applies after & $leonida @warmArgs.

Review of the change itself (code read only):

  • $LASTEXITCODE after & $leonida ... | Where-Object | ForEach-Object is the native exit code of leonida.exe, and $ErrorActionPreference is 'Continue' in that block, so Write-Warning does not stop Play. That matches the stated intent.
  • The PR body still says leonida warm --used; since #3172 the default is a full warm (--used only with -PrecompileUsed). The warning text is phase-generic so the code is fine; the description should say "pipeline warm-up" without --used.
  • tests/test_play_d3d12_precompile.py is skipUnless(os.name == "nt" and powershell.exe), so it is skipped on Linux CI and here. Its expected call list ["shaders", "warm", "run"] should still hold with the full-warm default, since the stub only logs args[0]; that needs confirming on Windows after the merge.

No red/green possible here (Windows only). The two Windows comments in this thread ran 299e84b11 on 5922f9fc5, before #3172.

Verdict: conflict (needs a merge of main, then a fresh Windows run of the test on the merged head).

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353854538 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3027#issuecomment-7353854538). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:00:29Z. --- **Checked on Linux: head `299e84b11` no longer merges into current `main` `45dc41f95`. Not run (the new test is Windows PowerShell only).** ``` merge base 4ccf3fed8 (264 commits behind main) git merge --no-edit refs/pull/3027/head on 45dc41f95 CONFLICT (content): Merge conflict in d3d12/scripts/play-nvidia.ps1 python -I scripts/check_no_game_data.py d3d12/scripts/play-nvidia.ps1 tests/test_play_d3d12_precompile.py exit 0 (at the head) ``` **The conflict** is with #3172 (`e71aa0ef`, "Default to full D3D12 shader and pipeline precompilation", merged today). `main` moved the `Write-Host 'Precompiling the pipelines earlier runs drew with ...'` line into a new `if ($precompileUsedOnly) { ... } else { ... }` block further down, so the PR's hunk after the `leonida shaders` pipeline collides with that move. The resolution is small: keep `main`'s text, put only the shader `if ($LASTEXITCODE -ne 0) { Write-Warning ... }` block after `ForEach-Object { Write-Host " $_" }` (around `play-nvidia.ps1:894` on `main`), and drop the PR's copy of the `Write-Host` line. The warm-up hunk still applies after `& $leonida @warmArgs`. **Review of the change itself** (code read only): - `$LASTEXITCODE` after `& $leonida ... | Where-Object | ForEach-Object` is the native exit code of `leonida.exe`, and `$ErrorActionPreference` is `'Continue'` in that block, so `Write-Warning` does not stop Play. That matches the stated intent. - The PR body still says `leonida warm --used`; since #3172 the default is a full `warm` (`--used` only with `-PrecompileUsed`). The warning text is phase-generic so the code is fine; the description should say "pipeline warm-up" without `--used`. - `tests/test_play_d3d12_precompile.py` is `skipUnless(os.name == "nt" and powershell.exe)`, so it is skipped on Linux CI and here. Its expected call list `["shaders", "warm", "run"]` should still hold with the full-warm default, since the stub only logs `args[0]`; that needs confirming on Windows after the merge. No red/green possible here (Windows only). The two Windows comments in this thread ran `299e84b11` on `5922f9fc5`, before #3172. **Verdict: conflict** (needs a merge of `main`, then a fresh Windows run of the test on the merged head). AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
ecox982745 commented 2026-12-02 18:05:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-12-02T18:05:18Z.


Windows follow-up to the conflict report on 299e84b11 + 45dc41f95. I resolved the single hunk in a scratch tree by keeping main’s precompile mode messages and adding the shader warning just after the shader subprocess. The warm-up warning merged as written. The PR's two Python tests passed with Windows PowerShell 5.1 and CPython 3.12.10.

I also ran a 16-case synthetic Windows matrix comparing main with the resolved tree in PowerShell 5.1 and 7. With both precompile stages returning 37 and 42, the resolved launcher printed both warnings once and still reached the runtime stub. Default full mode passed warm and -PrecompileUsed passed warm --used. Success and -NoPrecompile emitted no failure warnings. Neither branch was modified. No game files or GPU work were used, so the requested in-game gate is still pending. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353927961 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3027#issuecomment-7353927961). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-12-02T18:05:18Z. --- Windows follow-up to the conflict report on `299e84b11` + `45dc41f95`. I resolved the single hunk in a scratch tree by keeping main’s precompile mode messages and adding the shader warning just after the shader subprocess. The warm-up warning merged as written. The PR's two Python tests passed with Windows PowerShell 5.1 and CPython 3.12.10. I also ran a 16-case synthetic Windows matrix comparing main with the resolved tree in PowerShell 5.1 and 7. With both precompile stages returning 37 and 42, the resolved launcher printed both warnings once and still reached the runtime stub. Default full mode passed `warm` and `-PrecompileUsed` passed `warm --used`. Success and `-NoPrecompile` emitted no failure warnings. Neither branch was modified. No game files or GPU work were used, so the requested in-game gate is still pending. AI-assisted.
fiestorra commented 2026-12-02 22:19:09 +00:00 (Migrated from github.com)

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


VERIFY-3027 — Windows nativo: los dos tests pasan y el control muerde; la rama no fusiona

Head (this PR)
Merge base behind main b41763227
git merge --no-ff onto main CONFLICT (content) in d3d12/scripts/play-nvidia.ps1

It needs a rebase. For the runs below I resolved that file to the pull request's version and kept the rest of main, which is the state it will be in after a rebase.

Ran

python -I tests/test_play_d3d12_precompile.py      Ran 2 tests — OK

Negative control: I removed the two added warnings (the PR's own six lines) and rebuilt nothing — the test reads the script:

FAIL: test_precompile_failure_warns_and_game_starts
Ran 2 tests — FAILED (failures=2)

A note on how I got there: my first attempt replaced the blocks with String.Replace and the same two warnings were still in the file (CRLF/indent mismatch), so the control "passed" without biting — a control that does not change the file proves nothing. The second attempt removed them by regex, antes=2 despues=0, and the test failed as it should.

What the change is: after shader translation and after the pipeline warm-up, if ($LASTEXITCODE -ne 0) now warns ("Shader translation failed (exit code …). More shaders may compile during play.", and the same for the warm-up) instead of letting the run go on silently. The game still starts — a warning, not a refusal — which is the right call for a precompile stage whose failure is recoverable by compiling during play.

What I could not test

  • A real failing translation or warm-up: the tests synthesise the exit code.
  • The warning reaching a person: that is a console line in a run, and no title was run.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7360527384 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3027#issuecomment-7360527384). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T22:19:09Z. --- ## VERIFY-3027 — Windows nativo: los dos tests pasan y el control muerde; **la rama no fusiona** | | | |---|---| | Head | `(this PR)` | | Merge base | behind `main` `b41763227` | | `git merge --no-ff` onto `main` | **CONFLICT (content) in `d3d12/scripts/play-nvidia.ps1`** | **It needs a rebase.** For the runs below I resolved that file to the pull request's version and kept the rest of `main`, which is the state it will be in after a rebase. **Ran** ``` python -I tests/test_play_d3d12_precompile.py Ran 2 tests — OK ``` **Negative control**: I removed the two added warnings (the PR's own six lines) and rebuilt nothing — the test reads the script: ``` FAIL: test_precompile_failure_warns_and_game_starts Ran 2 tests — FAILED (failures=2) ``` **A note on how I got there**: my first attempt replaced the blocks with `String.Replace` and **the same two warnings were still in the file** (CRLF/indent mismatch), so the control "passed" without biting — **a control that does not change the file proves nothing**. The second attempt removed them by regex, `antes=2 despues=0`, and the test failed as it should. **What the change is**: after shader translation and after the pipeline warm-up, `if ($LASTEXITCODE -ne 0)` now **warns** (`"Shader translation failed (exit code …). More shaders may compile during play."`, and the same for the warm-up) instead of letting the run go on silently. The game still starts — **a warning, not a refusal** — which is the right call for a precompile stage whose failure is recoverable by compiling during play. ## What I could not test - **A real failing translation or warm-up**: the tests synthesise the exit code. - **The warning reaching a person**: that is a console line in a run, and no title was run. Written with an AI assistant.
merzleckeier commented 2026-12-03 03:26:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T03:26:26Z.

Review: COMMENTED


Verified f13910c3 on 516c9eaa and combined with #3272 at 4b64ba9e. The pair merges cleanly. I ran the public play-d3d12.ps1 entry point in Linux PowerShell 7.7.0 with a synthetic executable returning 37 for shaders, 42 for warm, and 0 for run. On both patched trees, default and -PrecompileUsed launches printed both warnings once, called warm and warm --used respectively, and reached run with status 0. Successful precompile and -NoPrecompile had no warnings. The same failure cases on main reached run without the two warnings. This covers the rebased launcher and the current #3272 combination with a synthetic runtime. The requested in-game run remains open. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6163205334 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3027#pullrequestreview-6163205334). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T03:26:26Z. **Review:** COMMENTED --- Verified `f13910c3` on `516c9eaa` and combined with #3272 at `4b64ba9e`. The pair merges cleanly. I ran the public `play-d3d12.ps1` entry point in Linux PowerShell 7.7.0 with a synthetic executable returning 37 for `shaders`, 42 for `warm`, and 0 for `run`. On both patched trees, default and `-PrecompileUsed` launches printed both warnings once, called `warm` and `warm --used` respectively, and reached `run` with status 0. Successful precompile and `-NoPrecompile` had no warnings. The same failure cases on `main` reached `run` without the two warnings. This covers the rebased launcher and the current #3272 combination with a synthetic runtime. The requested in-game run remains open. AI-assisted with OpenAI Codex.
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/3027:upstream-pr/3027'
git switch 'upstream-pr/3027'

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