Multi-second freezes: title thread between submissions with the GPU idle, host memory grows to ~23 GB (RTX 5070 Ti Laptop, v1.1.2+#185) #330

Open
opened 2026-12-05 23:23:31 +00:00 by github-bot · 7 comments
Owner

@⁠mwjdgfwhhc-spec on GitHub · 2026-12-05 23:15 UTC · original

Multi-second freezes during play: title thread between submissions with the GPU idle, host private memory grows to ~23 GB

Summary

On this machine the game freezes for 0.5–27 s during normal play. During a freeze the layer reports the title's submitting thread between submissions for the whole stall, GPU utilisation 0 %, no pipeline being made, no layer threads waiting, and the guards/journal locks free. Host private memory climbs from ~15 GB to ~23 GB over ~20 minutes on a 31 GB machine, and the pagefile peak reaches ~11 GB. When a stall passes ~30 s, the title's own watchdog fires and the process dies with an access violation write to 0x0 at larp-image+0x23cf683 (backtrace through +0x2215c35, the 30 s watchdog).

This looks like host paging / memory growth, matching the maintainer's comment on #120 ("host paging under memory pressure"), but it is not fixed by --card-budget alone. Reducing host memory and freeing system RAM did largely remove the multi-second stalls in a short session (see "What helped").

System

  • ASUS ROG Strix SCAR 18 G835LR
  • Intel Core Ultra 9 275HX, 24 cores / 24 threads
  • 31.4 GB RAM (2×16 GB DDR5-5600), NVMe SSD (954 GB, C:)
  • NVIDIA RTX 5070 Ti Laptop, 12,227 MiB, driver 621.47
  • Intel iGPU also present (hybrid laptop; display output on the iGPU)
  • Windows 11 Pro 10.0.26200

Build and configuration

  • larp v1.1.2 (1ccd55e) plus PR #185 (deb2a0d), built from source.
  • Local patch: explicit adapter selection in Host::new (pick the DXGI adapter with the largest DedicatedVideoMemory). Stock D3D12CreateDevice(None) selected the Intel iGPU here (wave lanes min=8 max=32), which refused thousands of PSOs (barycentrics/typed-64 atomics unsupported) and removed the device; with the patch the device is the RTX (min=32 max=32, 0 mesh refusals). This patch is separate from the freeze issue and can be reported separately if wanted.
  • Console series-s, 1920×1080, DLSS performance, frame generation 2x, Reflex on, BVH low.
  • Run options: --stream-budget 2500 --card-budget 10240, LARP_RT_POSITIONS_MB=512, LARP_PIPELINE_WAIT_MS=8, LARP_PRELOAD_THREADS=max, texture detail one level down, no LARP_RT_WHOLE.

Symptom in the log

Stall report (20 s):

WARN larp_gpu::stall: stall: no frame begun for 20 s (frame 42624);
the submitting thread is between submissions (of 0 lists) for 20118.8 ms;
0 threads of ours noted a wait (7 more idle); guards' lock free
(last taken by thread 35600 "dstorage 3" 12737 ms ago), journal's free
(last taken by thread 27600 "" 20160 ms ago); reads in place 0 (...), threads waiting 0

At the same time nvidia-smi shows GPU 0 %, VRAM under the 10,240 MB budget. The layer's own accounting for the stall windows is copies 0.0 ms / 0.2–0.3 MB, 0.0 ms on the GPU, 2–13 ms preparing, 0 being made, 0 indirect.

The crash when a stall exceeds 30 s:

first-chance exception 0xc0000005 at larp-image-b99f876b74d4a77f.dll+0x23cf683
(write 0x0: nothing mapped there)
  #0 larp-image-...dll+0x23cf683
  #1 larp-image-...dll+0x2215c35
  #2 larp-image-...dll+0x2215eca

+0x2215c35 is the title's 30 s hang watchdog (as documented under +0x2215c35 in docs/troubleshooting-and-crashes.md); the handler writes to a null pointer. This matches the report just added to #59 (list end-marker 0xFFFF used as an index when the title's memory pool is ~95 % full), and the diagnostic switches in PR #140 (LARP_TITLE_WATCHDOG=0, LARP_STACKS_AT_KILL=1).

Measurements

All fps/frame numbers from times between presents lines; memory from a 2–5 s system sampler.

Before any mitigations (v1.1.2, no card budget, Firefox open)

session windows >300 ms >1 s >3 s >10 s largest notes
16 min 15 — — — 7,801 ms several 4–7.8 s
21.9 min 18 15 9 2 (14.5 s, 27.4 s) 27,408 ms 94 s frozen in total

Peak VRAM 10,767 / 12,227 MiB, process private 23.2 GB, free physical RAM 1.6–2.1 GB, pagefile peak 11 GB. Private memory grew 15.3 → 23.6 GB during a 20-minute session.

--card-budget 10240 alone

VRAM fell to a peak of 9,656 MiB (under budget) with no VRAM-exhaustion signature, but the freezes were not reduced (18 windows >300 ms / 21.9 min; 2 frames >10 s, largest 27.4 s). Host private memory still rose to ~23.6 GB.

After host-memory reductions and freeing system RAM (v1.1.2 + #185)

Changes: texture detail one level down, LARP_RT_POSITIONS_MB=512 (it is host memory; default 512), no LARP_RT_WHOLE, Firefox closed (~10 GB freed), same card/stream budgets.

  • Process private 7.8–8.6 GB (was 15–23 GB), free RAM 12–14 GB, no page faults recorded, disk ≤11 MB/s.
  • 11-minute session: 0 frames >1 s in 128 stat windows; longest 416 ms.
  • The previous session in the same config had only two frames >1 s (5.5 s and 1.9 s) before this.

Version comparison (same machine/save)

build 1 % low 0.1 % low frames >500 ms worst
v1.1.0 6.5 fps 0.3 fps 77 in 26 min 10.1 s
v1.1.1 15.8 fps 2.3 fps 3 in 5.4 min 2.29 s (world entry)

v1.1.1 removed 11,210 lazily-compiled quad-mask variants from startup (413 now; 81,296 blobs loaded from cache), which removed the pipeline-compile stalls; the remaining stalls are not pipeline creation.

What was ruled out for the remaining stalls

  • Pipeline/shader compilation: 0 being made, no pipeline/shader_replace records inside the stalls; LARP_PIPELINE_WAIT_MS=8 already active.
  • GPU work: GPU 0 % and 0.0 ms on the GPU during the largest stalls.
  • VRAM pressure: with --card-budget 10240 VRAM never exceeded 9,656 MiB, and the freezes did not change.
  • Ray tracing: RT pool reduced to 512 MB; upstream #63 also rules out RT.
  • DirectStorage/streaming: no dstorage/stream records during the stalls; disk reads sampled at 0–11 MB/s.
  • Layer copies/readbacks: 0.0–0.1 ms, 0.2–0.3 MB.

What helped

  • Freeing system RAM (closing a browser holding ~10 GB) and reducing host memory setting: private 23 GB → 8 GB, free RAM 1.6 → 12–14 GB; the multi-second stalls largely disappeared in an 11-minute session (0 >1 s, max 416 ms).
  • Keeping the card budget and stream budget.

Open item: a fixed 32 GB pagefile on the NVMe is configured and awaits a reboot; the above session still ran with the system-managed file.

Question

  1. Is the host-memory growth (15→23 GB private over ~20 min) a known unbounded allocation in the layer, and is there a way to bound it (copies, descriptor heaps, pipeline caches, RT positions)?
  2. Is the +0x2215c35 → +0x23cf683 crash exactly the pool-exhaustion/0xFFFF-index path from #59, and is PR #140's LARP_TITLE_WATCHDOG=0 the intended mitigation until a fix?
  3. Any recommended host-RAM budget/pagefile for a 31 GB machine with this title, beyond "fixed pagefile on SSD"?

Logs and the 2–5 s system sampler CSV (memory, page faults, disk, GPU) are available and can be attached or zipped with larp zip-logs if useful.

References

  • #59 (access violation, commit near limit; 0xFFFF index theory)
  • #120 (--card-budget, host paging comment)
  • #127 (same 20 s stall signature, PR #103)
  • #148 (increasing memory, present gaps)
  • #230 (memory growth/commit)
  • PR #140 (LARP_TITLE_WATCHDOG=0, LARP_STACKS_AT_KILL)
**@⁠mwjdgfwhhc-spec** on GitHub · 2026-12-05 23:15 UTC · [original](https://github.com/gamingwithhomie/larp/issues/330) # Multi-second freezes during play: title thread between submissions with the GPU idle, host private memory grows to ~23 GB ## Summary On this machine the game freezes for **0.5–27 s** during normal play. During a freeze the layer reports the title's submitting thread **between submissions for the whole stall**, **GPU utilisation 0 %**, no pipeline being made, no layer threads waiting, and the guards/journal locks free. Host **private** memory climbs from ~15 GB to ~23 GB over ~20 minutes on a 31 GB machine, and the pagefile peak reaches ~11 GB. When a stall passes ~30 s, the title's own watchdog fires and the process dies with an access violation **write to 0x0** at `larp-image+0x23cf683` (backtrace through `+0x2215c35`, the 30 s watchdog). This looks like **host paging / memory growth**, matching the maintainer's comment on #120 ("host paging under memory pressure"), but it is not fixed by `--card-budget` alone. Reducing host memory and freeing system RAM did largely remove the multi-second stalls in a short session (see "What helped"). ## System - ASUS ROG Strix SCAR 18 G835LR - Intel Core Ultra 9 275HX, 24 cores / 24 threads - 31.4 GB RAM (2×16 GB DDR5-5600), NVMe SSD (954 GB, C:) - NVIDIA RTX 5070 Ti **Laptop**, 12,227 MiB, driver 621.47 - Intel iGPU also present (hybrid laptop; display output on the iGPU) - Windows 11 Pro 10.0.26200 ## Build and configuration - larp **v1.1.2** (`1ccd55e`) **plus PR #185** (`deb2a0d`), built from source. - Local patch: explicit adapter selection in `Host::new` (pick the DXGI adapter with the largest `DedicatedVideoMemory`). Stock `D3D12CreateDevice(None)` selected the **Intel iGPU** here (`wave lanes min=8 max=32`), which refused thousands of PSOs (barycentrics/typed-64 atomics unsupported) and removed the device; with the patch the device is the RTX (`min=32 max=32`, 0 mesh refusals). This patch is separate from the freeze issue and can be reported separately if wanted. - Console **series-s**, 1920×1080, DLSS performance, frame generation **2x**, Reflex on, BVH low. - Run options: `--stream-budget 2500 --card-budget 10240`, `LARP_RT_POSITIONS_MB=512`, `LARP_PIPELINE_WAIT_MS=8`, `LARP_PRELOAD_THREADS=max`, texture detail one level down, no `LARP_RT_WHOLE`. ## Symptom in the log Stall report (20 s): ``` WARN larp_gpu::stall: stall: no frame begun for 20 s (frame 42624); the submitting thread is between submissions (of 0 lists) for 20118.8 ms; 0 threads of ours noted a wait (7 more idle); guards' lock free (last taken by thread 35600 "dstorage 3" 12737 ms ago), journal's free (last taken by thread 27600 "" 20160 ms ago); reads in place 0 (...), threads waiting 0 ``` At the same time `nvidia-smi` shows **GPU 0 %**, VRAM under the 10,240 MB budget. The layer's own accounting for the stall windows is `copies 0.0 ms / 0.2–0.3 MB`, `0.0 ms on the GPU`, `2–13 ms preparing`, `0 being made`, `0 indirect`. The crash when a stall exceeds 30 s: ``` first-chance exception 0xc0000005 at larp-image-b99f876b74d4a77f.dll+0x23cf683 (write 0x0: nothing mapped there) #0 larp-image-...dll+0x23cf683 #1 larp-image-...dll+0x2215c35 #2 larp-image-...dll+0x2215eca ``` `+0x2215c35` is the title's 30 s hang watchdog (as documented under `+0x2215c35` in `docs/troubleshooting-and-crashes.md`); the handler writes to a null pointer. This matches the report just added to **#59** (list end-marker `0xFFFF` used as an index when the title's memory pool is ~95 % full), and the diagnostic switches in **PR #140** (`LARP_TITLE_WATCHDOG=0`, `LARP_STACKS_AT_KILL=1`). ## Measurements All fps/frame numbers from `times between presents` lines; memory from a 2–5 s system sampler. ### Before any mitigations (v1.1.2, no card budget, Firefox open) | session | windows >300 ms | >1 s | >3 s | >10 s | largest | notes | |---|---:|---:|---:|---:|---:|---| | 16 min | 15 | — | — | — | 7,801 ms | several 4–7.8 s | | 21.9 min | 18 | 15 | 9 | 2 (14.5 s, 27.4 s) | 27,408 ms | 94 s frozen in total | Peak VRAM **10,767 / 12,227 MiB**, process private **23.2 GB**, free physical RAM **1.6–2.1 GB**, pagefile peak **11 GB**. Private memory grew **15.3 → 23.6 GB** during a 20-minute session. ### `--card-budget 10240` alone VRAM fell to a peak of **9,656 MiB** (under budget) with no VRAM-exhaustion signature, but the freezes were **not reduced** (18 windows >300 ms / 21.9 min; 2 frames >10 s, largest 27.4 s). Host private memory still rose to ~23.6 GB. ### After host-memory reductions and freeing system RAM (v1.1.2 + #185) Changes: texture detail one level down, `LARP_RT_POSITIONS_MB=512` (it is host memory; default 512), no `LARP_RT_WHOLE`, Firefox closed (~10 GB freed), same card/stream budgets. - Process private **7.8–8.6 GB** (was 15–23 GB), free RAM **12–14 GB**, no page faults recorded, disk ≤11 MB/s. - 11-minute session: **0 frames >1 s** in 128 stat windows; longest **416 ms**. - The previous session in the same config had only two frames >1 s (5.5 s and 1.9 s) before this. ### Version comparison (same machine/save) | build | 1 % low | 0.1 % low | frames >500 ms | worst | |---|---:|---:|---:|---:| | v1.1.0 | 6.5 fps | 0.3 fps | 77 in 26 min | 10.1 s | | v1.1.1 | 15.8 fps | 2.3 fps | 3 in 5.4 min | 2.29 s (world entry) | v1.1.1 removed 11,210 lazily-compiled quad-mask variants from startup (413 now; 81,296 blobs loaded from cache), which removed the pipeline-compile stalls; the remaining stalls are not pipeline creation. ## What was ruled out for the remaining stalls - **Pipeline/shader compilation:** `0 being made`, no `pipeline`/`shader_replace` records inside the stalls; `LARP_PIPELINE_WAIT_MS=8` already active. - **GPU work:** GPU 0 % and `0.0 ms on the GPU` during the largest stalls. - **VRAM pressure:** with `--card-budget 10240` VRAM never exceeded 9,656 MiB, and the freezes did not change. - **Ray tracing:** RT pool reduced to 512 MB; upstream #63 also rules out RT. - **DirectStorage/streaming:** no dstorage/stream records during the stalls; disk reads sampled at 0–11 MB/s. - **Layer copies/readbacks:** 0.0–0.1 ms, 0.2–0.3 MB. ## What helped - Freeing system RAM (closing a browser holding ~10 GB) and reducing host memory setting: private 23 GB → 8 GB, free RAM 1.6 → 12–14 GB; the multi-second stalls largely disappeared in an 11-minute session (0 >1 s, max 416 ms). - Keeping the card budget and stream budget. Open item: a fixed 32 GB pagefile on the NVMe is configured and awaits a reboot; the above session still ran with the system-managed file. ## Question 1. Is the host-memory growth (15→23 GB private over ~20 min) a known unbounded allocation in the layer, and is there a way to bound it (copies, descriptor heaps, pipeline caches, RT positions)? 2. Is the `+0x2215c35 → +0x23cf683` crash exactly the pool-exhaustion/`0xFFFF`-index path from #59, and is `PR #140`'s `LARP_TITLE_WATCHDOG=0` the intended mitigation until a fix? 3. Any recommended host-RAM budget/pagefile for a 31 GB machine with this title, beyond "fixed pagefile on SSD"? Logs and the 2–5 s system sampler CSV (memory, page faults, disk, GPU) are available and can be attached or zipped with `larp zip-logs` if useful. ## References - #59 (access violation, commit near limit; `0xFFFF` index theory) - #120 (`--card-budget`, host paging comment) - #127 (same 20 s stall signature, PR #103) - #148 (increasing memory, present gaps) - #230 (memory growth/commit) - PR #140 (`LARP_TITLE_WATCHDOG=0`, `LARP_STACKS_AT_KILL`)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 23:23:38 +00:00
Author
Owner

@⁠gamingwithhomie on GitHub · 2026-12-05 23:51 UTC · original

Suspicion to test: you name v1.1.2+#185 - the perf PRs are individually toggleable (see docs/environment-variables.md perf flags, each =0 disables one). If the freezes + 23 GB host growth vanish with the #185 flags off, tell us which one; that isolates it. Also attach zip-logs from a freeze run (per-second memory counters are in play.log).

**@⁠gamingwithhomie** on GitHub · 2026-12-05 23:51 UTC · [original](https://github.com/gamingwithhomie/larp/issues/330#issuecomment-7447898933) Suspicion to test: you name v1.1.2+#185 - the perf PRs are individually toggleable (see docs/environment-variables.md perf flags, each `=0` disables one). If the freezes + 23 GB host growth vanish with the #185 flags off, tell us which one; that isolates it. Also attach zip-logs from a freeze run (per-second memory counters are in play.log).
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-12-06 00:48 UTC · original

A measured lead on the growth and the late slowdown.

Setup: RTX 4080, i5-13600K, 32 GB, Win10 19045, Series X. Diagnostics build (--features diagnostics, so copystat prints its debug memory lines). About 18 min of manual play.

1. Where the memory is (copystat "memory map", 00:22 → 00:39):

at 00:22 at 00:39
write-combined ("buffers shared with the card") ~1.4 GB 13.8 GB committed, 3.6 GB resident
the title's heaps (console addresses) 3.9 GB 6.0 GB
process heap segments (larp's own allocations) 1.1 GB 3.7 GB
files and other mappings 20.5 GB, 6.6 GB resident
  • The write-combined part jumps during the first load (00:23-00:26). It then moves between 12 and 16 GB in play, without a steady climb.
  • The steady climb in play comes from the title's heaps (+0.9 GB in 11 min) and larp's own heap (+0.5 GB).
  • larp's own pools (hostmem) count only about 1 GB in PC memory, and the system's "shared with the card" use is 1.4 GB. So most of the write-combined total is not D3D12 heaps.

2. A table that only grows, with a hard cap (larp-gpu descriptor.rs, the same on main a8ad2c1):

  • "shapes of placed views kept": 119k when the world loaded, then 2.1 M 15 minutes later. That is about 130k new shapes a minute, steady, never falling.
    • The comment at descriptor.rs:566 expects "hundreds of thousands in a session".
  • Shapes are written once and never freed. The cap is SHAPES = 1 << (62 - PLACED_ADDRESS_BITS) = 4,194,304. At the measured rate the table is full after about 32 minutes of play.
  • When it is full, Views::shape returns None (:754). Every view with a new shape then becomes a table entry under the global VIEWS lock. words_for takes that lock again for the entry, and shape_number has already taken it once for the shape. That is two passes under one lock that every recording thread shares.
  • In the same window, "distinct views kept" (the table entries) grew from 49 MB to 268 MB, and larp's own allocations grew from 2.7 to 3.4 GB.

3. The timing it would explain. On a release build of the same tree, CPU "preparing" per 1,000 draws rose steadily over a 38-min session: 1.02 ms at 0-5 min, 1.24 at 20, 1.66 at 30, 1.95 ms at 35. Median fps went from 34.5 to 21.7. That is the "fine for the first half, then stutter" several of us report.

  • Caveat: we have not yet logged the shape count past the cap in one run. So "the cap is reached at ~32 min, and the lock is what slows the recording threads" is inferred, not shown.

What would settle it: which of the 28 shape words vary between the millions of shapes. A Shape is the 14-word resource description plus the view's descriptor without its address words (shape_of, :700). If a per-view value (an element count, an offset, a size) differs for most views, almost every view gets its own shape. Then a wider shape field, or a shape without that word, would keep the table from filling.

We'll sample the shapes and post which words differ, then test a fix on a 38-min route replay. If someone already knows why the title produces so many distinct buffer-view shapes, that would save a step.

**@⁠Proudnoob4** on GitHub · 2026-12-06 00:48 UTC · [original](https://github.com/gamingwithhomie/larp/issues/330#issuecomment-7448659689) A measured lead on the growth and the late slowdown. Setup: RTX 4080, i5-13600K, 32 GB, Win10 19045, Series X. Diagnostics build (`--features diagnostics`, so `copystat` prints its debug memory lines). About 18 min of manual play. **1. Where the memory is** (`copystat` "memory map", 00:22 → 00:39): | | at 00:22 | at 00:39 | |---|---|---| | write-combined ("buffers shared with the card") | ~1.4 GB | 13.8 GB committed, 3.6 GB resident | | the title's heaps (console addresses) | 3.9 GB | 6.0 GB | | process heap segments (larp's own allocations) | 1.1 GB | 3.7 GB | | files and other mappings | | 20.5 GB, 6.6 GB resident | - The write-combined part jumps during the first load (00:23-00:26). It then moves between 12 and 16 GB in play, without a steady climb. - The steady climb in play comes from the title's heaps (+0.9 GB in 11 min) and larp's own heap (+0.5 GB). - larp's own pools (hostmem) count only about 1 GB in PC memory, and the system's "shared with the card" use is 1.4 GB. So most of the write-combined total is not D3D12 heaps. **2. A table that only grows, with a hard cap** (`larp-gpu` `descriptor.rs`, the same on main `a8ad2c1`): - "shapes of placed views kept": 119k when the world loaded, then **2.1 M** 15 minutes later. That is about **130k new shapes a minute**, steady, never falling. - The comment at `descriptor.rs:566` expects "hundreds of thousands in a session". - Shapes are written once and never freed. The cap is `SHAPES = 1 << (62 - PLACED_ADDRESS_BITS)` = 4,194,304. At the measured rate the table is full after **about 32 minutes of play**. - When it is full, `Views::shape` returns `None` (`:754`). Every view with a new shape then becomes a table entry under the global `VIEWS` lock. `words_for` takes that lock again for the entry, and `shape_number` has already taken it once for the shape. That is two passes under one lock that every recording thread shares. - In the same window, "distinct views kept" (the table entries) grew from 49 MB to 268 MB, and larp's own allocations grew from 2.7 to 3.4 GB. **3. The timing it would explain.** On a release build of the same tree, CPU "preparing" per 1,000 draws rose steadily over a 38-min session: 1.02 ms at 0-5 min, 1.24 at 20, 1.66 at 30, 1.95 ms at 35. Median fps went from 34.5 to 21.7. That is the "fine for the first half, then stutter" several of us report. - Caveat: we have not yet logged the shape count past the cap in one run. So "the cap is reached at ~32 min, and the lock is what slows the recording threads" is inferred, not shown. **What would settle it:** which of the 28 shape words vary between the millions of shapes. A `Shape` is the 14-word resource description plus the view's descriptor without its address words (`shape_of`, `:700`). If a per-view value (an element count, an offset, a size) differs for most views, almost every view gets its own shape. Then a wider shape field, or a shape without that word, would keep the table from filling. We'll sample the shapes and post which words differ, then test a fix on a 38-min route replay. If someone already knows why the title produces so many distinct buffer-view shapes, that would save a step.
Author
Owner

@⁠mwjdgfwhhc-spec on GitHub · 2026-12-06 01:24 UTC · original

Ran the toggle test you asked for, plus a diagnostics build with the memory census on. Short version: the growth is not from the #185/#306 perf flags, and it is not in the pools the census tracks by name — it is in write-combined host allocations in the 32/64/128 MB size class.

Isolation (all four =0, log confirms on=false): LARP_OPT_LIST_REUSE, LARP_OPT_COPY_BATCH, LARP_OPT_RELEASE_HELD, LARP_OPT_VIEW_MIRROR off, 23 min of play → private 8.4 → 23.7 GB, free RAM 10.9 → 3.1 GB, pagefile 2.7 GB of 44 GB, VRAM 0.9 → 9.7 GB. Frames: 12 over 1 s, 4 over 5 s, worst 7.88 s. The growth also reproduces on stock v1.1.6, which has those PRs merged (11.8 → 20.3 GB, worst frame 29.97 s). So the flags are not it.

Census (--profile diag --features diagnostics, LARP_LOG=info,larp_gpu::copystat=debug, 18 min): private 7.6 → 22.35 GB, free 12.3 → 4.4 GB.

  • our own allocations: 975 → 2,949 MB (4 KiB–1 MiB classes grow most: ≤1 MiB 87 → 1,008 MB in 6,995 blocks)
  • private map, biggest groups: 32 MB write-combined 10 (292 MB) → 86 (2,747 MB); 64 MB write-combined 0 → 51 (3,264 MB); 128 MB write-combined 3 (384 MB) → 19 (2,432 MB); 1 GB blocks 3 (2,028 MB) → 4 (3,417 MB). The 20 groups together: 3.77 → 13.74 GB.
  • views kept 5,309 → 8,361 (+179 MB); host-list scratch 0 → 65 MB; windows 0 MB.

The write-combined growth is the same size class as the placed-texture heaps ("host textures cut from D3D12 Memory Allocator's heaps of 64 MB"), and nothing brought it back down.

Full tables and the raw first/last census and memory-map lines: https://gist.github.com/mwjdgfwhhc-spec/40b9c23b20aa97644bd63117bfdc3a83

Three questions:

  1. Are those write-combined 32/64/128 MB host copies supposed to be released when the title evicts a streamed level? Counts 0→51, 10→86, 3→19 in 18 minutes with no reclamation.
  2. Is --stream-budget 2500 (below the title's 3977) the intended mitigation? The only session on this machine that did not grow was at 2500: v1.1.2+#185, 11 min, 7.8–8.6 GB private, 0 frames over 1 s (worst 416 ms). Every run at or above the title's own budget grew to 20–23 GB and froze. Correlation, not proof.
  3. LARP_TITLE_WATCHDOG=0 was set ("watchdog is told to quit"), yet the run that ended in a GPU device removal (0x887A0005, 32 lists in flight) still recorded 0xc0000005 write 0x0 at +0x23cf683 via +0x2215c35. Does the switch only cover the heartbeat path, not the device-removed path?

larp-logs-1796520174.zip (4.4 MB, full tracing + census) is ready. GitHub's API cannot attach binaries from gh, so say the word and it can be attached through the web UI, or grab anything you need from the gist.

Machine, for the record: RTX 5070 Ti Laptop 12,227 MiB (driver 621.47), Core Ultra 9 275HX, 31.4 GB, Win 11 26200; v1.1.6 + PR #408 (132ab794, on main d2a79dd including #140), Series S 1080p, DLSS perf, FG 2x, --card-budget 10240, RT pool 512 MB, --stream-budget 4500 (the log notes this is not below the title's own 3977).

**@⁠mwjdgfwhhc-spec** on GitHub · 2026-12-06 01:24 UTC · [original](https://github.com/gamingwithhomie/larp/issues/330#issuecomment-7449152023) Ran the toggle test you asked for, plus a diagnostics build with the memory census on. Short version: **the growth is not from the #185/#306 perf flags, and it is not in the pools the census tracks by name — it is in write-combined host allocations in the 32/64/128 MB size class.** **Isolation (all four `=0`, log confirms `on=false`):** `LARP_OPT_LIST_REUSE`, `LARP_OPT_COPY_BATCH`, `LARP_OPT_RELEASE_HELD`, `LARP_OPT_VIEW_MIRROR` off, 23 min of play → private **8.4 → 23.7 GB**, free RAM **10.9 → 3.1 GB**, pagefile 2.7 GB of 44 GB, VRAM 0.9 → 9.7 GB. Frames: 12 over 1 s, 4 over 5 s, worst **7.88 s**. The growth also reproduces on stock v1.1.6, which has those PRs merged (11.8 → 20.3 GB, worst frame 29.97 s). So the flags are not it. **Census (`--profile diag --features diagnostics`, `LARP_LOG=info,larp_gpu::copystat=debug`, 18 min):** private 7.6 → **22.35 GB**, free 12.3 → 4.4 GB. - our own allocations: **975 → 2,949 MB** (4 KiB–1 MiB classes grow most: ≤1 MiB 87 → 1,008 MB in 6,995 blocks) - private map, biggest groups: 32 MB **write-combined** 10 (292 MB) → **86 (2,747 MB)**; 64 MB **write-combined** 0 → **51 (3,264 MB)**; 128 MB **write-combined** 3 (384 MB) → **19 (2,432 MB)**; 1 GB blocks 3 (2,028 MB) → 4 (3,417 MB). The 20 groups together: 3.77 → **13.74 GB**. - views kept 5,309 → 8,361 (+179 MB); host-list scratch 0 → 65 MB; windows 0 MB. The write-combined growth is the same size class as the placed-texture heaps ("host textures cut from D3D12 Memory Allocator's heaps of 64 MB"), and nothing brought it back down. Full tables and the raw first/last census and memory-map lines: https://gist.github.com/mwjdgfwhhc-spec/40b9c23b20aa97644bd63117bfdc3a83 Three questions: 1. Are those write-combined 32/64/128 MB host copies supposed to be released when the title evicts a streamed level? Counts 0→51, 10→86, 3→19 in 18 minutes with no reclamation. 2. Is `--stream-budget 2500` (below the title's 3977) the intended mitigation? The only session on this machine that did not grow was at 2500: v1.1.2+#185, 11 min, **7.8–8.6 GB private, 0 frames over 1 s (worst 416 ms)**. Every run at or above the title's own budget grew to 20–23 GB and froze. Correlation, not proof. 3. `LARP_TITLE_WATCHDOG=0` was set ("watchdog is told to quit"), yet the run that ended in a GPU device removal (`0x887A0005`, 32 lists in flight) still recorded `0xc0000005` write `0x0` at `+0x23cf683` via `+0x2215c35`. Does the switch only cover the heartbeat path, not the device-removed path? `larp-logs-1796520174.zip` (4.4 MB, full tracing + census) is ready. GitHub's API cannot attach binaries from `gh`, so say the word and it can be attached through the web UI, or grab anything you need from the gist. Machine, for the record: RTX 5070 Ti Laptop 12,227 MiB (driver 621.47), Core Ultra 9 275HX, 31.4 GB, Win 11 26200; v1.1.6 + PR #408 (`132ab794`, on main `d2a79dd` including #140), Series S 1080p, DLSS perf, FG 2x, `--card-budget 10240`, RT pool 512 MB, `--stream-budget 4500` (the log notes this is not below the title's own 3977).
Author
Owner

@⁠vanya890 on GitHub · 2026-12-06 01:40 UTC · original

I checked the current main implementation (459db13) rather than relying on the older line numbers. The 4,194,304-shape cap is real, but there is an important distinction in the lookup path:

  • Existing shapes are checked in the thread-local SHAPE_NUMBERS cache, then in the lock-free SHAPE_INDEX (which has 2 * SHAPES slots).
  • The global VIEWS mutex is reached only when a shape is new and absent from that index.
  • Once SHAPES reaches its cap, Views::shape returns None; words_for then falls back to VIEWS.entry(view). So the proposed lock-contention effect is plausible for new/unrepresentable placed views after the cap, but it does not put every existing shape lookup under the mutex. The 4.19M cap is also not the same as the 8.39M-slot index becoming full.

There is already a direct diagnostic for this: diagnostics builds report placed views' shapes numbered per frame split into thread-local, indexed, and locked lookups (descriptor::shapes_line). views_kept() also reports the current shape count. A capture showing those counters as the count approaches 4.19M, alongside the write-combined allocation census, would tell us whether the lock fallback actually spikes at the same time as the freezes. Until that is measured, I would keep the shape-cap theory separate from the observed write-combined growth rather than treating either as the established root cause.

**@⁠vanya890** on GitHub · 2026-12-06 01:40 UTC · [original](https://github.com/gamingwithhomie/larp/issues/330#issuecomment-7449355045) I checked the current `main` implementation (`459db13`) rather than relying on the older line numbers. The 4,194,304-shape cap is real, but there is an important distinction in the lookup path: - Existing shapes are checked in the thread-local `SHAPE_NUMBERS` cache, then in the lock-free `SHAPE_INDEX` (which has `2 * SHAPES` slots). - The global `VIEWS` mutex is reached only when a shape is new and absent from that index. - Once `SHAPES` reaches its cap, `Views::shape` returns `None`; `words_for` then falls back to `VIEWS.entry(view)`. So the proposed lock-contention effect is plausible for new/unrepresentable placed views after the cap, but it does not put every existing shape lookup under the mutex. The 4.19M cap is also not the same as the 8.39M-slot index becoming full. There is already a direct diagnostic for this: diagnostics builds report `placed views' shapes numbered per frame` split into thread-local, indexed, and locked lookups (`descriptor::shapes_line`). `views_kept()` also reports the current shape count. A capture showing those counters as the count approaches 4.19M, alongside the write-combined allocation census, would tell us whether the lock fallback actually spikes at the same time as the freezes. Until that is measured, I would keep the shape-cap theory separate from the observed write-combined growth rather than treating either as the established root cause.
Author
Owner

@⁠ItsTobix on GitHub · 2026-12-06 02:06 UTC · original · edited 2026-12-06 02:08 UTC

Same growth here on AMD, on stock v1.1.6-amd (bin\larp.exe SHA-256 F14B3B357F84E8670B5CB43C6A49C3EA9B8C59F17BCAB3C68427CB69B028AE11), so it's not NVIDIA- or laptop-specific.

Setup: RX 9070 XT 16 GB (driver 32.0.32029.2010), Ryzen 5 9600X, 32 GB RAM (31 GB usable), game on a SATA SSD, Windows 11. series-x, 3840x2160, frame rate 40, stream budget default, wave 64, LARP_BYTE_VIEWS=0, LARP_LEAVE_OUT=4cc64e0e379e2541 (workaround for #151).

Logged once a minute (PrivateMemorySize64 / WorkingSet64, free RAM, \Memory\Pages Input/sec):

minute private working set free RAM longest present gap
3–11 23.3 → 23.2 GB (flat) ~10 GB 12.5 GB < 130 ms
13 25.0 GB 11.1 GB 10.6 GB
20 30.4 GB 15.2 GB 6.0 GB
25 31.7 GB 17.1 GB 4.1 GB 531 ms
31 35.7 GB 19.2 GB 2.3 GB 736 ms
  • No pipelines being made during that time.
  • CPU "preparing" rises from ~1.5 ms to 5–7 ms per frame, like @⁠Proudnoob4's numbers.
  • 99th-percentile frame time goes from ~25 ms to 50–90 ms.
  • Up to ~5900 pages/s are paged back in at the worst point.
  • The stutter got much worse after a plane flight over the Leonida Keys, so fast travel over a large area (lots of new streaming) may speed it up.
  • No multi-second freezes and no crash in 33 min (closed by me), just stutter that keeps getting worse.

Possibly useful: the growth started exactly with this line (minute 12, logged only once in the run):

WARN larp_gpu::descriptor::stage: staged views: ended views and sets wait for a list made live that many lists ago, their slots are not given back while it is live waiting=65537 lists=73

Before it, memory was flat for 11 minutes. After it, it grew ~0.5–1 GB/min. I don't know if a held list also keeps the write-combined copies alive, but the timing matches.

**@⁠ItsTobix** on GitHub · 2026-12-06 02:06 UTC · [original](https://github.com/gamingwithhomie/larp/issues/330#issuecomment-7449693664) · edited 2026-12-06 02:08 UTC Same growth here on AMD, on stock **v1.1.6-amd** (`bin\larp.exe` SHA-256 `F14B3B357F84E8670B5CB43C6A49C3EA9B8C59F17BCAB3C68427CB69B028AE11`), so it's not NVIDIA- or laptop-specific. **Setup:** RX 9070 XT 16 GB (driver 32.0.32029.2010), Ryzen 5 9600X, 32 GB RAM (31 GB usable), game on a SATA SSD, Windows 11. `series-x`, 3840x2160, frame rate 40, **stream budget default**, wave 64, `LARP_BYTE_VIEWS=0`, `LARP_LEAVE_OUT=4cc64e0e379e2541` (workaround for #151). Logged once a minute (`PrivateMemorySize64` / `WorkingSet64`, free RAM, `\Memory\Pages Input/sec`): | minute | private | working set | free RAM | longest present gap | |---|---|---|---|---| | 3–11 | 23.3 → 23.2 GB (flat) | ~10 GB | 12.5 GB | < 130 ms | | 13 | 25.0 GB | 11.1 GB | 10.6 GB | | | 20 | 30.4 GB | 15.2 GB | 6.0 GB | | | 25 | 31.7 GB | 17.1 GB | 4.1 GB | 531 ms | | 31 | 35.7 GB | 19.2 GB | 2.3 GB | 736 ms | - No pipelines being made during that time. - CPU "preparing" rises from ~1.5 ms to 5–7 ms per frame, like @⁠Proudnoob4's numbers. - 99th-percentile frame time goes from ~25 ms to 50–90 ms. - Up to ~5900 pages/s are paged back in at the worst point. - The stutter got much worse after a plane flight over the Leonida Keys, so fast travel over a large area (lots of new streaming) may speed it up. - No multi-second freezes and no crash in 33 min (closed by me), just stutter that keeps getting worse. **Possibly useful:** the growth started exactly with this line (minute 12, logged only once in the run): ``` WARN larp_gpu::descriptor::stage: staged views: ended views and sets wait for a list made live that many lists ago, their slots are not given back while it is live waiting=65537 lists=73 ``` Before it, memory was flat for 11 minutes. After it, it grew ~0.5–1 GB/min. I don't know if a held list also keeps the write-combined copies alive, but the timing matches.
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-12-06 02:15 UTC · original

Thanks, that's a fair correction. Here's what our run's shapes_line gives, and one point in the code path.

Before the cap (placed views' shapes numbered per frame, 18 min of the same run):

  • from the thread's own list: 11-14k a frame;
  • from the index: 500-900 a frame;
  • under the views' lock: 100-157 a frame, from about 2 minutes into the world onward.

So existing shapes are lock-free, as you say. At this rate, 100+ new shapes still go through the lock every frame (~130k/min).

After the cap, reuse goes under the lock too. In shape_number, a None from Views::shape returns before anything is stored in SHAPE_NUMBERS, and nothing is written to SHAPE_INDEX. So a view whose shape could not be numbered is never found lock-free afterwards. Every later use of it, every frame, does all of this:

  1. misses the thread's list;
  2. probes the index to an empty slot;
  3. takes VIEWS in Views::shape (returns None again);
  4. takes VIEWS again in words_for → entry.

The number of such views in use only grows after the cap, so the cost would climb, not stay flat. That's still a reading of the code, not a measurement.

Next run: a diagnostics build that adds three things to shapes_line:

  • lookups refused because the table is full, per frame;
  • the shape count against SHAPES;
  • how many distinct values each of the 29 shape words takes.

We'll play past the cap on it and post the counters next to the freezes and the write-combined census, as you suggested. The per-word counts should show what makes this title's views distinct: whether a size or count word takes thousands of values.

**@⁠Proudnoob4** on GitHub · 2026-12-06 02:15 UTC · [original](https://github.com/gamingwithhomie/larp/issues/330#issuecomment-7449807236) Thanks, that's a fair correction. Here's what our run's `shapes_line` gives, and one point in the code path. **Before the cap** (`placed views' shapes numbered per frame`, 18 min of the same run): - from the thread's own list: 11-14k a frame; - from the index: 500-900 a frame; - under the views' lock: 100-157 a frame, from about 2 minutes into the world onward. So existing shapes are lock-free, as you say. At this rate, 100+ new shapes still go through the lock every frame (~130k/min). **After the cap, reuse goes under the lock too.** In `shape_number`, a `None` from `Views::shape` returns before anything is stored in `SHAPE_NUMBERS`, and nothing is written to `SHAPE_INDEX`. So a view whose shape could not be numbered is never found lock-free afterwards. Every later use of it, every frame, does all of this: 1. misses the thread's list; 2. probes the index to an empty slot; 3. takes `VIEWS` in `Views::shape` (returns `None` again); 4. takes `VIEWS` again in `words_for` → `entry`. The number of such views in use only grows after the cap, so the cost would climb, not stay flat. That's still a reading of the code, not a measurement. **Next run:** a diagnostics build that adds three things to `shapes_line`: - lookups refused because the table is full, per frame; - the shape count against `SHAPES`; - how many distinct values each of the 29 shape words takes. We'll play past the cap on it and post the counters next to the freezes and the write-combined census, as you suggested. The per-word counts should show what makes this title's views distinct: whether a size or count word takes thousands of values.
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-12-06 03:16 UTC · original

Follow-up with the counters @⁠vanya890 asked for: one 40-min manual session on a diagnostics build (same machine: RTX 4080, i5-13600K, 32 GB, Win10, Series X). The build adds three counters to shapes_line: refused lookups, the shape count, and distinct values per shape word. Two-minute bins, busy windows only (>=3000 draws):

UTC fps ms preparing draws shapes refused/frame larp private GB RAM free GB hard faults/s slow XMA passes
02:38 26.2 22.2 4493 0.77 M 0 26.2 1.3 2404 86
02:50 20.1 26.4 6151 2.33 M 0 28.0 3.0 902 10
02:58 15.2 32.0 7215 3.62 M 0 28.9 3.4 5084 150
03:04 19.6 25.0 6119 full 192 30.1 3.5 406 42
03:08 14.8 33.4 9262 full 1051 30.9 3.7 10220 268
03:12 11.9 40.3 10851 full 1318 31.9 3.6 7262 226

What this changes from my first comment:

  • The cap is not the cliff. The shape table filled at 03:04, but fps had already fallen before that, and there was no step at the moment it filled. Preparing time per 1k draws stayed at 3.2–6.6 ms (median of each bin) the whole session, so most of the fps loss follows the draw count. The diagnostics logging also inflates the per-draw cost: it writes 1.6 M XMA debug lines in this run alone. So I can't claim a per-draw slowdown from this run.

  • After the cap, refused views go into the view table, and that grows too. "Of the view table's entries … views of placed memory" went 0 → 3.25 M in 8 minutes. That is a second unbounded structure, reached only after the cap.

  • Memory pressure is the clearer signal. larp's private bytes grew 22.7 → 31.9 GB. The working set stayed at ~15–16 GB and free RAM at 0.5–4 GB. The resident part of file mappings fell 11.4 → 5.1 GB as Windows evicted them. Hard faults reached 7–10k/s in the last 6 minutes, and the slow XMA passes peak in the same bins (268, 178, 226 per 2 min). That supports your paging explanation for the late audio.

  • What grew after the world loaded (02:38 → 03:12), from the copystat memory map:

    • write-combined: 14.5 → 16.3 GB;
    • process heap: 3.0 → 4.7 GB;
    • title heaps: 4.9 → 6.0 GB;
    • other private allocations of 1 MB and more: 3.9 → 5.1 GB.

    The process heap's growth tracks the shapes and the later view-table entries, at roughly 260–270 bytes each. That is an inference from the timing, not a measurement.

  • Which shape words vary: 7 of the 29 take 4096+ distinct values (the counter stops counting at 4096): w2, w5 and w14 of the resource words, and view words 3, 4, 6 and 9 (w18, w19, w21, w24). The other words take at most 75 values. Those seven are what make nearly every view a new shape.

Next on our side: find what those seven words hold, and test a bounded shapes/view table on a release build, judged by RAM and hard faults over a 40-min session.

**@⁠Proudnoob4** on GitHub · 2026-12-06 03:16 UTC · [original](https://github.com/gamingwithhomie/larp/issues/330#issuecomment-7450564192) Follow-up with the counters @⁠vanya890 asked for: one 40-min manual session on a diagnostics build (same machine: RTX 4080, i5-13600K, 32 GB, Win10, Series X). The build adds three counters to `shapes_line`: refused lookups, the shape count, and distinct values per shape word. Two-minute bins, busy windows only (>=3000 draws): | UTC | fps | ms preparing | draws | shapes | refused/frame | larp private GB | RAM free GB | hard faults/s | slow XMA passes | |---|---|---|---|---|---|---|---|---|---| | 02:38 | 26.2 | 22.2 | 4493 | 0.77 M | 0 | 26.2 | 1.3 | 2404 | 86 | | 02:50 | 20.1 | 26.4 | 6151 | 2.33 M | 0 | 28.0 | 3.0 | 902 | 10 | | 02:58 | 15.2 | 32.0 | 7215 | 3.62 M | 0 | 28.9 | 3.4 | 5084 | 150 | | 03:04 | 19.6 | 25.0 | 6119 | full | 192 | 30.1 | 3.5 | 406 | 42 | | 03:08 | 14.8 | 33.4 | 9262 | full | 1051 | 30.9 | 3.7 | 10220 | 268 | | 03:12 | 11.9 | 40.3 | 10851 | full | 1318 | 31.9 | 3.6 | 7262 | 226 | What this changes from my first comment: - **The cap is not the cliff.** The shape table filled at 03:04, but fps had already fallen before that, and there was no step at the moment it filled. Preparing time per 1k draws stayed at 3.2–6.6 ms (median of each bin) the whole session, so most of the fps loss follows the draw count. The diagnostics logging also inflates the per-draw cost: it writes 1.6 M XMA debug lines in this run alone. So I can't claim a per-draw slowdown from this run. - **After the cap, refused views go into the view table, and that grows too.** "Of the view table's entries … views of placed memory" went 0 → 3.25 M in 8 minutes. That is a second unbounded structure, reached only after the cap. - **Memory pressure is the clearer signal.** larp's private bytes grew 22.7 → 31.9 GB. The working set stayed at ~15–16 GB and free RAM at 0.5–4 GB. The resident part of file mappings fell 11.4 → 5.1 GB as Windows evicted them. Hard faults reached 7–10k/s in the last 6 minutes, and the slow XMA passes peak in the same bins (268, 178, 226 per 2 min). That supports your paging explanation for the late audio. - **What grew after the world loaded (02:38 → 03:12), from the `copystat` memory map:** - write-combined: 14.5 → 16.3 GB; - process heap: 3.0 → 4.7 GB; - title heaps: 4.9 → 6.0 GB; - other private allocations of 1 MB and more: 3.9 → 5.1 GB. The process heap's growth tracks the shapes and the later view-table entries, at roughly 260–270 bytes each. That is an inference from the timing, not a measurement. - **Which shape words vary:** 7 of the 29 take 4096+ distinct values (the counter stops counting at 4096): w2, w5 and w14 of the resource words, and view words 3, 4, 6 and 9 (w18, w19, w21, w24). The other words take at most 75 values. Those seven are what make nearly every view a new shape. Next on our side: find what those seven words hold, and test a bounded shapes/view table on a release build, judged by RAM and hard faults over a 40-min session.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/gamingwithhomie--larp#330
No description provided.