perf(gpu): async copy/reset, fast bind/stand/views, texevents pool, and steady-world async PSOs #424

Open
github-bot wants to merge 1 commit from github-bot/gh-424 into main AGit
Owner

@⁠kirksw on GitHub · 2026-12-06 00:40 UTC · original
kirksw:perf/wave-2 → main · +4069 −826 · 21 files · 1 commits · open

TL;DR

Follow-up wave of Tracy-driven CPU-overhead and worst-frame-low optimizations for larp-gpu on top of PR #185, targeting the remaining recording (draw: bind, heap_buffers, ExecuteIndirect, descriptor views), submission (copy_send, allocator resets, texevents uploads), and steady-world PSO compilation hotspots:

  • Submission prep time: 7.1–10.3 ms/f (PR #185) → 1.8–2.2 ms/f (~3–4× lower prep overhead)
  • Worst-frame lows (11+ min open-world driving): 94–123 ms spikes → 47.6 ms avg worst (21.0 fps), with 37.8 fps avg (peak 47.1 fps) and 24.2 fps (41.4 ms, best 25.7 ms) 1% lows at 7,153 draws/frame
  • Audited: Every major hunk was adversarially audited (fence-wait latches, bind epochs/UAVs/stand carry, copy-batch snapshots, bounded reaper Send/64 MiB byte budget, TableScratch undo, FLAG_EVENT_SHOWN, HeapSpans per-list materialization)
  • Rollback-safe & accuracy-preserving defaults: All six rendering-exact optimizations default to ON (<FLAG>=0 to disable); LARP_OPT_ASYNC_WORLD_PSOS is opt-in (default OFF, <FLAG>=1 to enable) because it trades momentary pop-in on newly-seen non-lasting geometry/decal draws for worst-frame consistency. Every flag is documented in docs/environment-variables.md, with no shader-cache invalidation.

Overall Progression (Series X · 4K · Hardware RT ON · RTX 4090)

Build Draws/f Avg FPS (Peak) Prep Median 1% Low (P99) Worst-Frame Low
Baseline (f9fb54c, 48.8 min) 6,714 31.0 fps — 31.2 ms 15.4 fps (65.1 ms) —
PR #185 (perf/cpu-and-lows) 5,900–7,850 37.4–41.7 fps 5.9–7.2 ms 23.1–26.3 ms 22.1–29.9 fps (33.5–45.3 ms) 18.5–25.4 fps (39–54 ms) (before streaming PSO spikes)
Wave 2 (default ON, 15.5 min) 7,013 39.3 fps (48.7) 1.8 ms 24.6 ms 25.9 fps (38.6 ms, best 24.0 ms) 10.6 fps (94.1 ms, PSO spikes)
Wave 2 + LARP_OPT_ASYNC_WORLD_PSOS=1 (11.2 min driving) 7,153 37.8 fps (47.1) 2.2 ms 25.3 ms 24.2 fps (41.4 ms, best 25.7 ms) 21.0 fps (47.6 ms)

Testing note: During development we wired temporary live toggles into the F10 overlay menu in our local testing build for A/B verification. Those UI toggles were stripped from this branch to keep the PR focused and minimal, leaving only the clean LARP_* environment-variable switches in crates/larp-gpu/src/perf_flags.rs.


Test Machine & Configuration

  • CPU: Intel Core i7-12700K (12C / 20T)
  • GPU: MSI RTX 4090 Gaming Trio (24 GB VRAM, NVIDIA DRS shader heap profile 2048 MiB, D3D12 Agility SDK 1.620.2)
  • RAM: 32 GB DDR5-6400 CL40
  • Storage: Samsung 980 PRO 2 TB NVMe SSD
  • Console profile: --console series-x (4K 3840x2160, Hardware RT ON Tier 1.2, DLSS Preset M via Streamline, Frame Generation OFF)
  • Active settings.ini overrides:
    • frame_rate = 60, desired_fps = 60
    • frame_generation = off, reflex = off
    • lighting_quality = ultra, reflection_quality = ultra
    • hair_gpu_memory_budget = ultra, hair_simulation_quality = ultra

Profiling

Captured 30-second fine-grained open-world traces with Tracy (--profile tracy --features tracy, LARP_TRACY_FINE=1, 888 frames / 154M CPU zones / 915k GPU events). Each remaining hotspot mapped directly to one of the optimizations below:

Tracy Hotspot Cost / Frequency Root Cause Addressed By
draw: bind / stand() 49.4 ms/f self (recording threads) 256-byte scratch rounding + mutex per table, redundant layout/record re-reads & Arc clones LARP_OPT_FAST_STAND, LARP_OPT_FAST_BIND
draw: heap buffer views pass 11.3 ms/f self (5.2k calls/f) 7-thread HEAP_PICKS lock convoy, global WHOLE map, linear watch scans, per-list span rebuild LARP_OPT_FAST_BIND (HeapPass + HeapSpans)
ExecuteIndirect + descriptor views High per-draw / per-view lock churn Global buffers/changed locks in note_buffer, double record reads, per-slot copy lookups LARP_OPT_FAST_VIEWS
copy_send / small_and_heap_send 6.5 ms/f on submission thread Synchronous copy-queue recording/submission blocking Host::submit LARP_OPT_ASYNC_COPY
Allocator resets & deferred COM drops larp-land & submit tail spikes Synchronous allocator.Reset(), Vec::remove(0) on held queues, inline deferred COM drops LARP_OPT_ASYNC_RESET
texevents uploads & reaper bursts Streaming spikes & stripe contention Repeated 32 MiB texevents upload allocs, unpaced reaper drops, shadow::loose under lock LARP_OPT_TEX_POOL
Mid-gameplay PSO compile freezes 94–123 ms worst-frame spikes Blocking wait_for() on newly-seen non-lasting geometry/decal PSOs during open-world driving LARP_OPT_ASYNC_WORLD_PSOS=1 (opt-in)

Changes

  1. Async copy-queue worker & upload coalescing (LARP_OPT_ASYNC_COPY)
    • Why: copy_send ran synchronously on the submission thread, dominating Host::submit prep time (6.5+ ms/f).
    • What: Offloads disjoint copy-queue recording/submission to a dedicated larp-copy worker thread (with FIFO fence ordering and drain_copy_worker() sync points), switches copy_runs to O(N log N) BTreeMap overlap merging, and coalesces contiguous upload ranges.
  2. Dirty-root fast bind & per-heap HeapSpans snapshot (LARP_OPT_FAST_BIND)
    • Why: draw::State::bind re-walked unchanged root slots and re-kept PSOs per draw, while heap_buffers() serialized all recording threads on HEAP_PICKS and rebuilt span lists repeatedly.
    • What: Tracks dirty root bitmasks per bind point (with epoch/UAV/bufobj invalidation), caches stage_lists last view & per-list kept PSOs, publishes an immutable per-heap HeapSpans Arc once per frame (HeapPass), uses a two-tier BTreeMap watch index, and materializes HeapSpans once per batch in Host::submit.
  3. TableScratch bump allocator & stand() fast paths (LARP_OPT_FAST_STAND)
    • Why: State::place() locked list.scratch and rounded every 16–64 B table up to 256 B; stand() re-decoded transient layouts/records multiple times and cloned Arc<Shadow> on every lookup.
    • What: Adds a state-local 4-byte-packed TableScratch bump allocator (with scratch_undo rollback on view failure), bit-exact memcmp layout verification, single-read DecodedRecord decoding, borrowed Memo::find_ref, and fixes a stand() carry-bit bug.
  4. Lock-free view dirty bitmap & ExecuteIndirect fast paths (LARP_OPT_FAST_VIEWS)
    • Why: note_buffer and view mirroring contended on per-heap locks and re-read descriptor records multiple times per slot.
    • What: Adds a lock-free two-level changed_bits/changed_summary bitmap, FLAG_EVENT_SHOWN tracking, single-read mirror_written, contiguous copy_simple heap-lookup hoisting, and ExecuteIndirect repeat caching.
  5. Async allocator resets & bounded deferred COM offload (LARP_OPT_ASYNC_RESET)
    • Why: Synchronous allocator resets and deferred upload/COM drops stalled larp-land and Host::submit.
    • What: Offloads allocator resets and deferred COM drops (ReapedDeferred, paced and bounded by the 64 MiB REAPER_BYTE_BUDGET) to background workers, and switches held queue storage to VecDeque.
  6. Texture-event arena pool & contention fixes (LARP_OPT_TEX_POOL)
    • Why: Streaming bursts repeatedly allocated/freed 32 MiB texevents upload arenas and contended on HostHeap::made and shadow::loose.
    • What: Pools 32 MiB texevents upload arenas, paces large reaper batches (yield_now() every 16 drops), drops shadow::loose outside the lock, and expands HostHeap::made to 256 stripes.
  7. Steady-world async non-lasting PSOs (LARP_OPT_ASYNC_WORLD_PSOS, opt-in / default OFF)
    • Why: Newly encountered non-lasting geometry/decal/prop PSOs during open-world driving caused 94–123 ms worst-frame hitches.
    • What: When explicitly opted in (LARP_OPT_ASYNC_WORLD_PSOS=1) and steady 3D world rendering is established (>= 120 consecutive frames with >= 500 draws), lets newly-seen non-lasting graphics PSOs compile asynchronously on background workers without blocking the frame.
    • Tradeoff: Trades strict draw accuracy for frame-time consistency — newly-seen non-lasting draws (e.g., decals, distant props, streaming geometry) can experience repeated draw omission across multiple frames (for a CPU-dependent duration, uncapped by dropped_once) until background workers finish compiling the PSO, whereas all lasting, compute, lighting, hair, and LUT pipelines still wait synchronously. Kept OFF by default so default rendering remains 100% exact.
  8. Documentation
    • Documents all new LARP_* environment variables and defaults in docs/environment-variables.md.

Verification

  • cargo check --release --locked -p larp and cargo check --release --locked -p larp-gpu --features diagnostics pass with zero warnings in larp-gpu.
  • git diff --check passes cleanly on top of gamingwithhomie/larp:main (d2a79dd, including #335 dropped_once fix).
  • Verified across 11+ minutes of continuous open-world driving (larp-play-20261206-005035.log: 37.8 fps avg, 2.2 ms prep, 41.4 ms 1% low, 47.6 ms worst frame) and 30-second fine Tracy captures (cnf-post-p12-fix-30s).
  • No changes to crates/larp-shader or shader_cache.rs (does not invalidate existing shader caches).
  • Every default-ON optimization can be disabled individually via <FLAG>=0; LARP_OPT_ASYNC_WORLD_PSOS is opt-in (=1 to enable).

Made with assistance of AI:

  • Antigravity w/ Gemini 4 Neon
  • Codex w/ Astra 6.2
  • Claude Code w/ Claude Opus 5.5
**@⁠kirksw** on GitHub · 2026-12-06 00:40 UTC · [original](https://github.com/gamingwithhomie/larp/pull/424) `kirksw:perf/wave-2` → `main` · +4069 −826 · 21 files · 1 commits · open ## TL;DR Follow-up wave of Tracy-driven CPU-overhead and worst-frame-low optimizations for `larp-gpu` on top of PR #185, targeting the remaining recording (`draw: bind`, `heap_buffers`, `ExecuteIndirect`, descriptor views), submission (`copy_send`, allocator resets, `texevents` uploads), and steady-world PSO compilation hotspots: - **Submission prep time:** `7.1–10.3 ms/f` (PR #185) → **`1.8–2.2 ms/f`** (**~3–4× lower prep overhead**) - **Worst-frame lows (11+ min open-world driving):** `94–123 ms` spikes → **`47.6 ms` avg worst (`21.0 fps`)**, with **`37.8 fps` avg** (peak **`47.1 fps`**) and **`24.2 fps` (`41.4 ms`, best `25.7 ms`) 1% lows** at `7,153` draws/frame - **Audited:** Every major hunk was adversarially audited (fence-wait latches, bind epochs/UAVs/stand carry, copy-batch snapshots, bounded reaper `Send`/64 MiB byte budget, `TableScratch` undo, `FLAG_EVENT_SHOWN`, `HeapSpans` per-list materialization) - **Rollback-safe & accuracy-preserving defaults:** All six rendering-exact optimizations default to ON (`<FLAG>=0` to disable); **`LARP_OPT_ASYNC_WORLD_PSOS` is opt-in (default OFF, `<FLAG>=1` to enable)** because it trades momentary pop-in on newly-seen non-lasting geometry/decal draws for worst-frame consistency. Every flag is documented in `docs/environment-variables.md`, with no shader-cache invalidation. ### Overall Progression (Series X · 4K · Hardware RT ON · RTX 4090) | Build | Draws/f | Avg FPS (Peak) | Prep | Median | **1% Low (P99)** | **Worst-Frame Low** | |---|---|---|---|---|---|---| | Baseline (`f9fb54c`, 48.8 min) | 6,714 | 31.0 fps | — | 31.2 ms | 15.4 fps (65.1 ms) | — | | PR #185 (`perf/cpu-and-lows`) | 5,900–7,850 | 37.4–41.7 fps | 5.9–7.2 ms | 23.1–26.3 ms | 22.1–29.9 fps (33.5–45.3 ms) | 18.5–25.4 fps (39–54 ms) *(before streaming PSO spikes)* | | Wave 2 (default ON, 15.5 min) | 7,013 | **39.3 fps (48.7)** | **1.8 ms** | **24.6 ms** | **25.9 fps (38.6 ms, best 24.0 ms)** | 10.6 fps (94.1 ms, PSO spikes) | | **Wave 2 + `LARP_OPT_ASYNC_WORLD_PSOS=1` (11.2 min driving)** | 7,153 | **37.8 fps (47.1)** | **2.2 ms** | **25.3 ms** | **24.2 fps (41.4 ms, best 25.7 ms)** | **21.0 fps (47.6 ms)** | > **Testing note:** During development we wired temporary live toggles into the `F10` overlay menu in our local testing build for A/B verification. Those UI toggles were stripped from this branch to keep the PR focused and minimal, leaving only the clean `LARP_*` environment-variable switches in `crates/larp-gpu/src/perf_flags.rs`. --- ## Test Machine & Configuration - **CPU:** Intel Core i7-12700K (12C / 20T) - **GPU:** MSI RTX 4090 Gaming Trio (24 GB VRAM, NVIDIA DRS shader heap profile `2048 MiB`, D3D12 Agility SDK `1.620.2`) - **RAM:** 32 GB DDR5-6400 CL40 - **Storage:** Samsung 980 PRO 2 TB NVMe SSD - **Console profile:** `--console series-x` (4K `3840x2160`, Hardware RT ON Tier 1.2, DLSS Preset M via Streamline, Frame Generation OFF) - **Active `settings.ini` overrides:** - `frame_rate = 60`, `desired_fps = 60` - `frame_generation = off`, `reflex = off` - `lighting_quality = ultra`, `reflection_quality = ultra` - `hair_gpu_memory_budget = ultra`, `hair_simulation_quality = ultra` --- ## Profiling Captured 30-second fine-grained open-world traces with **Tracy** (`--profile tracy --features tracy`, `LARP_TRACY_FINE=1`, 888 frames / `154M` CPU zones / `915k` GPU events). Each remaining hotspot mapped directly to one of the optimizations below: | Tracy Hotspot | Cost / Frequency | Root Cause | Addressed By | |---|---|---|---| | `draw: bind` / `stand()` | `49.4 ms/f` self (recording threads) | 256-byte scratch rounding + mutex per table, redundant layout/record re-reads & `Arc` clones | `LARP_OPT_FAST_STAND`, `LARP_OPT_FAST_BIND` | | `draw: heap buffer views pass` | `11.3 ms/f` self (5.2k calls/f) | 7-thread `HEAP_PICKS` lock convoy, global `WHOLE` map, linear watch scans, per-list span rebuild | `LARP_OPT_FAST_BIND` (`HeapPass` + `HeapSpans`) | | `ExecuteIndirect` + descriptor views | High per-draw / per-view lock churn | Global `buffers`/`changed` locks in `note_buffer`, double record reads, per-slot copy lookups | `LARP_OPT_FAST_VIEWS` | | `copy_send` / `small_and_heap_send` | `6.5 ms/f` on submission thread | Synchronous copy-queue recording/submission blocking `Host::submit` | `LARP_OPT_ASYNC_COPY` | | Allocator resets & deferred COM drops | `larp-land` & submit tail spikes | Synchronous `allocator.Reset()`, `Vec::remove(0)` on held queues, inline deferred COM drops | `LARP_OPT_ASYNC_RESET` | | `texevents` uploads & reaper bursts | Streaming spikes & stripe contention | Repeated 32 MiB `texevents` upload allocs, unpaced reaper drops, `shadow::loose` under lock | `LARP_OPT_TEX_POOL` | | Mid-gameplay PSO compile freezes | `94–123 ms` worst-frame spikes | Blocking `wait_for()` on newly-seen non-lasting geometry/decal PSOs during open-world driving | `LARP_OPT_ASYNC_WORLD_PSOS=1` *(opt-in)* | --- ## Changes 1. **Async copy-queue worker & upload coalescing (`LARP_OPT_ASYNC_COPY`)** - *Why:* `copy_send` ran synchronously on the submission thread, dominating `Host::submit` prep time (`6.5+ ms/f`). - *What:* Offloads disjoint copy-queue recording/submission to a dedicated `larp-copy` worker thread (with FIFO fence ordering and `drain_copy_worker()` sync points), switches `copy_runs` to `O(N log N)` `BTreeMap` overlap merging, and coalesces contiguous upload ranges. 2. **Dirty-root fast bind & per-heap `HeapSpans` snapshot (`LARP_OPT_FAST_BIND`)** - *Why:* `draw::State::bind` re-walked unchanged root slots and re-kept PSOs per draw, while `heap_buffers()` serialized all recording threads on `HEAP_PICKS` and rebuilt span lists repeatedly. - *What:* Tracks dirty root bitmasks per bind point (with epoch/UAV/bufobj invalidation), caches `stage_lists` last view & per-list kept PSOs, publishes an immutable per-heap `HeapSpans` `Arc` once per frame (`HeapPass`), uses a two-tier `BTreeMap` watch index, and materializes `HeapSpans` once per batch in `Host::submit`. 3. **`TableScratch` bump allocator & `stand()` fast paths (`LARP_OPT_FAST_STAND`)** - *Why:* `State::place()` locked `list.scratch` and rounded every 16–64 B table up to 256 B; `stand()` re-decoded transient layouts/records multiple times and cloned `Arc<Shadow>` on every lookup. - *What:* Adds a state-local 4-byte-packed `TableScratch` bump allocator (with `scratch_undo` rollback on view failure), bit-exact `memcmp` layout verification, single-read `DecodedRecord` decoding, borrowed `Memo::find_ref`, and fixes a `stand()` carry-bit bug. 4. **Lock-free view dirty bitmap & `ExecuteIndirect` fast paths (`LARP_OPT_FAST_VIEWS`)** - *Why:* `note_buffer` and view mirroring contended on per-heap locks and re-read descriptor records multiple times per slot. - *What:* Adds a lock-free two-level `changed_bits`/`changed_summary` bitmap, `FLAG_EVENT_SHOWN` tracking, single-read `mirror_written`, contiguous `copy_simple` heap-lookup hoisting, and `ExecuteIndirect` repeat caching. 5. **Async allocator resets & bounded deferred COM offload (`LARP_OPT_ASYNC_RESET`)** - *Why:* Synchronous allocator resets and deferred upload/COM drops stalled `larp-land` and `Host::submit`. - *What:* Offloads allocator resets and deferred COM drops (`ReapedDeferred`, paced and bounded by the `64 MiB` `REAPER_BYTE_BUDGET`) to background workers, and switches held queue storage to `VecDeque`. 6. **Texture-event arena pool & contention fixes (`LARP_OPT_TEX_POOL`)** - *Why:* Streaming bursts repeatedly allocated/freed 32 MiB `texevents` upload arenas and contended on `HostHeap::made` and `shadow::loose`. - *What:* Pools 32 MiB `texevents` upload arenas, paces large reaper batches (`yield_now()` every 16 drops), drops `shadow::loose` outside the lock, and expands `HostHeap::made` to 256 stripes. 7. **Steady-world async non-lasting PSOs (`LARP_OPT_ASYNC_WORLD_PSOS`, opt-in / default OFF)** - *Why:* Newly encountered non-lasting geometry/decal/prop PSOs during open-world driving caused 94–123 ms worst-frame hitches. - *What:* When explicitly opted in (`LARP_OPT_ASYNC_WORLD_PSOS=1`) and steady 3D world rendering is established (`>= 120` consecutive frames with `>= 500` draws), lets newly-seen non-lasting graphics PSOs compile asynchronously on background workers without blocking the frame. - *Tradeoff:* Trades strict draw accuracy for frame-time consistency — newly-seen non-lasting draws (e.g., decals, distant props, streaming geometry) can experience repeated draw omission across multiple frames (for a CPU-dependent duration, uncapped by `dropped_once`) until background workers finish compiling the PSO, whereas all lasting, compute, lighting, hair, and LUT pipelines still wait synchronously. Kept **OFF by default** so default rendering remains 100% exact. 8. **Documentation** - Documents all new `LARP_*` environment variables and defaults in `docs/environment-variables.md`. --- ## Verification - `cargo check --release --locked -p larp` and `cargo check --release --locked -p larp-gpu --features diagnostics` pass with **zero warnings in `larp-gpu`**. - `git diff --check` passes cleanly on top of `gamingwithhomie/larp:main` (`d2a79dd`, including `#335` `dropped_once` fix). - Verified across 11+ minutes of continuous open-world driving (`larp-play-20261206-005035.log`: `37.8 fps` avg, `2.2 ms` prep, `41.4 ms` 1% low, `47.6 ms` worst frame) and 30-second fine Tracy captures (`cnf-post-p12-fix-30s`). - No changes to `crates/larp-shader` or `shader_cache.rs` (does not invalidate existing shader caches). - Every default-ON optimization can be disabled individually via `<FLAG>=0`; `LARP_OPT_ASYNC_WORLD_PSOS` is opt-in (`=1` to enable). --- Made with assistance of AI: - Antigravity w/ Gemini 4 Neon - Codex w/ Astra 6.2 - Claude Code w/ Claude Opus 5.5
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 00:41:50 +00:00
Author
Owner

@⁠vanya890 on GitHub · 2026-12-06 00:47 UTC · original

One user-visible trade-off to make explicit before enabling this by default: when the new branch in pipeline/make.rs::ready() skips waiting, ready() returns None until the worker publishes the PSO. pipeline::host_pipeline() propagates that None, and draw::State::prepare_for() returns false, so draws using that PSO are dropped on every frame until compilation finishes.

Unlike the existing wait-budget path, this branch does not set/use dropped_once to cap the drop to one frame. With LARP_OPT_ASYNC_WORLD_PSOS defaulting on, newly encountered non-lasting geometry/decals/props may therefore remain absent for multiple frames on slower CPUs. That may be an acceptable hitch-vs-pop-in trade-off, but I think the PR and env-var docs should state it explicitly; alternatively consider keeping this opt-in by default until the visual behavior is validated on lower-end CPUs.

**@⁠vanya890** on GitHub · 2026-12-06 00:47 UTC · [original](https://github.com/gamingwithhomie/larp/pull/424#issuecomment-7448654629) One user-visible trade-off to make explicit before enabling this by default: when the new branch in `pipeline/make.rs::ready()` skips waiting, `ready()` returns `None` until the worker publishes the PSO. `pipeline::host_pipeline()` propagates that `None`, and `draw::State::prepare_for()` returns `false`, so draws using that PSO are dropped on every frame until compilation finishes. Unlike the existing wait-budget path, this branch does not set/use `dropped_once` to cap the drop to one frame. With `LARP_OPT_ASYNC_WORLD_PSOS` defaulting on, newly encountered non-lasting geometry/decals/props may therefore remain absent for multiple frames on slower CPUs. That may be an acceptable hitch-vs-pop-in trade-off, but I think the PR and env-var docs should state it explicitly; alternatively consider keeping this opt-in by default until the visual behavior is validated on lower-end CPUs.
Author
Owner

@⁠kirksw on GitHub · 2026-12-06 00:50 UTC · original

One user-visible trade-off to make explicit before enabling this by default: when the new branch in pipeline/make.rs::ready() skips waiting, ready() returns None until the worker publishes the PSO. pipeline::host_pipeline() propagates that None, and draw::State::prepare_for() returns false, so draws using that PSO are dropped on every frame until compilation finishes.

Unlike the existing wait-budget path, this branch does not set/use dropped_once to cap the drop to one frame. With LARP_OPT_ASYNC_WORLD_PSOS defaulting on, newly encountered non-lasting geometry/decals/props may therefore remain absent for multiple frames on slower CPUs. That may be an acceptable hitch-vs-pop-in trade-off, but I think the PR and env-var docs should state it explicitly; alternatively consider keeping this opt-in by default until the visual behavior is validated on lower-end CPUs.

Good point - I am allergic to poor frame pacing, usually playing games at 100+ fps so I took this approach, to trade off accuracy for consistency. But not everyone would agree.

I'm not sure what the optimal default would be however?

**@⁠kirksw** on GitHub · 2026-12-06 00:50 UTC · [original](https://github.com/gamingwithhomie/larp/pull/424#issuecomment-7448697028) > One user-visible trade-off to make explicit before enabling this by default: when the new branch in `pipeline/make.rs::ready()` skips waiting, `ready()` returns `None` until the worker publishes the PSO. `pipeline::host_pipeline()` propagates that `None`, and `draw::State::prepare_for()` returns `false`, so draws using that PSO are dropped on every frame until compilation finishes. > > Unlike the existing wait-budget path, this branch does not set/use `dropped_once` to cap the drop to one frame. With `LARP_OPT_ASYNC_WORLD_PSOS` defaulting on, newly encountered non-lasting geometry/decals/props may therefore remain absent for multiple frames on slower CPUs. That may be an acceptable hitch-vs-pop-in trade-off, but I think the PR and env-var docs should state it explicitly; alternatively consider keeping this opt-in by default until the visual behavior is validated on lower-end CPUs. Good point - I am allergic to poor frame pacing, usually playing games at 100+ fps so I took this approach, to trade off accuracy for consistency. But not everyone would agree. I'm not sure what the optimal default would be however?
Author
Owner

@⁠vanya890 on GitHub · 2026-12-06 00:55 UTC · original

I agree that avoiding frame-pacing stalls can justify this trade-off, especially on high-refresh systems. I would separate the policy from the implementation: keep the asynchronous path available, but make the default conservative until the visual behavior has been exercised on slower CPUs. A short wait budget (or the existing one-frame dropped_once behavior) could preserve most of the hitch reduction without allowing newly encountered draws to disappear for an unbounded number of frames. At minimum, the env-var docs should explicitly say that first-time world PSOs can cause repeated draw omission until compilation completes, and mention the CPU-dependent duration. This is a product default decision rather than a correctness bug; I don't think the optimization itself needs to be removed.

**@⁠vanya890** on GitHub · 2026-12-06 00:55 UTC · [original](https://github.com/gamingwithhomie/larp/pull/424#issuecomment-7448770322) I agree that avoiding frame-pacing stalls can justify this trade-off, especially on high-refresh systems. I would separate the policy from the implementation: keep the asynchronous path available, but make the default conservative until the visual behavior has been exercised on slower CPUs. A short wait budget (or the existing one-frame `dropped_once` behavior) could preserve most of the hitch reduction without allowing newly encountered draws to disappear for an unbounded number of frames. At minimum, the env-var docs should explicitly say that first-time world PSOs can cause repeated draw omission until compilation completes, and mention the CPU-dependent duration. This is a product default decision rather than a correctness bug; I don't think the optimization itself needs to be removed.
Author
Owner

@⁠kirksw on GitHub · 2026-12-06 01:02 UTC · original

@⁠vanya890 noted, i will change this to default disabled and add the clarifications around the tradeoff

**@⁠kirksw** on GitHub · 2026-12-06 01:02 UTC · [original](https://github.com/gamingwithhomie/larp/pull/424#issuecomment-7448852757) @⁠vanya890 noted, i will change this to default disabled and add the clarifications around the tradeoff
github-bot force-pushed github-bot/gh-424 from d4f00c0ab2 to 4b93c8bc79 2026-12-06 01:11:28 +00:00 Compare
github-bot force-pushed github-bot/gh-424 from 4b93c8bc79 to 592fe49f0f 2026-12-06 01:19:17 +00:00 Compare
Author
Owner

@⁠kirksw on GitHub · 2026-12-06 01:22 UTC · original

@⁠vanya890 Updated in 592fe49: \LARP_OPT_ASYNC_WORLD_PSOS\ now defaults to off (opt-in via =1/\on), and both \docs/environment-variables.md\ and the PR description explicitly document the multi-frame draw-omission / CPU-dependent duration tradeoff (and that lasting/compute/lighting/hair/LUT pipelines still wait synchronously). Thanks for the feedback!

**@⁠kirksw** on GitHub · 2026-12-06 01:22 UTC · [original](https://github.com/gamingwithhomie/larp/pull/424#issuecomment-7449128563) @⁠vanya890 Updated in 592fe49: \LARP_OPT_ASYNC_WORLD_PSOS\ now defaults to **off** (opt-in via \=1\/\on\), and both \docs/environment-variables.md\ and the PR description explicitly document the multi-frame draw-omission / CPU-dependent duration tradeoff (and that lasting/compute/lighting/hair/LUT pipelines still wait synchronously). Thanks for the feedback!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/424/head:github-bot/gh-424'
git switch 'github-bot/gh-424'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-424'
git switch 'github-bot/gh-424'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-424'
git switch 'github-bot/gh-424'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-424'
git switch 'main'
git merge --squash 'github-bot/gh-424'
git switch 'main'
git merge --ff-only 'github-bot/gh-424'
git switch 'main'
git merge 'github-bot/gh-424'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.