Repository navigation
perf(editor): avoid playback hitches during unrelated live edits - #2507
Merged
richiemcilroy merged 3 commits intoOct 18, 2026
Merged
richiemcilroy merged 3 commits into
richiemcilroy merged 3 commits into
Conversation
Contributor
|
@AksharP5 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
Thanks for the PR. Greptile currently has this at 4/5, and we only merge PRs once Greptile scores the current head 5/5. Please address the remaining Greptile feedback, then comment |
Contributor
Author
|
@greptileai Please re-review current head 03ebccf. The repeated-press finding is fixed: the high/low toggle now persists across presses while edit counts remain per press. Native playback verified that the next press changes the setting rather than writing the same value again. The current 4/5 summary still refers to the earlier 9df8106 commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changing background settings during GPUI playback can interrupt frame delivery on long recordings. Every project update currently reruns the cursor spring simulation across every recording source, even when the edit cannot change that simulation.
Reuse the existing timelines unless raw mode or the effective movement/click spring parameters change. Preview and playback share the existing bitwise settings key. Rendering, audio updates and zoom updates still receive the new project.
The existing playback benchmark now supports timed background or spring edits and reports gaps between renderer callbacks. It uses the real project watch channel and playback/rendering path used by GPUI.
Benchmark
Three serial, interleaved before/after runs; medians below. Each completed 300 submitted/rendered/callback frames, with no renderer drops or send failures.
The p95 gap is 60.2% lower for this workload. Per-run p95: main 44.77 / 44.99 / 44.66 ms; changed 17.76 / 17.83 / 17.84 ms.
Linux x86_64, i5-14400F, Rust 1.88, opt-level 3, FFmpeg 7.1, llvmpipe software Vulkan. Synthetic one-hour 320×180 H.264 recording, 216,001 sinusoidal mouse moves at 60 Hz and a click pair every five seconds; smoothed circle cursor. Preview base 480×270 at 60 fps; background padding alternates between 10 and 11 every 100 ms, starting 500 ms after
start()returns. Both binaries use the identical updated benchmark; baseline production code is main3d19c5cfa5.No-edit controls: p95 17.78 ms before / 17.81 ms after, zero skips. Changing spring tension still rebuilds: 44.95 ms / 55 skips after the fix. At 20 Hz, an initial baseline stress run completed with 243 skips; the next timed out at 136/300 frames. That incomplete stress run is excluded from the table.
These are callback delivery measurements from production playback, not GPUI window presentation or display scanout. Software Vulkan was used because this machine's installed NVIDIA userspace and loaded kernel driver versions differ.
Repeat with
--live-edit cursor-springfor the rebuild control; omit both edit flags for unchanged playback. Check the printed submitted frame count reaches 300 before comparing results, since the example also returns on timeout.Create the synthetic fixture
Save as
create-live-fixture.py, then runpython create-live-fixture.py /tmp/live-1h.cap. The output directory must not already exist; FFmpeg needs the libx264 encoder.Validation
cargo fmt --all,cargo check -p cap-editor, strict Clippy on all editor targets.Checked current public PRs/issues for duplicates. #2499 optimizes per-frame cursor event searches in rendering and complements this change; it does not address watch-update reconstruction.
Closes #2506.


Confidence Score: 5/5
The current head appears safe to merge; the repeated-press issue is fixed.Summary
Playback now reuses cursor timelines when edits leave raw mode and spring settings unchanged.
Reviews (2) · Last reviewed commit: "fix(editor): preserve live-edit toggles ..." · Reviewed by Greptile