d3d12: 522 host pipelines still made during play freeze the picture 1 to 2.6 s each (RTX 5080, Series S), with shaders and warm --used already complete #3103

Open
opened 2026-12-02 11:02:18 +00:00 by ldx-007 · 5 comments
ldx-007 commented 2026-12-02 11:02:18 +00:00 (Migrated from github.com)
Contributor

Imported from ubiquitarianism/leonida. Originally posted by ldx-007 on 2026-12-02T11:02:18Z.


What happens

Even with every shader of the title coming out of the translation cache in 1 s and warm --used
done, an 8 1/2 minute run still makes 522 host pipelines while the title plays
(host pipeline library saved ... made=522 loaded=2814), and each of the big ones freezes the
picture for 1 to 2.6 s while SHADERS COMPILING: n LEFT stands next to the frame rate.

Commit

30742ccb1 of my fork ldx-007/mandy, which is upstream main at 393901a5b plus two
.github/workflows/ commits only (no runtime file touched). The exe is that workflow's build of
the diag profile, built-with.txt = diagnostics,dlss,mimalloc.

System

Windows 11 Insider build 26300 x64, Ryzen 7 9800X3D, 64 GB, RTX 5080 16 GB (driver 32.0.16.2124),
HAGS on. Xbox Series package 1.0.2.1, Series S profile, DLSS on.

Where

pipelines

Command and steps

Started through scripts/play-d3d12.ps1 -Game <the title's folder> -Data <a folder outside the checkout>.

  1. leonida shaders <the title's folder>\shaders.rpf, run from a window holding exactly the
    LEONIDA_* settings that same play start uses (taken from play-nvidia.ps1 -DryRun):
    25687 shaders in the cache, 202 do not translate, 1 s.
  2. leonida warm --used:
    83576 pipelines known, 2966 made before (06d3d9d172e378a7), 0 bad; 0 to make, 10 processes
    then 2966 of 2966 in the pipeline library, written in 4 s.
  3. Play, Series S with DLSS, and move through ground that an earlier run had already reached.

Every time the top-left line shows SHADERS COMPILING: n LEFT the picture stops for one to three
seconds. Every run: yes. Every run also adds a few hundred pipeline keys the next run then has to
make or load.

Output

start:

INFO leonida_gpu::pipeline::known: title pipelines known from earlier runs pipelines=83576 shaders=19110
INFO leonida_gpu::pipeline::library: title pipelines to start early pipelines=3136
INFO leonida_gpu::pipeline::library: host pipeline library loaded bytes=278055236 mapped=true

end of the same run:

INFO leonida_gpu::pipeline::library: host pipeline library saved bytes=308351702 early=3704 made=522 loaded=2814 started_early=2623

Gaps between two log records of more than 0.5 s: 63, 69.1 s of a 514 s run (13 %). 36 of them
(45.9 s) are closed by a host-pipeline-made line, 19 of those for a compute pipeline. The ten
largest gaps are all of that shape:

INFO leonida_gpu::pipeline: shader translated stage="compute" hash=e107201b7701a928 masked=false user_data=4 samplers=7
      ... 2.62 s, nothing at all in the log ...
INFO leonida_gpu::pipeline::host: host pipeline shaders=[compute e107201b7701a928]
INFO leonida_gpu::pipeline: shader translated stage="compute" hash=46dc6c870454c7a6 masked=false user_data=4 samplers=7
      ... 2.60 s ...
INFO leonida_gpu::pipeline::host: host pipeline shaders=[compute 46dc6c870454c7a6]

(12 other gaps sit exactly at 1.00 s and are most likely the once-a-second reporter, so the count
above only takes what the log can attribute.)

The layer's own counts, the worst five seconds of the run:

INFO leonida_gpu::copystat: recording per frame (38 frames): 31875 list calls 839.3 ms (all recording threads); 723.5 ms waiting for pipelines; ...
INFO leonida_gpu::host: 4.0 fps, 250.8 ms/frame (20.3 preparing: copies 9.3 ms 69.3 MB, textures 0.5 ms 5.1 MB; 0.0 on the GPU; 5.9 copying back 0.8 MB), 3819 draws/frame

Adding frames x ms waiting for pipelines over all 95 five-second samples of the run:
267 thread-seconds waited for pipelines. The fps line goes from 60.1 (menus, loading) down to
0.2, 1.0 and 1.2 in those moments. Over the run slow-pipelines.txt grew 449 to 473 lines and
early-pipelines.txt 3136 to 3704, while only 36 shader files were written to the cache during
the whole run - so the translation is not what costs here, making the host pipeline is.

What I would like to ask

  1. Is warm without --used (the 83576 known pipelines) the intended way to reach the steady
    state? The launcher only ever runs warm --used, so a run keeps meeting pipelines that were
    written down but never made; 2966 of them go through in 4 s, so the whole set does not look
    unreasonable, but nothing says how long it takes or that it is expected.
  2. slow-pipelines.txt already knows which keys took over a second. Queue::push_as puts those in
    the slow deque, which only orders what is queued already, and make::early() starts one ahead
    of time only when wanted_early(key) holds - used(), or LEONIDA_EARLY_ALL=1. Could the keys
    recorded as slow join the early-start set when the device is made, so a pipeline that has blocked
    a frame once is never awaited again?
  3. LEONIDA_EARLY_ALL=1 is what I would try next for a second and later visit of the same ground.
    Is that the expected way, or does it cost too much at start-up to be more than a debugging step?

Two warnings of the same log, both already reported

Only as another data point, not a new report: #3016 (LOCAL dynamic descriptor slots on a capped view heap slots=499999 title_in_place=500000 and host view heap capped at 1000000; views past it read a null slot count=1245184) and #2831 (the renderer port 2: a view record in the title's heap that no store told of fallback, 8683 lines of it in this log).

One more observation, and a different topic (I will open its own issue if you prefer)

In the same windows, the recording threads alone spend 662 to 839 ms a frame on list calls while
the same line says 0.0 on the GPU, at a median of 4086 draws a frame (max 7195). So in the world
the run looks bound by recording rather than by the card, and a lower render height does not help
that part; I have the 95 samples of fps, ms/frame, list calls and waiting for pipelines if
a separate report is wanted.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:6743185448 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3103). Originally posted by [ldx-007](https://github.com/ldx-007) on 2026-12-02T11:02:18Z. --- ### What happens Even with every shader of the title coming out of the translation cache in 1 s and `warm --used` done, an 8 1/2 minute run still makes **522 host pipelines while the title plays** (`host pipeline library saved ... made=522 loaded=2814`), and each of the big ones freezes the picture for 1 to 2.6 s while `SHADERS COMPILING: n LEFT` stands next to the frame rate. ### Commit `30742ccb1` of my fork `ldx-007/mandy`, which is upstream `main` at `393901a5b` plus two `.github/workflows/` commits only (no runtime file touched). The exe is that workflow's build of the `diag` profile, `built-with.txt` = `diagnostics,dlss,mimalloc`. ### System Windows 11 Insider build 26300 x64, Ryzen 7 9800X3D, 64 GB, RTX 5080 16 GB (driver 32.0.16.2124), HAGS on. Xbox Series package 1.0.2.1, Series S profile, DLSS on. ### Where pipelines ### Command and steps Started through `scripts/play-d3d12.ps1 -Game <the title's folder> -Data <a folder outside the checkout>`. 1. `leonida shaders <the title's folder>\shaders.rpf`, run from a window holding exactly the `LEONIDA_*` settings that same play start uses (taken from `play-nvidia.ps1 -DryRun`): `25687 shaders in the cache, 202 do not translate, 1 s`. 2. `leonida warm --used`: `83576 pipelines known, 2966 made before (06d3d9d172e378a7), 0 bad; 0 to make, 10 processes` then `2966 of 2966 in the pipeline library, written in 4 s`. 3. Play, Series S with DLSS, and move through ground that an earlier run had already reached. Every time the top-left line shows `SHADERS COMPILING: n LEFT` the picture stops for one to three seconds. Every run: yes. Every run also adds a few hundred pipeline keys the next run then has to make or load. ### Output start: ```text INFO leonida_gpu::pipeline::known: title pipelines known from earlier runs pipelines=83576 shaders=19110 INFO leonida_gpu::pipeline::library: title pipelines to start early pipelines=3136 INFO leonida_gpu::pipeline::library: host pipeline library loaded bytes=278055236 mapped=true ``` end of the same run: ```text INFO leonida_gpu::pipeline::library: host pipeline library saved bytes=308351702 early=3704 made=522 loaded=2814 started_early=2623 ``` Gaps between two log records of more than 0.5 s: **63, 69.1 s of a 514 s run (13 %)**. 36 of them (45.9 s) are closed by a host-pipeline-made line, 19 of those for a compute pipeline. The ten largest gaps are all of that shape: ```text INFO leonida_gpu::pipeline: shader translated stage="compute" hash=e107201b7701a928 masked=false user_data=4 samplers=7 ... 2.62 s, nothing at all in the log ... INFO leonida_gpu::pipeline::host: host pipeline shaders=[compute e107201b7701a928] INFO leonida_gpu::pipeline: shader translated stage="compute" hash=46dc6c870454c7a6 masked=false user_data=4 samplers=7 ... 2.60 s ... INFO leonida_gpu::pipeline::host: host pipeline shaders=[compute 46dc6c870454c7a6] ``` (12 other gaps sit exactly at 1.00 s and are most likely the once-a-second reporter, so the count above only takes what the log can attribute.) The layer's own counts, the worst five seconds of the run: ```text INFO leonida_gpu::copystat: recording per frame (38 frames): 31875 list calls 839.3 ms (all recording threads); 723.5 ms waiting for pipelines; ... INFO leonida_gpu::host: 4.0 fps, 250.8 ms/frame (20.3 preparing: copies 9.3 ms 69.3 MB, textures 0.5 ms 5.1 MB; 0.0 on the GPU; 5.9 copying back 0.8 MB), 3819 draws/frame ``` Adding `frames x ms waiting for pipelines` over all 95 five-second samples of the run: **267 thread-seconds waited for pipelines**. The fps line goes from 60.1 (menus, loading) down to 0.2, 1.0 and 1.2 in those moments. Over the run `slow-pipelines.txt` grew 449 to 473 lines and `early-pipelines.txt` 3136 to 3704, while only **36** shader files were written to the cache during the whole run - so the translation is not what costs here, making the host pipeline is. ### What I would like to ask 1. Is `warm` without `--used` (the 83576 known pipelines) the intended way to reach the steady state? The launcher only ever runs `warm --used`, so a run keeps meeting pipelines that were written down but never made; 2966 of them go through in 4 s, so the whole set does not look unreasonable, but nothing says how long it takes or that it is expected. 2. `slow-pipelines.txt` already knows which keys took over a second. `Queue::push_as` puts those in the `slow` deque, which only orders what is queued already, and `make::early()` starts one ahead of time only when `wanted_early(key)` holds - `used()`, or `LEONIDA_EARLY_ALL=1`. Could the keys recorded as slow join the early-start set when the device is made, so a pipeline that has blocked a frame once is never awaited again? 3. `LEONIDA_EARLY_ALL=1` is what I would try next for a second and later visit of the same ground. Is that the expected way, or does it cost too much at start-up to be more than a debugging step? ### Two warnings of the same log, both already reported Only as another data point, not a new report: #3016 (`LOCAL dynamic descriptor slots on a capped view heap slots=499999 title_in_place=500000` and `host view heap capped at 1000000; views past it read a null slot count=1245184`) and #2831 (the `renderer port 2: a view record in the title's heap that no store told of` fallback, 8683 lines of it in this log). ### One more observation, and a different topic (I will open its own issue if you prefer) In the same windows, the recording threads alone spend 662 to 839 ms a frame on list calls while the same line says `0.0 on the GPU`, at a median of 4086 draws a frame (max 7195). So in the world the run looks bound by recording rather than by the card, and a lower render height does not help that part; I have the 95 samples of `fps`, `ms/frame`, `list calls` and `waiting for pipelines` if a separate report is wanted.
lixonik commented 2026-12-02 14:35:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T14:35:08Z.


finding: code walkthrough answering the three questions in #3103 (inspected against main 69cd4106c):

  1. Is warm without --used (-PrecompileAll) the intended way to reach steady state?
    Yes. warm --used only precompiles the keys already recorded in early-pipelines.txt (3136 at start -> 3704 at exit in your log, +568 newly seen keys matching made=522). Any new area, LOD, or target/sampler variant encountered during play still has to be compiled on demand until it enters early-pipelines.txt or the driver cache.
    Running -PrecompileAll (leonida warm without --used) compiles all known keys from known-pipelines.bin ahead of time into the driver's on-disk cache. Note d3d12/apps/leonida/src/warm.rs:162-173 (into_library): even with -PrecompileAll, only early-pipelines.txt keys are packed into host-pipelines.bin (never-drawn keys are intentionally left in the driver's own disk cache because packing ~85k entries into host-pipelines.bin caused DEVICE_REMOVED on burst loads). Once a newly met key is in the driver cache, its first Create*PipelineState during play hits the driver cache rather than doing a 1-2.6 s cold DXIL->SASS compile.
    One extra caveat (warm.rs:179-189, driver_mark): NVIDIA keys its shader cache by executable filename, so if Smooth Motion is active on your launch (leonida_sm.exe), running leonida.exe warm manually populates leonida.exe's driver cache rather than leonida_sm.exe's; launching with -PrecompileAll through the script keeps them aligned.

  2. Should slow-pipelines.txt join the early-start set?
    Yes -- open PR #3132 (D3D12-PIPELINE-WAIT-AND-SLOW-EARLY) directly implements this alongside per-pipeline waiter wakeups and priority donation for live draw/dispatch waiters over background early compiles.

  3. Should LEONIDA_EARLY_ALL=1 be used for normal play?
    No -- as noted in d3d12/crates/leonida-gpu/src/pipeline/known.rs:10-13, starting all ~84k pipelines in-process inside the running game has crashed inside the driver compiler and causes heavy startup CPU/RAM contention. Out-of-process leonida warm (-PrecompileAll) is the intended path because a hanging or crashing driver compile only kills one child worker and records that key in warm-bad.txt.

  4. On the extra observation (list calls 839.3 ms ... 723.5 ms waiting for pipelines; 0.0 on the GPU):
    In those windows, list calls is summed across all recording threads and includes the 723.5 ms blocked on those synchronous pipeline compiles; while recording threads stall on compiles, the GPU queue drains to 0.0 ms. Checking a steady-state 5 s window where waiting for pipelines is 0.0 ms will separate real recording-thread overhead from compile-wait inflation (if you still see high recording ms with 0.0 ms pipeline wait, a separate issue with those steady-state samples would be useful).

AI-assisted: yes (Antigravity).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7348795220 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3103#issuecomment-7348795220). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T14:35:08Z. --- finding: code walkthrough answering the three questions in #3103 (inspected against `main` `69cd4106c`): 1. **Is `warm` without `--used` (`-PrecompileAll`) the intended way to reach steady state?** Yes. `warm --used` only precompiles the keys already recorded in `early-pipelines.txt` (`3136` at start -> `3704` at exit in your log, `+568` newly seen keys matching `made=522`). Any new area, LOD, or target/sampler variant encountered during play still has to be compiled on demand until it enters `early-pipelines.txt` or the driver cache. Running `-PrecompileAll` (`leonida warm` without `--used`) compiles all known keys from `known-pipelines.bin` ahead of time into the driver's on-disk cache. Note `d3d12/apps/leonida/src/warm.rs:162-173` (`into_library`): even with `-PrecompileAll`, only `early-pipelines.txt` keys are packed into `host-pipelines.bin` (never-drawn keys are intentionally left in the driver's own disk cache because packing ~85k entries into `host-pipelines.bin` caused `DEVICE_REMOVED` on burst loads). Once a newly met key is in the driver cache, its first `Create*PipelineState` during play hits the driver cache rather than doing a 1-2.6 s cold DXIL->SASS compile. One extra caveat (`warm.rs:179-189`, `driver_mark`): NVIDIA keys its shader cache by executable filename, so if Smooth Motion is active on your launch (`leonida_sm.exe`), running `leonida.exe warm` manually populates `leonida.exe`'s driver cache rather than `leonida_sm.exe`'s; launching with `-PrecompileAll` through the script keeps them aligned. 2. **Should `slow-pipelines.txt` join the early-start set?** Yes -- open PR #3132 (`D3D12-PIPELINE-WAIT-AND-SLOW-EARLY`) directly implements this alongside per-pipeline waiter wakeups and priority donation for live draw/dispatch waiters over background early compiles. 3. **Should `LEONIDA_EARLY_ALL=1` be used for normal play?** No -- as noted in `d3d12/crates/leonida-gpu/src/pipeline/known.rs:10-13`, starting all ~84k pipelines in-process inside the running game has crashed inside the driver compiler and causes heavy startup CPU/RAM contention. Out-of-process `leonida warm` (`-PrecompileAll`) is the intended path because a hanging or crashing driver compile only kills one child worker and records that key in `warm-bad.txt`. 4. **On the extra observation (`list calls 839.3 ms ... 723.5 ms waiting for pipelines; 0.0 on the GPU`):** In those windows, `list calls` is summed across all recording threads and includes the `723.5 ms` blocked on those synchronous pipeline compiles; while recording threads stall on compiles, the GPU queue drains to `0.0 ms`. Checking a steady-state 5 s window where `waiting for pipelines` is `0.0 ms` will separate real recording-thread overhead from compile-wait inflation (if you still see high recording ms with `0.0 ms` pipeline wait, a separate issue with those steady-state samples would be useful). AI-assisted: yes (Antigravity).
daxtron2 commented 2026-12-03 03:54:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by daxtron2 on 2026-12-03T03:54:55Z.


Another data point, with -PrecompileAll (the launcher's default, which precompiles every known pipeline) instead of warm --used. Pipelines that warm had precompiled still got compiled again in play, so on my setup the driver's disk cache isn't keeping what warm puts into it. That also bears on question 1 above: -PrecompileAll didn't get me to a steady state.

Setup: main at 2791b7756, diag build (diagnostics,dlss,mimalloc), started through Launcher.bat and play-nvidia.ps1 with Series S and DLSS. There's no leonida_sm.exe in the build folder, so precompile and the game both ran as leonida.exe. RTX 5080 16 GB, driver 621.47, Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26200. Shader Cache Size is Unlimited in the NVIDIA control panel. I may have changed that while run 2 was still going; it was set before run 3 started.

I played the same save three times in one evening, from the intro cutscene into the prison prologue. Run 1 had no log, so the table covers runs 2 and 3.

Run 2 Run 3
Title pipelines known at start 83,558 88,565
Pipelines warm had recorded as made (warm-done.txt) 85,416 about 5,000 more, done within seconds
host pipeline library loaded 192 MB 274 MB
library saved at the end made=592, loaded=1,920 (force-closed) made=310, loaded=2,720, 297 MB
Worst five seconds 17.4 s/frame, 73,031 ms waiting for pipelines (all recording threads) 1.2 s/frame, 1,184 ms waiting
Steady world frames, 0 ms pipeline waits 60-85 ms 29-59 ms

To check whether the slow ones had been precompiled, I compared keys across the cache files (counts only):

  • Run 3 drew 760 pipelines for the first time (early-pipelines.txt went from 2,600 to 3,360). 709 of them were in warm-done.txt from that run's own precompile, including both pipelines slow-pipelines.txt gained in run 3, at 1.9 s and 2.5 s to make.
  • For run 2, 2,174 of the 2,186 keys in slow-pipelines.txt (median 1.8 s, p90 4.2 s, max 19.8 s) were in warm-done.txt. That file includes earlier runs, so I'd weigh it less than the run 3 numbers.
  • Run 3's precompile got through its ~5,000 pipelines in a few seconds, too fast for real compiles. Either warm marked them done without building them, or it built them and the game asks for something that doesn't match. I don't have that run's N made in X s summary line to tell which. I'll grab it next run.

#3132 (starting slow keys early) and #3150 (building drawn pipelines straight into the library) would cover pipelines that have been drawn before. Neither helps a precompiled pipeline that has never been drawn and misses the driver cache the first time it's used.

AI-assisted (Claude Code). Numbers come from my own logs and cache files; no game data.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7367069099 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3103#issuecomment-7367069099). Originally posted by [daxtron2](https://github.com/daxtron2) on 2026-12-03T03:54:55Z. --- Another data point, with `-PrecompileAll` (the launcher's default, which precompiles every known pipeline) instead of `warm --used`. Pipelines that `warm` had precompiled still got compiled again in play, so on my setup the driver's disk cache isn't keeping what `warm` puts into it. That also bears on question 1 above: `-PrecompileAll` didn't get me to a steady state. Setup: `main` at `2791b7756`, `diag` build (`diagnostics,dlss,mimalloc`), started through `Launcher.bat` and `play-nvidia.ps1` with Series S and DLSS. There's no `leonida_sm.exe` in the build folder, so precompile and the game both ran as `leonida.exe`. RTX 5080 16 GB, driver 621.47, Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26200. Shader Cache Size is Unlimited in the NVIDIA control panel. I may have changed that while run 2 was still going; it was set before run 3 started. I played the same save three times in one evening, from the intro cutscene into the prison prologue. Run 1 had no log, so the table covers runs 2 and 3. | | Run 2 | Run 3 | |---|---|---| | Title pipelines known at start | 83,558 | 88,565 | | Pipelines `warm` had recorded as made (`warm-done.txt`) | 85,416 | about 5,000 more, done within seconds | | `host pipeline library loaded` | 192 MB | 274 MB | | `library saved` at the end | made=592, loaded=1,920 (force-closed) | made=310, loaded=2,720, 297 MB | | Worst five seconds | 17.4 s/frame, 73,031 ms waiting for pipelines (all recording threads) | 1.2 s/frame, 1,184 ms waiting | | Steady world frames, 0 ms pipeline waits | 60-85 ms | 29-59 ms | To check whether the slow ones had been precompiled, I compared keys across the cache files (counts only): - Run 3 drew 760 pipelines for the first time (`early-pipelines.txt` went from 2,600 to 3,360). 709 of them were in `warm-done.txt` from that run's own precompile, including both pipelines `slow-pipelines.txt` gained in run 3, at 1.9 s and 2.5 s to make. - For run 2, 2,174 of the 2,186 keys in `slow-pipelines.txt` (median 1.8 s, p90 4.2 s, max 19.8 s) were in `warm-done.txt`. That file includes earlier runs, so I'd weigh it less than the run 3 numbers. - Run 3's precompile got through its ~5,000 pipelines in a few seconds, too fast for real compiles. Either `warm` marked them done without building them, or it built them and the game asks for something that doesn't match. I don't have that run's `N made in X s` summary line to tell which. I'll grab it next run. #3132 (starting slow keys early) and #3150 (building drawn pipelines straight into the library) would cover pipelines that have been drawn before. Neither helps a precompiled pipeline that has never been drawn and misses the driver cache the first time it's used. AI-assisted (Claude Code). Numbers come from my own logs and cache files; no game data.
kaoru-maki commented 2026-12-03 05:28:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by kaoru-maki on 2026-12-03T05:28:28Z.


With #3172, full warm-up attempts every PSO key recorded before warm-up. Could the first-use report show whether the key was in the warm-up snapshot, what happened during warm-up, and whether the runtime loaded or compiled it? It would also help to record how long the first caller waited.

Synthetic test. A is warmed and ready at first use. B is a new render-target-format variant that is first compiled on demand. C is warmed, then its runtime library lookup is forced to miss and it is compiled again. The report should distinguish all three cases.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368777774 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3103#issuecomment-7368777774). Originally posted by [kaoru-maki](https://github.com/kaoru-maki) on 2026-12-03T05:28:28Z. --- With #3172, full warm-up attempts every PSO key recorded before warm-up. Could the first-use report show whether the key was in the warm-up snapshot, what happened during warm-up, and whether the runtime loaded or compiled it? It would also help to record how long the first caller waited. Synthetic test. A is warmed and ready at first use. B is a new render-target-format variant that is first compiled on demand. C is warmed, then its runtime library lookup is forced to miss and it is compiled again. The report should distinguish all three cases.
kaoru-maki commented 2026-12-03 05:28:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by kaoru-maki on 2026-12-03T05:28:31Z.


A shutdown and reload test would help document LEONIDA_LIBRARY_PLAY_SAVE_MB. The threshold applies to writes during a run. A library above that threshold should be saved on clean exit and available for the next launch.

Synthetic test. Use an isolated cache directory and set the in-session write limit to zero. Create one synthetic PSO, exit through the normal shutdown path, and wait for shutdown to finish. Restart on the same device and assert that the PSO loads from the saved library.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368778660 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3103#issuecomment-7368778660). Originally posted by [kaoru-maki](https://github.com/kaoru-maki) on 2026-12-03T05:28:31Z. --- A shutdown and reload test would help document `LEONIDA_LIBRARY_PLAY_SAVE_MB`. The threshold applies to writes during a run. A library above that threshold should be saved on clean exit and available for the next launch. Synthetic test. Use an isolated cache directory and set the in-session write limit to zero. Create one synthetic PSO, exit through the normal shutdown path, and wait for shutdown to finish. Restart on the same device and assert that the PSO loads from the saved library.
sdpiter commented 2026-12-03 08:44:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by sdpiter on 2026-12-03T08:44:17Z.


Another data point after a full warm (no --used), plus a same-machine control from another runtime of the same title.

Machine. Windows 11 26H2 (26300.9974), Ryzen 7 5700G, 32 GB RAM, RTX 4070 Ti 12 GB, driver 621.40. NVIDIA Shader Cache Size = Unlimited (set before the warm).

Build. Upstream main d9b618f10150f275c30088e4769c1acbf1d8d689 (includes #3154 and #3230), built from source with d3d12/scripts/build-nvidia.ps1: diag profile, built-with.txt = diagnostics,dlss,mimalloc, its own cache folder.

Steps.

  1. leonida shaders <the title's folder>: 25783 shaders in the cache, 202 do not translate, 131 s.
  2. leonida warm (full):
    83553 pipelines known, 0 made before, 0 bad; 83553 to make, 8 processes
    83553 made in 1978 s (7 have no host pipeline, 0 ended their process); ms each: median 2.2, p90 284.1, p99 4775.3, most 23778.
  3. Play: leonida.exe run <title> --execute --console series-x; Series X profile, 2560x1440 output, the title's own dynamic resolution from 0.75, LEONIDA_FRAME_GEN=0 (frame generation off), DLSS not used, LEONIDA_THIN=1 on 6 threads. 13:02, closed with WM_CLOSE, exit 0x00000000.

What the run still made. At exit:
host pipeline library saved bytes=296114760 early=3059 made=493 loaded=2595 started_early=2393
— 493 host pipelines made while the title played, after the full warm and with the driver cache Unlimited.

Freezes. 129 periodic in-world frame lines (more than 1000 draws): 18 frames over 500 ms, worst 6.3 s; in-world median 56.7 ms at 5.0–7.5k draws. The runtime's own summary in one window:
frame times over 13.0 s, 96 frames: median 48.6 ms, 95th percentile 64.9, 99th 8241.8, longest 8241.8; 1 over 100 ms, 1 over 1 s.

Two examples, with the lines around them:

  • 08:06:54.829 4738 ms, 4454 draws and 08:07:05.017 5094 ms, 4458 draws — the twelve lines before each are the runtime's periodic reports only, no pipeline line among them.
  • 08:13:01.207 first bind pipeline=... stage="compute" → 08:13:01.482 host pipeline shaders=[compute b01e713adfd1b66a] → 08:13:05.195 host pipeline shaders=[compute 592680ab38031b20]: one compute build spans about 3.7 s of log.
  • 08:13:10.774 host mesh pipeline shaders=[mesh 8a1dba33b00fc298, pixel 428832e0a62f137f masked] — a masked variant built during the same stretch, which matches the masked-twin finding in #3105 (and #3200).

Control: another runtime of the same title, same PC, same day. Darner v2026.12.02.02 (fa84f7e6, built from source), DLSS off, frame generation off, its own warm (73536 pipelines known, 66596 made in 950 s), 12:50 in the world, exit 0. There: 2 frames over 500 ms, worst 1.0 s (host pipelines all made made=78 loaded=2239 started_early=3911), and the two stalls read
a pass over the screen was waited for (DARNER_SCREEN_WAIT_MS=0: dropped past half a second a frame) ms=4828 made=true.

Caveats. The two runtimes were not on the same camera/scene, so this is not a speed A/B. Mandy drops about 210 draws a frame on purpose in this configuration (skip list and the structure builder off), Darner drops 0, so equal draw counts are not equal work. Card use: Mandy 9.7 of a 10.7 GB budget; Darner 11.7 of 10.9 GB plus 5.1 GB shared.

What I take from it. A full warm did not reach a steady state here either, and the freezes that remain line up with #3103's on-demand host pipelines and with #3105/#3200's masked twins. The sibling runtime, whose warm also fills its own pipeline library and which builds 78 host pipelines during the run, does not show them — so it looks less like the driver cache and more like where and when the pipeline is built. Happy to run a build with #3200 or any diagnostic switch you point at (stall timeline, LEONIDA_PIPELINE_WAIT_MS) and report the same numbers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7372672712 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3103#issuecomment-7372672712). Originally posted by [sdpiter](https://github.com/sdpiter) on 2026-12-03T08:44:17Z. --- Another data point after a **full** `warm` (no `--used`), plus a same-machine control from another runtime of the same title. **Machine.** Windows 11 26H2 (26300.9974), Ryzen 7 5700G, 32 GB RAM, RTX 4070 Ti 12 GB, driver 621.40. NVIDIA Shader Cache Size = Unlimited (set before the warm). **Build.** Upstream `main` `d9b618f10150f275c30088e4769c1acbf1d8d689` (includes #3154 and #3230), built from source with `d3d12/scripts/build-nvidia.ps1`: `diag` profile, `built-with.txt` = `diagnostics,dlss,mimalloc`, its own cache folder. **Steps.** 1. `leonida shaders <the title's folder>`: `25783 shaders in the cache, 202 do not translate, 131 s`. 2. `leonida warm` (full): `83553 pipelines known, 0 made before, 0 bad; 83553 to make, 8 processes` `83553 made in 1978 s (7 have no host pipeline, 0 ended their process); ms each: median 2.2, p90 284.1, p99 4775.3, most 23778`. 3. Play: `leonida.exe run <title> --execute --console series-x`; Series X profile, 2560x1440 output, the title's own dynamic resolution from 0.75, `LEONIDA_FRAME_GEN=0` (frame generation off), DLSS not used, `LEONIDA_THIN=1` on 6 threads. 13:02, closed with `WM_CLOSE`, exit `0x00000000`. **What the run still made.** At exit: `host pipeline library saved bytes=296114760 early=3059 made=493 loaded=2595 started_early=2393` — **493 host pipelines made while the title played**, after the full warm and with the driver cache Unlimited. **Freezes.** 129 periodic in-world frame lines (more than 1000 draws): **18 frames over 500 ms**, worst **6.3 s**; in-world median 56.7 ms at 5.0–7.5k draws. The runtime's own summary in one window: `frame times over 13.0 s, 96 frames: median 48.6 ms, 95th percentile 64.9, 99th 8241.8, longest 8241.8; 1 over 100 ms, 1 over 1 s`. Two examples, with the lines around them: * `08:06:54.829 4738 ms, 4454 draws` and `08:07:05.017 5094 ms, 4458 draws` — the twelve lines before each are the runtime's periodic reports only, no pipeline line among them. * `08:13:01.207 first bind pipeline=... stage="compute"` → `08:13:01.482 host pipeline shaders=[compute b01e713adfd1b66a]` → `08:13:05.195 host pipeline shaders=[compute 592680ab38031b20]`: one compute build spans about 3.7 s of log. * `08:13:10.774 host mesh pipeline shaders=[mesh 8a1dba33b00fc298, pixel 428832e0a62f137f masked]` — a **masked** variant built during the same stretch, which matches the masked-twin finding in #3105 (and #3200). **Control: another runtime of the same title, same PC, same day.** Darner `v2026.12.02.02` (`fa84f7e6`, built from source), DLSS off, frame generation off, its own `warm` (`73536 pipelines known`, `66596 made in 950 s`), 12:50 in the world, exit 0. There: **2 frames over 500 ms, worst 1.0 s** (`host pipelines all made made=78 loaded=2239 started_early=3911`), and the two stalls read `a pass over the screen was waited for (DARNER_SCREEN_WAIT_MS=0: dropped past half a second a frame) ms=4828 made=true`. **Caveats.** The two runtimes were not on the same camera/scene, so this is not a speed A/B. Mandy drops about 210 draws a frame on purpose in this configuration (skip list and the structure builder off), Darner drops 0, so equal draw counts are not equal work. Card use: Mandy 9.7 of a 10.7 GB budget; Darner 11.7 of 10.9 GB plus 5.1 GB shared. **What I take from it.** A full `warm` did not reach a steady state here either, and the freezes that remain line up with #3103's on-demand host pipelines and with #3105/#3200's masked twins. The sibling runtime, whose warm also fills its own pipeline library and which builds 78 host pipelines during the run, does not show them — so it looks less like the driver cache and more like **where and when** the pipeline is built. Happy to run a build with #3200 or any diagnostic switch you point at (stall timeline, `LEONIDA_PIPELINE_WAIT_MS`) and report the same numbers.
Sign in to join this conversation.
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#3103
No description provided.