d3d12: 300-800 ms freezes in the world come from one list-translation thread busy in a single list call (3 stall traces) #3105

Open
opened 2026-12-02 11:03:44 +00:00 by TripyFox · 5 comments
TripyFox commented 2026-12-02 11:03:44 +00:00 (Migrated from github.com)
Contributor

Imported from ubiquitarianism/leonida. Originally posted by TripyFox on 2026-12-02T11:03:44Z.


What happens

In the open world the picture freezes for 0.3 to 2 s every so often (in a 3.5 min sample: 51 frames over 100 ms, 5 over 1 s). I caught three of them with the stall trace (LEONIDA_TIMELINE_STALL_MS=250). All three are the same: one leonida-list-N thread is inside a single "a long list call" for the whole freeze and is running, not waiting (0 to 20 ms of recorded waits inside it). The submitting thread, the uploads-ahead and views threads, and the title's present all wait behind it. The pipeline workers are idle. No error.

Commit

5ec08c383 (built with d3d12\scripts\build-nvidia.ps1, diag profile, features diagnostics,dlss,mimalloc)

System

Windows 11 Pro 10.0.26200, AMD Ryzen 7 9800X3D, 64 GB RAM, NVIDIA GeForce RTX 5090 32 GB, driver 621.40

Where

runtime (d3d12/ runtime, leonida.exe, in the running game)

Command and steps

scripts\play-d3d12.ps1 -Game <game folder> -Data <data folder> -Log -Resolution 1440 -NoFrameGen -More @{LEONIDA_REAPER='0'; LEONIDA_OUTPUT='3840x2160'; LEONIDA_PIPELINE_WAIT_MS='1000'; LEONIDA_TIMELINE='<traces>\stall-0N.json'; LEONIDA_TIMELINE_STALL_MS='250'; LEONIDA_TIMELINE_AT='120'}

Series X, the title's own upscaler at a fixed 0.6667 into a 4K output, no frame generation. Load a save in the open world and drive or walk around; in that 3.5 min sample, 21 of 30 five-second windows in the world had a frame over 100 ms. One trace per start (the stall mode is one-shot), three starts, the same save.

Trace Freeze (present to present) The thread in a long list call Its call Waits recorded inside it Who waited on it
1 799.8 ms leonida-list-3 802 ms, began 17 ms before the freeze 19.7 ms leonida-submit, leonida-ahead, uploads ahead 0/1, leonida-views-1..3; the title's present 775 ms
2 324.2 ms leonida-list-5 318 ms, began 9 ms before 0 leonida-list-4 277.5 ms (WaitOnAddress, linked to leonida-list-5); the other list threads ~270 ms, linked to the title's threads
3 485.2 ms leonida-list-1 487 ms, began 14 ms before 0 the title's present 455 ms

What the traces rule out, as far as stall mode can see:

  • Pipelines: all twelve leonida-pipelines-N workers sat in one WaitOnAddress from before the freeze to after it, in trace 1. Only in trace 1 did the list thread wake the pipeline workers as its call began (and was woken back by leonida-pipelines-5 after 3.2 ms); traces 2 and 3 have no such hand-off. The run's recording per frame ... ms waiting for pipelines is 0 in almost every 5-second window with a stutter.
  • The card: CPU-side submissions just stop during the freeze (trace 1: 8 submissions in the first 16 ms, then none until 790 ms), and nothing waits on a fence.
  • Streaming: streaming: a request / inflating / unpacking BCPack keep running during the freeze (trace 1: 395 requests, 242 ms), and nothing waits on them.
  • No the library did not load it lines in any of these runs (so not #2781).

One more thing from trace 1's run: the log is silent from all threads for the 750 ms of the freeze (no periodic lines either), then resumes.

Stall mode records no stacks, so I can't tell which code inside the list call takes the time. I can run the timed mode or anything else you'd like (a LEONIDA_* switch to try, a test build) and send the .txt summaries.

The investigation and this report were AI-assisted (Claude Opus 5.5).

Output

No error; the trace summaries' headlines (exe hash in thread names replaced by <image>):

stall-01: trigger interval: 799.75 ms (threshold 250 ms, inclusive)
  trigger interval ... the chain it came out of, by cause
     782.17 ms  a long list call
  trigger chain by thread
     782.50 ms  18928 "leonida-list-3"
      10.92 ms  21680 "leonida-submit"
       3.21 ms  6544 "leonida-pipelines-5"
  spans ... in trigger interval
     904.05 ms in    176, longest 785.35  a long list call
     774.98 ms in      1, longest 774.98  the title's Present

stall-02: trigger interval: 324.21 ms
  spans ... in trigger interval
     649.26 ms in    299, longest 308.17  a long list call
  completed waits
     277.54 ms in 1, longest 277.54  15988 "leonida-list-4" | WaitOnAddress | linked to 21284 "leonida-list-5"

stall-03: trigger interval: 485.19 ms
  trigger chain by thread
     474.03 ms  19328 "leonida-list-1"
       8.92 ms  20416 "leonida-submit"
  spans ... in trigger interval
     550.68 ms in    292, longest 473.38  a long list call
     455.20 ms in      1, longest 455.20  the title's Present
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:6743211280 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3105). Originally posted by [TripyFox](https://github.com/TripyFox) on 2026-12-02T11:03:44Z. --- ### What happens In the open world the picture freezes for 0.3 to 2 s every so often (in a 3.5 min sample: 51 frames over 100 ms, 5 over 1 s). I caught three of them with the stall trace (`LEONIDA_TIMELINE_STALL_MS=250`). All three are the same: **one `leonida-list-N` thread is inside a single "a long list call" for the whole freeze and is running, not waiting** (0 to 20 ms of recorded waits inside it). The submitting thread, the uploads-ahead and views threads, and the title's present all wait behind it. The pipeline workers are idle. No error. ### Commit 5ec08c383 (built with `d3d12\scripts\build-nvidia.ps1`, diag profile, features `diagnostics,dlss,mimalloc`) ### System Windows 11 Pro 10.0.26200, AMD Ryzen 7 9800X3D, 64 GB RAM, NVIDIA GeForce RTX 5090 32 GB, driver 621.40 ### Where runtime (`d3d12/` runtime, `leonida.exe`, in the running game) ### Command and steps ``` scripts\play-d3d12.ps1 -Game <game folder> -Data <data folder> -Log -Resolution 1440 -NoFrameGen -More @{LEONIDA_REAPER='0'; LEONIDA_OUTPUT='3840x2160'; LEONIDA_PIPELINE_WAIT_MS='1000'; LEONIDA_TIMELINE='<traces>\stall-0N.json'; LEONIDA_TIMELINE_STALL_MS='250'; LEONIDA_TIMELINE_AT='120'} ``` Series X, the title's own upscaler at a fixed 0.6667 into a 4K output, no frame generation. Load a save in the open world and drive or walk around; in that 3.5 min sample, 21 of 30 five-second windows in the world had a frame over 100 ms. One trace per start (the stall mode is one-shot), three starts, the same save. | Trace | Freeze (present to present) | The thread in a long list call | Its call | Waits recorded inside it | Who waited on it | |---|---|---|---|---|---| | 1 | 799.8 ms | `leonida-list-3` | 802 ms, began 17 ms before the freeze | 19.7 ms | `leonida-submit`, `leonida-ahead`, `uploads ahead 0/1`, `leonida-views-1..3`; the title's present 775 ms | | 2 | 324.2 ms | `leonida-list-5` | 318 ms, began 9 ms before | 0 | `leonida-list-4` 277.5 ms (`WaitOnAddress`, linked to `leonida-list-5`); the other list threads ~270 ms, linked to the title's threads | | 3 | 485.2 ms | `leonida-list-1` | 487 ms, began 14 ms before | 0 | the title's present 455 ms | What the traces rule out, as far as stall mode can see: - **Pipelines:** all twelve `leonida-pipelines-N` workers sat in one `WaitOnAddress` from before the freeze to after it, in trace 1. Only in trace 1 did the list thread wake the pipeline workers as its call began (and was woken back by `leonida-pipelines-5` after 3.2 ms); traces 2 and 3 have no such hand-off. The run's `recording per frame ... ms waiting for pipelines` is 0 in almost every 5-second window with a stutter. - **The card:** CPU-side submissions just stop during the freeze (trace 1: 8 submissions in the first 16 ms, then none until 790 ms), and nothing waits on a fence. - **Streaming:** `streaming: a request` / `inflating` / `unpacking BCPack` keep running during the freeze (trace 1: 395 requests, 242 ms), and nothing waits on them. - **No `the library did not load it` lines** in any of these runs (so not #2781). One more thing from trace 1's run: the log is silent from all threads for the 750 ms of the freeze (no periodic lines either), then resumes. Stall mode records no stacks, so I can't tell which code inside the list call takes the time. I can run the timed mode or anything else you'd like (a `LEONIDA_*` switch to try, a test build) and send the `.txt` summaries. The investigation and this report were AI-assisted (Claude Opus 5.5). ### Output ```text No error; the trace summaries' headlines (exe hash in thread names replaced by <image>): stall-01: trigger interval: 799.75 ms (threshold 250 ms, inclusive) trigger interval ... the chain it came out of, by cause 782.17 ms a long list call trigger chain by thread 782.50 ms 18928 "leonida-list-3" 10.92 ms 21680 "leonida-submit" 3.21 ms 6544 "leonida-pipelines-5" spans ... in trigger interval 904.05 ms in 176, longest 785.35 a long list call 774.98 ms in 1, longest 774.98 the title's Present stall-02: trigger interval: 324.21 ms spans ... in trigger interval 649.26 ms in 299, longest 308.17 a long list call completed waits 277.54 ms in 1, longest 277.54 15988 "leonida-list-4" | WaitOnAddress | linked to 21284 "leonida-list-5" stall-03: trigger interval: 485.19 ms trigger chain by thread 474.03 ms 19328 "leonida-list-1" 8.92 ms 20416 "leonida-submit" spans ... in trigger interval 550.68 ms in 292, longest 473.38 a long list call 455.20 ms in 1, longest 455.20 the title's Present ```
zmasi commented 2026-12-02 12:28:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T12:28:29Z.


Great traces — all six clues in your three stall dumps line up cleanly in the source, and two quick checks on the -Log file you already saved from Trace 1 can separate the remaining two culprits without even relaunching.

Why stall mode showed 0 ms of waits, 0 "the library did not load it" lines, and 750 ms of log silence

  1. Why "a long list call" recorded 0 ms of waits on leonida-list-N (timeline/hooks.rs, list.rs):
    • "a long list call" wraps list::with_state (State commands only).
    • timeline::hooks::wrap_imports() patches only leonida.exe's own static PE import table (WaitOnAddress, WaitForSingleObject, EnterCriticalSection, etc.). Direct COM vtable calls into d3d12core.dll / nvwgf2umx.dll / win32u.dll (CreateCommittedResource, CreateHeap, MakeResident / D3DKMTMakeResident, CreateGraphicsPipelineState, ID3D12Fence::SetEventOnCompletion(..., NULL)) and driver-internal locks record 0 Kind::Wait and 0 Kind::Kernel events.
    • Meanwhile, when a peer Rust thread (leonida-list-4 in Trace 2) blocks on a Rust Mutex / RwLock / OnceLock held by leonida-list-5, std calls leonida.exe's hooked WaitOnAddress — producing Trace 2's exact 277.54 ms WaitOnAddress linked to leonida-list-5.
    • (Note: we have D3D12-TIMELINE-STALL-LIST-OP in flight right now so LEONIDA_TIMELINE_STALL_MS records the exact list command op, caller return site, and bound pipeline key prefix on "a long list call" instead of a generic label.)
  2. Why grepping -Log for "the library did not load it" found nothing (pipeline/library.rs:615):
    • "the library did not load it" is only pushed into host::trail (the 64-entry in-memory ring dumped on device removal) — it is never written to -Log in a normal run. Actual runtime PSO compiles log host pipeline or host mesh pipeline (pipeline/host.rs).
  3. Why all threads went log-silent for 750 ms (host.rs Meter::frame):
    • leonida-meter is only signaled from inside Present. While Present waited 775 ms behind leonida-submit -> leonida-list-3, no Present completed to wake leonida-meter.

The two candidates inside list::with_state that match all three traces

  • Candidate 1 — Synchronous D3D12 allocation + MakeResident (D3DKMTMakeResident) under a global Rust table lock on leonida-list-N:
    • In Trace 1, uploads ahead 1 spent ~616 ms in unhooked CopyQueue fence completion (texture/ahead.rs SetEventOnCompletion(..., NULL)) and unblocked at the exact same moment leonida-list-3 finished — the signature of WDDM residency/paging work (amplified here by LEONIDA_REAPER='0' keeping retired resources resident).
    • Specifically, texture::staging() (texture.rs) still holds global texture::STAGING across pool::staging (64 MiB upload-pool growth -> CreateCommittedResource + MakeResident + Map, which pool.rs notes took 270–961 ms under VRAM pressure) and oversized host.upload_buffer(total), and shadow::lookup / shadow::loose (shadow.rs) hold BUFFERS.write() / LOOSE.write() across CreateCommittedResource + MakeResident (blocking peer leonida-list-M threads in WaitOnAddress as in Trace 2).
  • Candidate 2 — Synchronous sample-mask twin PSO compile on leonida-list-N (draw.rs -> pipeline/make.rs masked_for):
    • Unlike normal pipelines (make::ready on leonida-pipelines-0..N), make::masked_for (LEONIDA_SAMPLE_MASK=1, LOD-fade draws) calls p.make() synchronously on leonida-list-N under Pending.made: OnceLock — leaving all 12 leonida-pipelines-* workers completely idle, recording 0 ms in waiting for pipelines, and blocking any second list thread hitting the same masked pipeline in WaitOnAddress (Trace 2). Notice in Trace 1 leonida-list-3 woke from leonida-pipelines-5 after 3.21 ms (host_pipeline_for) right as the 782 ms call began (masked_for runs on the very next line of prepare_for when sample_mask != FULL_MASK).

Two quick checks (first one needs no relaunch)

  1. In your saved -Log from Trace 1 around the freeze:
    • Did a host pipeline or host mesh pipeline line print right as the ~780 ms gap ended? (If yes -> Candidate 2 masked_for.)
    • In the very next 5-second frame times over ... summary line after the freeze, what did waits for new memory to be resident ... ms a frame report? (If it spiked -> Candidate 1 MakeResident.)
  2. Optional isolation switches on the same save (no rebuild needed):
    • Try removing LEONIDA_REAPER='0' and adding LEONIDA_WAIT_RESIDENT='0' (isolates Candidate 1), or LEONIDA_SAMPLE_MASK='0' (isolates Candidate 2), or run timed mode LEONIDA_TIMELINE='120,30,<traces>\timed.json' without LEONIDA_TIMELINE_STALL_MS to capture stacks on list calls of 50 us or more.

AI-assisted (Gemini 4 Carbon High).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345394023 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3105#issuecomment-7345394023). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-02T12:28:29Z. --- Great traces — all six clues in your three stall dumps line up cleanly in the source, and two quick checks on the `-Log` file you already saved from Trace 1 can separate the remaining two culprits without even relaunching. ### Why stall mode showed `0 ms` of waits, `0` `"the library did not load it"` lines, and `750 ms` of log silence 1. **Why `"a long list call"` recorded `0 ms` of waits on `leonida-list-N` (`timeline/hooks.rs`, `list.rs`):** - `"a long list call"` wraps `list::with_state` (`State` commands only). - `timeline::hooks::wrap_imports()` patches only `leonida.exe`'s own static PE import table (`WaitOnAddress`, `WaitForSingleObject`, `EnterCriticalSection`, etc.). Direct COM vtable calls into `d3d12core.dll` / `nvwgf2umx.dll` / `win32u.dll` (`CreateCommittedResource`, `CreateHeap`, `MakeResident` / `D3DKMTMakeResident`, `CreateGraphicsPipelineState`, `ID3D12Fence::SetEventOnCompletion(..., NULL)`) and driver-internal locks record **`0` `Kind::Wait` and `0` `Kind::Kernel` events**. - Meanwhile, when a peer Rust thread (`leonida-list-4` in Trace 2) blocks on a Rust `Mutex` / `RwLock` / `OnceLock` held by `leonida-list-5`, `std` calls `leonida.exe`'s hooked `WaitOnAddress` — producing Trace 2's exact `277.54 ms` `WaitOnAddress` linked to `leonida-list-5`. - *(Note: we have `D3D12-TIMELINE-STALL-LIST-OP` in flight right now so `LEONIDA_TIMELINE_STALL_MS` records the exact list command op, caller return site, and bound pipeline key prefix on `"a long list call"` instead of a generic label.)* 2. **Why grepping `-Log` for `"the library did not load it"` found nothing (`pipeline/library.rs:615`):** - `"the library did not load it"` is only pushed into `host::trail` (the 64-entry in-memory ring dumped on device removal) — it is never written to `-Log` in a normal run. Actual runtime PSO compiles log `host pipeline` or `host mesh pipeline` (`pipeline/host.rs`). 3. **Why all threads went log-silent for `750 ms` (`host.rs` `Meter::frame`):** - `leonida-meter` is only signaled from inside `Present`. While `Present` waited `775 ms` behind `leonida-submit` -> `leonida-list-3`, no `Present` completed to wake `leonida-meter`. ### The two candidates inside `list::with_state` that match all three traces - **Candidate 1 — Synchronous D3D12 allocation + `MakeResident` (`D3DKMTMakeResident`) under a global Rust table lock on `leonida-list-N`:** - In Trace 1, `uploads ahead 1` spent `~616 ms` in unhooked `CopyQueue` fence completion (`texture/ahead.rs` `SetEventOnCompletion(..., NULL)`) and unblocked at the **exact same moment** `leonida-list-3` finished — the signature of WDDM residency/paging work (amplified here by `LEONIDA_REAPER='0'` keeping retired resources resident). - Specifically, `texture::staging()` (`texture.rs`) still holds global `texture::STAGING` across `pool::staging` (64 MiB upload-pool growth -> `CreateCommittedResource` + `MakeResident` + `Map`, which `pool.rs` notes took `270–961 ms` under VRAM pressure) and oversized `host.upload_buffer(total)`, and `shadow::lookup` / `shadow::loose` (`shadow.rs`) hold `BUFFERS.write()` / `LOOSE.write()` across `CreateCommittedResource` + `MakeResident` (blocking peer `leonida-list-M` threads in `WaitOnAddress` as in Trace 2). - **Candidate 2 — Synchronous sample-mask twin PSO compile on `leonida-list-N` (`draw.rs` -> `pipeline/make.rs` `masked_for`):** - Unlike normal pipelines (`make::ready` on `leonida-pipelines-0..N`), `make::masked_for` (`LEONIDA_SAMPLE_MASK=1`, LOD-fade draws) calls `p.make()` **synchronously on `leonida-list-N`** under `Pending.made: OnceLock` — leaving all 12 `leonida-pipelines-*` workers completely idle, recording `0 ms` in `waiting for pipelines`, and blocking any second list thread hitting the same masked pipeline in `WaitOnAddress` (Trace 2). Notice in Trace 1 `leonida-list-3` woke from `leonida-pipelines-5` after `3.21 ms` (`host_pipeline_for`) right as the `782 ms` call began (`masked_for` runs on the very next line of `prepare_for` when `sample_mask != FULL_MASK`). ### Two quick checks (first one needs no relaunch) 1. **In your saved `-Log` from Trace 1 around the freeze:** - Did a `host pipeline` or `host mesh pipeline` line print right as the `~780 ms` gap ended? (If yes -> **Candidate 2 `masked_for`**.) - In the very next 5-second `frame times over ...` summary line after the freeze, what did `waits for new memory to be resident ... ms a frame` report? (If it spiked -> **Candidate 1 `MakeResident`**.) 2. **Optional isolation switches on the same save (no rebuild needed):** - Try removing `LEONIDA_REAPER='0'` and adding `LEONIDA_WAIT_RESIDENT='0'` (isolates Candidate 1), or `LEONIDA_SAMPLE_MASK='0'` (isolates Candidate 2), or run timed mode `LEONIDA_TIMELINE='120,30,<traces>\timed.json'` without `LEONIDA_TIMELINE_STALL_MS` to capture stacks on `list calls of 50 us or more`. AI-assisted (Gemini 4 Carbon High).
TripyFox commented 2026-12-02 13:40:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by TripyFox on 2026-12-02T13:40:28Z.


Thanks, that was quick to check. Both checks are done on 5ec08c383, the same build, save and settings as the report. They point at candidate 2, the masked twin built on the list thread.

1. The saved logs. In the three trace runs I looked at every stretch where the log went silent for 600 ms or more. 10 of those 14 end with a host mesh pipeline shaders=[..., pixel ... masked] line within 30 ms, and that includes all 4 silences over 1 s. Only about 5% of the pipeline lines in those logs are masked ones (237 to 275 of about 4,900 per run). In the 5-second windows holding those freezes, waits for new memory to be resident was 0.28 to 0.40 ms a frame, so it didn't spike. (A longer run with Frame Generation at 2x showed the same thing: 5 of its 6 silences over 1 s end with a masked line.) One limit: stall mode keeps no clock time, so I can't tie these log silences to the three traced freezes exactly.

2. LEONIDA_SAMPLE_MASK=0, with everything else as in the report's command, including a stall trace:

The three trace runs (sample mask on) LEONIDA_SAMPLE_MASK=0
Time in the world 13.1 min 13.8 min
Masked pipeline lines 783 0
Frames of 1 s or more (after loading into the world) 5 (1.0 to 2.3 s) 1 (1.02 s)
Windows whose longest frame is 600 ms or more 10 3
Frames over 100 ms 48 (3.7 a minute) 29 (2.1 a minute)
Longest log silence 1,436 ms 716 ms

The trace from this run (stall-04, 551.6 ms) has a different shape from the three in the report. A long list call accounts for only 4.85 ms of it. The chain is 503 ms on leonida-pipelines-9, outside our spans, so the frame waited on an ordinary pipeline build (I run with LEONIDA_PIPELINE_WAIT_MS=1000), not on a list thread.

stall-04: trigger interval: 551.63 ms (threshold 250 ms, inclusive)
  the chain it came out of, by cause
     503.27 ms  outside our spans on 18840 "leonida-pipelines-9"
      10.76 ms  ahead of a frame: textures picked by index
       9.64 ms  recording: inside our list calls
       4.85 ms  a long list call
  trigger chain by thread
     503.30 ms  18840 "leonida-pipelines-9"
      12.76 ms  14136 "leonida-list-4"
      11.89 ms  10116 "leonida-list-2"

Caveats: the sample-mask run came a few hours after the trace runs, so more pipelines may have been in the library already (it still made 1.6 to 2.9 a window). The trace runs also differ among themselves (5.9, 2.8 and 2.0 frames over 100 ms a minute). The clear change is in the long freezes, not in short hitches. I didn't try LEONIDA_WAIT_RESIDENT=0 or the reaper on, since check 2 already pointed one way. I'm happy to test a build that makes the masked twin on the pipeline workers, or that waits for it the way normal pipelines are waited for.

The investigation and this reply were AI-assisted (Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7347258983 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3105#issuecomment-7347258983). Originally posted by [TripyFox](https://github.com/TripyFox) on 2026-12-02T13:40:28Z. --- Thanks, that was quick to check. Both checks are done on 5ec08c383, the same build, save and settings as the report. They point at **candidate 2, the masked twin built on the list thread**. **1. The saved logs.** In the three trace runs I looked at every stretch where the log went silent for 600 ms or more. 10 of those 14 end with a `host mesh pipeline shaders=[..., pixel ... masked]` line within 30 ms, and that includes all 4 silences over 1 s. Only about 5% of the pipeline lines in those logs are masked ones (237 to 275 of about 4,900 per run). In the 5-second windows holding those freezes, `waits for new memory to be resident` was 0.28 to 0.40 ms a frame, so it didn't spike. (A longer run with Frame Generation at 2x showed the same thing: 5 of its 6 silences over 1 s end with a masked line.) One limit: stall mode keeps no clock time, so I can't tie these log silences to the three traced freezes exactly. **2. `LEONIDA_SAMPLE_MASK=0`**, with everything else as in the report's command, including a stall trace: | | The three trace runs (sample mask on) | `LEONIDA_SAMPLE_MASK=0` | |---|---|---| | Time in the world | 13.1 min | 13.8 min | | Masked pipeline lines | 783 | 0 | | Frames of 1 s or more (after loading into the world) | 5 (1.0 to 2.3 s) | 1 (1.02 s) | | Windows whose longest frame is 600 ms or more | 10 | 3 | | Frames over 100 ms | 48 (3.7 a minute) | 29 (2.1 a minute) | | Longest log silence | 1,436 ms | 716 ms | The trace from this run (`stall-04`, 551.6 ms) has a different shape from the three in the report. A long list call accounts for only 4.85 ms of it. The chain is 503 ms on `leonida-pipelines-9`, outside our spans, so the frame waited on an ordinary pipeline build (I run with `LEONIDA_PIPELINE_WAIT_MS=1000`), not on a list thread. ```text stall-04: trigger interval: 551.63 ms (threshold 250 ms, inclusive) the chain it came out of, by cause 503.27 ms outside our spans on 18840 "leonida-pipelines-9" 10.76 ms ahead of a frame: textures picked by index 9.64 ms recording: inside our list calls 4.85 ms a long list call trigger chain by thread 503.30 ms 18840 "leonida-pipelines-9" 12.76 ms 14136 "leonida-list-4" 11.89 ms 10116 "leonida-list-2" ``` Caveats: the sample-mask run came a few hours after the trace runs, so more pipelines may have been in the library already (it still made 1.6 to 2.9 a window). The trace runs also differ among themselves (5.9, 2.8 and 2.0 frames over 100 ms a minute). The clear change is in the long freezes, not in short hitches. I didn't try `LEONIDA_WAIT_RESIDENT=0` or the reaper on, since check 2 already pointed one way. I'm happy to test a build that makes the masked twin on the pipeline workers, or that waits for it the way normal pipelines are waited for. The investigation and this reply were AI-assisted (Claude Opus 5.5).
zmasi commented 2026-12-02 18:31:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-02T18:31:55Z.


Thanks again @TripyFox for running both trace checks above and isolating the 0.6–2.3 s open-world silences to synchronous host mesh pipeline ... masked sample-mask twin builds on leonida-list-*!

Opened #3200 (d1a91afd1, stacked on #3132) to route pipeline::make::masked_for through ready onto leonida-pipelines-* workers with #3132's live-waiter priority donation and LEONIDA_PIPELINE_WAIT_MS bounded wait: fast/cached masked twins still finish before the first LOD-fade draw, while multi-second cold driver compiles time out cleanly and fall back to the already-built unmasked PSO until the worker finishes publishing the twin.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354744111 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3105#issuecomment-7354744111). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-02T18:31:55Z. --- Thanks again @TripyFox for running both trace checks above and isolating the `0.6–2.3 s` open-world silences to synchronous `host mesh pipeline ... masked` sample-mask twin builds on `leonida-list-*`! Opened #3200 (`d1a91afd1`, stacked on #3132) to route `pipeline::make::masked_for` through `ready` onto `leonida-pipelines-*` workers with `#3132`'s live-waiter priority donation and `LEONIDA_PIPELINE_WAIT_MS` bounded wait: fast/cached masked twins still finish before the first LOD-fade draw, while multi-second cold driver compiles time out cleanly and fall back to the already-built unmasked PSO until the worker finishes publishing the twin.
kaoru-maki commented 2026-12-03 05:27:49 +00:00 (Migrated from github.com)
Author
Contributor

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


The slow-operation tags in #3136 could be extended with spans for synchronous texture preparation inside DispatchMesh, upload-list lock wait, and PSO wait. I would put DirectStorage activity on the same timeline and log Present entry and return so a pause before the call can be distinguished from time spent inside it.

Synthetic trace. In a 100 ms gap between Present calls, texture preparation runs at 10-55 ms, a second thread waits for the upload-list lock at 20-80 ms, and recorded I/O runs at 20-22 ms. PSO wait is 0 ms. The two CPU-side spans overlap by 35 ms.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7368766236 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3105#issuecomment-7368766236). Originally posted by [kaoru-maki](https://github.com/kaoru-maki) on 2026-12-03T05:27:49Z. --- The slow-operation tags in #3136 could be extended with spans for synchronous texture preparation inside `DispatchMesh`, upload-list lock wait, and PSO wait. I would put DirectStorage activity on the same timeline and log `Present` entry and return so a pause before the call can be distinguished from time spent inside it. Synthetic trace. In a 100 ms gap between `Present` calls, texture preparation runs at `10-55 ms`, a second thread waits for the upload-list lock at `20-80 ms`, and recorded I/O runs at `20-22 ms`. PSO wait is 0 ms. The two CPU-side spans overlap by 35 ms.
kaoru-maki commented 2026-12-03 08:08:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by kaoru-maki on 2026-12-03T08:08:00Z.


Follow-up using Present entry and return markers. One local diagnostic trace captured a 2.06 s frame interval. About 2.02 s elapsed before entering Present, and 41 ms elapsed inside the call.

A single buffer-copy update accounted for about 1.95 s on the critical path. The update thread accumulated about 1.89 s of kernel-mode CPU time in that interval. PSO wait recorded for that frame was 0 ms. Timing the buffer-copy update separately from the Present call would help attribute other long gaps in the same way.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7371864120 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3105#issuecomment-7371864120). Originally posted by [kaoru-maki](https://github.com/kaoru-maki) on 2026-12-03T08:08:00Z. --- Follow-up using `Present` entry and return markers. One local diagnostic trace captured a 2.06 s frame interval. About 2.02 s elapsed before entering `Present`, and 41 ms elapsed inside the call. A single buffer-copy update accounted for about 1.95 s on the critical path. The update thread accumulated about 1.89 s of kernel-mode CPU time in that interval. PSO wait recorded for that frame was 0 ms. Timing the buffer-copy update separately from the `Present` call would help attribute other long gaps in the same way.
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#3105
No description provided.