Frame pacing: far shadow cascades re-render together on registration events (+3.7 ms bursts) #825

Closed
opened 2026-10-17 18:47:34 +00:00 by sky_line · 2 comments
Owner

On a GTX 1080 at 4K, high settings, there are no hitches. But GPU time swings from frame to frame (mean 42.6 ms, p50 41.9, p95 45.9, max 48.5, std dev 1.8; frame-to-frame jitter p99 ~8-14 ms in the PACING lines). Pacing is the priority, so the uneven frames have to go.

Measured with RenderVKFrameJobLog (per-frame GPU time and the staggered jobs that frame carried; 1,051 frames):

Job Frames carrying it Delta
Sun cascades 2 + 3 re-render 279 (always together) +3.7 ms (45.3 vs 41.6)
Overlay into cascade 2 / 3 (RenderVKShadowFarCascadeInterval 2, alternating) ~2 of 3 +2.2 / +0.9 ms
Scheduled probe face 5 (+ cube filter) 1 in 6 +0.7 ms
Projector tile re-render rare +0.9 ms

Autocorrelation: −0.33 at lag 1 (the overlay alternation), +0.22 at lag 4 (the cascade bursts).

Root of the bursts: the event-driven cascade cache (RenderVKShadowEventCache). In steady state 0.48 cascades re-render per frame, and every one is shadowEvChgRegister: instance-store registration change events (new / released / re-shaped rows). Cascades 2 and 3 cover the whole surrounding area, so any such event hits both on the same frame. The scene isn't actually changing at that rate.

To do

  1. Find what registers instances ~6 times a second in a static scene. The first suspect is the clean-owned self-registration sweep (selfRegisterSweep / forceReingestObject). LOD switches and attachment re-registration are also possible. Then stop registrations that change no geometry, transform or material from emitting shadow-cache change spheres.
  2. Never re-render cascades 2 and 3 on the same frame: defer the second by a frame when both are due. Spread the overlay alternation and the probe filter so no single frame carries several jobs.
  3. Re-measure with RenderVKFrameJobLog and the PACING lines (p95, p99, jitter p99). Target: the p95-to-median gap under ~1 ms with no change in average.
On a GTX 1080 at 4K, high settings, there are no hitches. But GPU time swings from frame to frame (mean 42.6 ms, p50 41.9, p95 45.9, max 48.5, std dev 1.8; frame-to-frame jitter p99 ~8-14 ms in the PACING lines). Pacing is the priority, so the uneven frames have to go. **Measured** with `RenderVKFrameJobLog` (per-frame GPU time and the staggered jobs that frame carried; 1,051 frames): | Job | Frames carrying it | Delta | |---|---|---| | **Sun cascades 2 + 3 re-render** | 279 (always together) | **+3.7 ms** (45.3 vs 41.6) | | Overlay into cascade 2 / 3 (`RenderVKShadowFarCascadeInterval` 2, alternating) | ~2 of 3 | +2.2 / +0.9 ms | | Scheduled probe face 5 (+ cube filter) | 1 in 6 | +0.7 ms | | Projector tile re-render | rare | +0.9 ms | Autocorrelation: −0.33 at lag 1 (the overlay alternation), +0.22 at lag 4 (the cascade bursts). **Root of the bursts:** the event-driven cascade cache (`RenderVKShadowEventCache`). In steady state 0.48 cascades re-render per frame, and **every one is `shadowEvChgRegister`**: instance-store registration change events (new / released / re-shaped rows). Cascades 2 and 3 cover the whole surrounding area, so any such event hits both on the same frame. The scene isn't actually changing at that rate. **To do** 1. Find what registers instances ~6 times a second in a static scene. The first suspect is the clean-owned self-registration sweep (`selfRegisterSweep` / `forceReingestObject`). LOD switches and attachment re-registration are also possible. Then stop registrations that change no geometry, transform or material from emitting shadow-cache change spheres. 2. Never re-render cascades 2 and 3 on the same frame: defer the second by a frame when both are due. Spread the overlay alternation and the probe filter so no single frame carries several jobs. 3. Re-measure with `RenderVKFrameJobLog` and the PACING lines (p95, p99, jitter p99). Target: the p95-to-median gap under ~1 ms with no change in average.
sky_line added this to the Slipstream project 2026-10-17 18:47:34 +00:00
Author
Owner

Merged (7b0b79583b..e901887cac). GTX 1080, 4K, high settings: GPU mean 42.6 -> 37.4 ms, std dev 1.8 -> 0.61 ms, p95 45.9 -> 38.3 ms; far cascade re-renders 0.48 -> 0.045 per frame. Producer: fullbright/unlit flag toggles (b4/b12) and LOD bounding-box swaps emitting registration spheres. Remaining before close: correctness checks (move/edit near and far objects, glow/fullbright toggles must not re-render, projector tiles), then ship.

Merged (7b0b79583b..e901887cac). GTX 1080, 4K, high settings: GPU mean 42.6 -> 37.4 ms, std dev 1.8 -> 0.61 ms, p95 45.9 -> 38.3 ms; far cascade re-renders 0.48 -> 0.045 per frame. Producer: fullbright/unlit flag toggles (b4/b12) and LOD bounding-box swaps emitting registration spheres. Remaining before close: correctness checks (move/edit near and far objects, glow/fullbright toggles must not re-render, projector tiles), then ship.
Author
Owner

Fixed in Slipstream 1.3.0 (stable): https://git.slipstreamviewer.org/sky_line/Slipstream/releases/tag/v1.3.0

If you still see this on 1.3.0, reply here and we'll reopen it.

Fixed in **Slipstream 1.3.0** (stable): https://git.slipstreamviewer.org/sky_line/Slipstream/releases/tag/v1.3.0 If you still see this on 1.3.0, reply here and we'll reopen it.
Sign in to join this conversation.
No milestone
No project
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
sky_line/Slipstream#825
No description provided.