Repository navigation
Preview: keep rendering past the cached frames after a loop or restart - #1920
Conversation
The playback prefetch only looked ahead*3 frames (96 with 16 workers) for uncached frames. After a loop or a restart from the start those were all cached, so the workers stood idle until the playhead came within that window of the end of the cached run, then the preview stalled. A playing preview now looks as far ahead as the RAM preview holds (and the range spans) for the next uncached frames, still queuing at most ahead at a time; eviction already spares the frames the playhead reaches first (storytold#595). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…head × 3 wide Looking up to the whole RAM preview for uncached frames let the workers spread over the preview while the playhead waited. On the GPU each worker then built a Classic 3D atlas for its own set of layers, and on a cold start of the storytold#1812 project the device ran out of memory far more often (first pass 1-56 % of real time instead of 63-81 %). The window now keeps its old width but starts at the first frame ahead that isn't cached, so a loop or a restart still renders on at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A correction to this PR, pushed as ac5799b. The first version looked for uncached frames as far ahead as the whole RAM preview. On a cold start of the #1812 project with the GPU compositor, that made things worse. While the playhead waited, the 16 workers spread over the whole preview. Frames from different parts of the timeline have different sets of 3D layers, so each worker built a Classic 3D atlas of its own.
My earlier measurements didn't catch it because they started from a warm cache. With Software Only both versions play at 99–100 %, so only the GPU path was affected. The window now keeps its old width ( 🤖 Generated with Claude Code |
What you see
Play a comp that is only partly cached, stop, and play it again from the start (or let it loop). Rendering stops: the CPU sits idle and the green cache bar doesn't grow. It resumes only when the playhead is about 1.6 s before the end of the cached run. If rendering can't catch up from there, playback stalls.
Cause
While a preview plays,
update_playbacklooks for uncached frames only withinahead * 3frames of the playhead.aheadis twice the number of frame workers, so the window is 96 frames with 16 workers: 1.6 s at 60 fps. After a loop or a restart all of those are cached, so nothing gets queued.Change
A playing preview now looks for the next uncached frames as far ahead as the RAM preview holds, capped at the length of the range. It still queues at most
aheadframes at a time.The far-ahead frames don't push out the near ones. When the cache is full, eviction removes the frames the playhead reaches last (#595, #793). While paused, the window is unchanged.
Measured
Windows 11, 16 threads, #1812 project at Quarter. The test: play from 0 for 12 s, stop, play from 0 again.
Test
playback_prefetches_past_the_cached_frames_ahead: frames 0–119 are cached (more than the widest old window), playback starts at 0, and a frame past 119 must render within the first second. Onmainthe test fails.Related
#1121 (open) fixes a different stall: the order in which prefetch frames finish. It touches
cache_when_idlein the same file, so whichever lands second may need a small rebase.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests