Repository navigation
perf: skip frame clones for unchanged retained graphics - #4672
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughRetained graphics collection now accepts pane records directly. The update path skips constructing a patched surface when no row, cursor, metadata, or graphics changes exist. Tests cover unchanged graphics, later text updates, and text, image, and unchanged-image profile scenarios. A new justfile target runs the retained-graphics profile. Suggested reviewers: Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue remains; the unchanged-graphics path preserves the revision needed for the next real update. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The reviewed path preserves per-client pane filtering and commits delivery state only after a successful send. No new exposure was identified, although broader security coverage is incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
ec3d5c8 to
90261e0
Compare
JJLiebig
left a comment
There was a problem hiding this comment.
Rebased onto current master (21d71a03); final head is clean (Linux/macOS/Windows CI green). One conflict in render_scale_profile_retained_graphics was resolved by keeping master's newer offscreen scenario (#4686) and folding this PR's unchanged-image scenario into the same image list, so both remain covered.
The retained path now computes the graphics delta and applies pane metadata before cloning the frame, and only clones when an update will actually be sent; upload reuse and commit-after-success are preserved (covered by the new test, which also verifies the next real update still reuses uploaded pixels).
Windows benchmark (x86_64-pc-windows-msvc, rustc 1.96.1, release, median of ~100 samples, just bench-retained-graphics), retained path, unchanged image before -> after:
| image scenario / panes | before | after | cut |
|---|---|---|---|
| unchanged-image / 1 | 56.2 us | 2.3 us | 95.9% |
| unchanged-image / 15 | 78.2 us | 15.1 us | 80.7% |
Other retained scenarios (text, visible image, offscreen image) are unchanged within noise.
Approving.
90261e0 to
105415f
Compare
105415f to
627f3f7
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
JJLiebig
left a comment
There was a problem hiding this comment.
Rebased onto master after #4669 and #4670 landed (6502492f); the shared justfile hunks were reconciled so all three bench recipes remain. The earlier conflict resolution in render_scale_profile_retained_graphics is intact: master's offscreen scenario and this PR's unchanged-image scenario are both covered.
Final head 627f3f7f is green on Linux/macOS/Windows + Windows ConPTY, with Greptile and a full CodeRabbit review on this head. Approving.
Merges 46 upstream commits spanning stable releases v0.9.2 and v0.9.3: multiple prefix keys (herdrdev#4653), self-reported agent resume commands (herdrdev#4687), Go To workspace-grouped navigator rows (herdrdev#4384), clear_pane keybinding (herdrdev#4383), non-interactive machine status/reconnect with SSH MFA (herdrdev#3763), interactive machine add session picker (herdrdev#4204, herdrdev#4678), mouse events on terminal session control (herdrdev#4685), staggered agent restarts (herdrdev#4102), SSH compression (herdrdev#4340), row-shift scrolling (herdrdev#4711), TERM_PROGRAM identity (herdrdev#4104), PowerShell 7 default on Windows (herdrdev#4297), tab-close confirmation (herdrdev#4379, herdrdev#4409), full event subscription bursts (herdrdev#4178, herdrdev#4225), SIGWINCH color refresh (herdrdev#4349), saved-layout shutdown survival (herdrdev#4320), stray-Escape click fix (herdrdev#3480), first-task-done detection (herdrdev#3338, herdrdev#3990, herdrdev#3916), CPU/perf work across navigator/splits/named-targets/event-batching (herdrdev#4506, herdrdev#4546, herdrdev#4426, herdrdev#4669, herdrdev#4670, herdrdev#4671, herdrdev#4672), synchronized-frame tearing and cursor flicker fixes (herdrdev#2968, herdrdev#4303), API socket transient-error resilience (herdrdev#4601), async worktree git lookups (herdrdev#4492), worktree-open workspace-takeover fix (herdrdev#4293), SSH agent forwarding after reconnect (herdrdev#1931, herdrdev#4252), OpenCode V1 subagent status (herdrdev#1362, herdrdev#4240), Codex idle/mention/interrupt-key detection (herdrdev#4507, herdrdev#4196), Kiro/Grok detection fixes (herdrdev#4203, herdrdev#4372, herdrdev#4333), Droid scrollback clears (herdrdev#4432), copy-mode-stays-active fix (herdrdev#3812, herdrdev#4281), Ctrl+Shift+letter fix (herdrdev#4581, herdrdev#4597), split mouse-report fix (herdrdev#4630), several Windows paste/mouse-capture/clipboard/detection fixes (herdrdev#4251, herdrdev#4284, herdrdev#4470, herdrdev#4314, herdrdev#4313, herdrdev#4579, herdrdev#4309), navigator search/highlight fixes (herdrdev#4300, herdrdev#4408, herdrdev#4273, herdrdev#4535, herdrdev#4355), session-attach-without-terminal error (herdrdev#4393), socket error request-ID preservation (herdrdev#4344), plugin install option ordering (herdrdev#4446), Windows host color detection (herdrdev#1530, herdrdev#4369), post-update saved-machine summary (herdrdev#4722), a hotfix for Escape-prefixed terminal key bindings (herdrdev#4759) and pinned Windows ConPTY bundling (herdrdev#4760), Windows same-user cross-elevation attach (herdrdev#4777), and the libghostty-vt binding extraction into a ghostty-vt workspace crate (herdrdev#4661). Also fixes two merge seam breaks: overlays.rs combines the fork's rounded_borders threading with upstream's per-client prefix-label onboarding overlay, and the fork's command_palette test file is updated for the new Vec<KeyCombo> prefix representation and the BindingConfig::one constructor introduced by the multi-prefix-key feature. refs upstream herdrdev/herdr@331775c3
Retained surfaces containing images are deep-cloned even when nothing changed and no update will be sent. Check updated pane geometry and graphics before cloning the frame; preserve upload reuse and commit-after-success behavior.
Release builds on Apple M3 / 24 GiB, macOS 27.0, Rust 1.96.1; medians of three serial runs with alternating baseline/candidate order, compared with upstream
fff6c820. Time reduction =(before − after) / before × 100%. Negative values indicate increased time. Geometry is fixed at 80×24; the static-image cases change surrounding text, not image pixels.Reproduce:
just bench-retained-graphics. Tests cover clean/hidden-pane wakes and reuse of uploaded pixels on the next real update. Nativejust ci,just docs-contract-test, and GitHub Linux/macOS/Windows CI passed.The broader
just bench-render-scalehits the same existing CoW-source prerequisite failure on this Mac for baseline and candidate; the supported retained-graphics profile above passes.