WIP: D3D12-WARM-ALL: launcher -WarmAll makes every known pipeline ahead, -WarmOnly stops after the precompile #2956

Closed
leonida/mandy
OnendGreysource wants to merge 0 commits from d3d12-warm-all into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

OnendGreysource commented 2026-12-01 21:16:30 +00:00

Claimed in the coordination issue as: D3D12-WARM-ALL (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7326001250)

What and why

The precompile makes only the pipelines earlier runs drew with (leonida warm --used, about 2,400 of the ~83,500 the title creates). A place met for the first time therefore still compiles its pipelines in play, which stalls the game once for each.

  • -WarmAll (play-nvidia.ps1 and play-d3d12.ps1): after the usual warm --used, a second leonida warm without --used makes every other known pipeline. These go into the driver's cache only (LEONIDA_WARM_LIBRARY=0 for that pass, restored afterwards), because putting all of them in the pipeline library would grow it to gigabytes. warm-done.txt already skips what is made, so this is long once per translation or driver change and takes seconds after that. --again (an emptied driver cache) is passed through. The driver-cache file note and the full-cache warning run after both passes. The F1 menu's SAVE AND RESTART keeps -WarmAll.
  • -WarmOnly: ends the script after the precompile without starting the title. This lets the long first precompile run while nobody is playing. It is not replayed by the menu restart.
  • README switch table: both rows added.

Off by default, so nothing changes without the switch.

Tested

  • tests/test_leonida_launcher.py, tests/test_play_nvidia_menu_choice.py, tests/test_win_launchers.py, test_docs_*: pass. Both scripts parse with no errors in the PowerShell parser.
  • The same logic (as an environment switch in a fork's launcher) has been used daily on an RTX 5080: about 93,700 pipelines made per translation in ~11 min, after which no in-game pipeline compiles appear in new areas. This exact branch has not yet been run against the game. It stays a draft until it has.

GPUs tested: NVIDIA GeForce RTX 5080, driver 621.40, Windows 11 Pro 26200 (fork's equivalent; this branch pending)

AI-assisted: yes. Claude Code with Claude Opus 5.5 wrote the change. Not yet reviewed by a separate reviewer agent; that will happen before this leaves draft.

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (check_no_game_data.py on the changed files).
  • A new translator rule is in the contract table of docs/design.md (n/a: no translator change).

🤖 Generated with Claude Code

Claimed in the coordination issue as: D3D12-WARM-ALL (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7326001250) ### What and why The precompile makes only the pipelines earlier runs drew with (`leonida warm --used`, about 2,400 of the ~83,500 the title creates). A place met for the first time therefore still compiles its pipelines in play, which stalls the game once for each. - `-WarmAll` (play-nvidia.ps1 and play-d3d12.ps1): after the usual `warm --used`, a second `leonida warm` without `--used` makes every other known pipeline. These go into the driver's cache only (`LEONIDA_WARM_LIBRARY=0` for that pass, restored afterwards), because putting all of them in the pipeline library would grow it to gigabytes. `warm-done.txt` already skips what is made, so this is long once per translation or driver change and takes seconds after that. `--again` (an emptied driver cache) is passed through. The driver-cache file note and the full-cache warning run after both passes. The F1 menu's SAVE AND RESTART keeps `-WarmAll`. - `-WarmOnly`: ends the script after the precompile without starting the title. This lets the long first precompile run while nobody is playing. It is not replayed by the menu restart. - README switch table: both rows added. Off by default, so nothing changes without the switch. ### Tested - `tests/test_leonida_launcher.py`, `tests/test_play_nvidia_menu_choice.py`, `tests/test_win_launchers.py`, `test_docs_*`: pass. Both scripts parse with no errors in the PowerShell parser. - The same logic (as an environment switch in a fork's launcher) has been used daily on an RTX 5080: about 93,700 pipelines made per translation in ~11 min, after which no in-game pipeline compiles appear in new areas. **This exact branch has not yet been run against the game.** It stays a draft until it has. GPUs tested: NVIDIA GeForce RTX 5080, driver 621.40, Windows 11 Pro 26200 (fork's equivalent; this branch pending) AI-assisted: yes. Claude Code with Claude Opus 5.5 wrote the change. Not yet reviewed by a separate reviewer agent; that will happen before this leaves draft. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (`check_no_game_data.py` on the changed files). - [ ] A new translator rule is in the contract table of `docs/design.md` (n/a: no translator change). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
andrew-ai commented 2026-12-01 21:21:25 +00:00

-WarmOnly reports success even when the precompile executable fails. I exercised the public scripts/play-d3d12.ps1 entry point at 558b7980e under native Windows PowerShell 7.6.9 using both unmodified scripts, synthetic input paths, and a recording leonida.exe. The stand-in returned exit code 37 on exactly one selected pass and zero on the others.

Failing pass with -WarmOnly -WarmAll Passes invoked Outer pwsh exit Printed “Precompile done”
None shaders, warm --used, warm 0 yes
shaders shaders, warm --used, warm 0 yes
warm --used shaders, warm --used, warm 0 yes
final warm shaders, warm --used, warm 0 yes

The final-pass failure alone makes a warm-only batch job look successful. Please capture the native exit status immediately after each precompile pipeline and surface a failure from the public entry point before announcing completion. A subprocess test with a deliberately failing stand-in would cover this.

The success controls worked: the extra pass alone saw LEONIDA_WARM_LIBRARY=0, plain -WarmOnly stopped after the used pass, and -WarmOnly -NoPrecompile invoked nothing. None of the six cases attempted a title launch. This checks launcher behavior without game files, not actual cache warming. Coordination claim. AI-assisted with OpenAI Codex (GPT-6).

`-WarmOnly` reports success even when the precompile executable fails. I exercised the public `scripts/play-d3d12.ps1` entry point at `558b7980e` under native Windows PowerShell 7.6.9 using both unmodified scripts, synthetic input paths, and a recording `leonida.exe`. The stand-in returned exit code 37 on exactly one selected pass and zero on the others. | Failing pass with -WarmOnly -WarmAll | Passes invoked | Outer pwsh exit | Printed “Precompile done” | | --- | --- | ---: | --- | | None | shaders, warm --used, warm | 0 | yes | | shaders | shaders, warm --used, warm | 0 | yes | | warm --used | shaders, warm --used, warm | 0 | yes | | final warm | shaders, warm --used, warm | 0 | yes | The final-pass failure alone makes a warm-only batch job look successful. Please capture the native exit status immediately after each precompile pipeline and surface a failure from the public entry point before announcing completion. A subprocess test with a deliberately failing stand-in would cover this. The success controls worked: the extra pass alone saw `LEONIDA_WARM_LIBRARY=0`, plain `-WarmOnly` stopped after the used pass, and `-WarmOnly -NoPrecompile` invoked nothing. None of the six cases attempted a title launch. This checks launcher behavior without game files, not actual cache warming. [Coordination claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7326102366). AI-assisted with OpenAI Codex (GPT-6).
merzleckeier commented 2026-12-01 21:33:43 +00:00

Cache recovery can select an early pipeline in both warm passes. I reproduced the launcher dispatch on 558b7980e merged into 1fff69129.

I ran the two unmodified PowerShell scripts through scripts/play-d3d12.ps1 with a recording executable. A missing noted driver-cache file and a file that shrank from 8 to 4 fixture bytes both requested warm --used --again followed by warm --again. The same-size control passed neither --again. The second call alone switched the library setting to 0, then the original value was restored. The F1 restart command kept -WarmAll.

I then ran those argument pairs through the actual Win64 leonida warm on an RTX 4070 SUPER under Wine 11.22 / VKD3D-Proton 3.1.0, using a synthetic book with one early key and one other key.

Case Used pass candidates All pass candidates Early-key entries in final warm-done.txt
Normal, no early library record 1 1 1
Recovery, no early library record 1 2 2
Recovery, early key in library bookkeeping 1 1 1

--again in the second call ignores the done record the first call just wrote. This exercises scheduling with LEONIDA_WARM_DONE_ALL=1 for the dummy records. The worker reports that the records make no host PSO. The library comparison seeds bookkeeping only. No timing or driver-cache retention was measured.

MEASURED with synthetic inputs, OpenAI Codex and independent raw-log verification.

Cache recovery can select an early pipeline in both warm passes. I reproduced the launcher dispatch on `558b7980e` merged into `1fff69129`. I ran the two unmodified PowerShell scripts through `scripts/play-d3d12.ps1` with a recording executable. A missing noted driver-cache file and a file that shrank from 8 to 4 fixture bytes both requested `warm --used --again` followed by `warm --again`. The same-size control passed neither `--again`. The second call alone switched the library setting to `0`, then the original value was restored. The F1 restart command kept `-WarmAll`. I then ran those argument pairs through the actual Win64 `leonida warm` on an RTX 4070 SUPER under Wine 11.22 / VKD3D-Proton 3.1.0, using a synthetic book with one early key and one other key. | Case | Used pass candidates | All pass candidates | Early-key entries in final `warm-done.txt` | | --- | ---: | ---: | ---: | | Normal, no early library record | 1 | 1 | 1 | | Recovery, no early library record | 1 | 2 | 2 | | Recovery, early key in library bookkeeping | 1 | 1 | 1 | `--again` in the second call ignores the done record the first call just wrote. This exercises scheduling with `LEONIDA_WARM_DONE_ALL=1` for the dummy records. The worker reports that the records make no host PSO. The library comparison seeds bookkeeping only. No timing or driver-cache retention was measured. MEASURED with synthetic inputs, OpenAI Codex and independent raw-log verification.
wrexik reviewed 2026-12-01 21:35:55 +00:00
wrexik left a comment
No description provided.
Two items to address before merging: 1. The `leonida shaders`, `warm --used`, and `-WarmAll` `warm` calls are piped through output filters, but their native exit codes are never checked. A failing pass can still reach `Precompile done` and return success. Capture and propagate `$LASTEXITCODE` after each invocation, with subprocess coverage for each failure and the public wrapper. 2. When driver-cache recovery adds `--again` to `$warmArgs`, the `-WarmAll` pass removes only `--used` and carries `--again` forward. That can redo pipelines the first pass just completed. Strip `--again` from the second pass and cover recovery with a missing or shrunken cache-note fixture. Please credit @wrexik in the PR description for this review feedback if you incorporate it.
wrexik reviewed 2026-12-01 21:37:23 +00:00
wrexik left a comment
No description provided.
**`d3d12/scripts/play-nvidia.ps1` line 903:** > Suggested change for this pass: > > ```suggestion > $warmAllArgs = @($warmArgs | Where-Object { $_ -ne '--used' -and $_ -ne '--again' }) > & $leonida @warmAllArgs | Where-Object { $_ -match 'pipelines known|^\d+ of |made in' } | > ForEach-Object { Write-Host " $_" } > $precompileExitCode = $LASTEXITCODE > if ($precompileExitCode -ne 0) { throw "leonida warm failed with exit code $precompileExitCode." } > ``` > > Apply the same immediate exit-code capture/check after the `shaders` and `warm --used` pipelines too. Keeping `--again` on only the recovery pass avoids rerunning pipelines that the first pass has just completed.
wrexik reviewed 2026-12-01 21:37:46 +00:00
wrexik left a comment
No description provided.
**`d3d12/scripts/play-nvidia.ps1` line 903:** > Please credit @wrexik in the PR description for this review feedback if you incorporate it.
Sign in to join this conversation.
No description provided.