Skip to content

fix: harden desktop recording and rendering for v0.6 - #2172

Open
richiemcilroy wants to merge 24 commits into
mainfrom
codex/desktop-hardware-performance
Open

fix: harden desktop recording and rendering for v0.6#2172
richiemcilroy wants to merge 24 commits into
mainfrom
codex/desktop-hardware-performance

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Aug 30, 2026

Copy link
Copy Markdown
Member

Hold — rebuilt native timing comparisons and current-head CI are pending. Do not merge or publish.

Recording Stop inherited expensive recovery work even after clean capture: an earlier two-minute Studio case took 1.88 seconds to finalize versus 310 ms in 0.5.9, and Windows Instant took 5.36 seconds versus 427 ms after capture ended. This change uses faster in-memory byte snapshots, defers disposable staging flushes, and fuses bounded validation with remux for verified clean video. It retains packet corruption/read-error checks, seek validation, full audio/recovery validation, source snapshots, backups and final output syncing. A path-bound, single-use Instant completion token is issued only after successful encoder finalization. Temporary cleanup failure cannot turn a successfully saved recording into a failed Stop.

The PR also fixes release compilation guards and Windows DASH manifest ownership, regenerates the bindings needed to show Tauri's main window, restores GPUI editor activation and recording error display, preserves the editor destination on restart, and keeps valid 0.5.9 projects with omitted failed optional tracks usable. Mac Studio retains system-audio-before-screen shutdown acknowledgement for their shared capturer while microphone/camera stop concurrently. Other platforms keep parallel stopping.

Validation for 526dc80bf5429f7729b66d0291802b65cfeb48c7:

  • Rust formatting and scoped CLI/recording/FFmpeg checks passed. Remux: 19 passed. Recovery unit: 49 passed. Recovery integration: 50 passed, 1 pre-existing ignored. Four Mac shutdown-order/error tests passed. Strict Clippy passed for touched targets; broader local Rust 1.97 checks encounter unchanged dependency/example lints, so workflow Rust 1.88 CI remains a required gate.
  • New media tests preserve every encoded packet/timestamp and fully decode 320 frames, reject corrupt payload/packets and late read failures, and verify respawn groups plus original backups. Cleanup fault tests run actual finalization in Full and Bounded modes and retain validation/publication errors.
  • Native comparison at the previous c871d2fff head improved the large delays but still failed latency parity: Linux 120 s Studio stopped in 695.489 ms versus 338.422 ms; Windows 12 s Instant remained 149.449 ms and 226.789 ms slower in opposite run orders. Functional decode/export checks passed. Those artifacts do not contain the latest fused-validation or stop-ordering fixes.
  • The previous signed Mac package and 0.5.9 each produced 449 fully decoded frames with no gaps over 50 ms, but the pair failed its background-load matching guard. This is functional evidence, not controlled performance parity. No unrelated Mac workload was interrupted.
  • Earlier native Tauri/GPUI start/pause/stop/editor/playback/export and old-project compatibility checks passed within their recorded scope. The 32-case Mac input matrix used an earlier debug engine, not this optimized release. Fresh final-head build/native checks are running. Both fresh Greptile reviews completed at 5/5 with no findings on this exact head, including the full-PR CLI review. The review is not native performance proof.

The previous head had green main CI, A/V and CodeQL and a 5/5 Greptile PR review. A separate full-PR CLI review returned 4/5 with a generated-binding process allegation disproved by the saved canonical Rust exporter execution and matching generated blob. Those earlier review/CI results are historical. The new full-PR CLI review also verified the generated bindings and reported no remaining concern. The CLI's 727-file baseline-diff limit is honored; the complete 155-file PR is the review scope, with separate 0.5.9 source and native comparisons.

No signing approval, merge or release publication has occurred. Quiet-host Mac timing, physical-device disconnects, extended duration, Wayland/hardware variants and live upload completion remain unproven. Windows baseline playback and same-media A/V export measurements have documented failures and are not counted as passing results. Existing Mac native-stop error suppression and Tauri's upload-completion race predate the PR and are not claimed fixed. This evidence cannot guarantee zero regressions.

Greptile Summary

This PR hardens cross-platform recording completion, recovery, timing, and rendering while restoring several desktop and GPUI integration behaviors.

  • Adds path-bound completion state and optimized validation/remux handling for clean Instant recordings.
  • Strengthens recovery, fragment integrity checks, backup preservation, and cleanup error handling.
  • Updates capture timing, shutdown ordering, desktop event handling, generated Tauri bindings, and editor/rendering behavior.
  • Adds platform-specific recording checks and expanded recovery, synchronization, and compatibility tests.

Confidence Score: 5/5

The PR appears safe to merge from the eligible follow-up-review findings, with no blocking failure remaining.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/recording/src/recovery.rs Reworks recording snapshots, staged validation/remux, backup and publication ordering, and non-fatal temporary cleanup.
crates/recording/src/instant_recording/completion.rs Introduces project-bound completion state consumed by the optimized Instant finalization path.
crates/recording/src/instant_recording.rs Issues clean completion state only after successful encoder shutdown and valid segmented output.
apps/desktop/src-tauri/src/recording.rs Integrates hardened stop and completion behavior with the Tauri desktop recording lifecycle.
apps/desktop-gpui/src/recording.rs Updates GPUI recording finalization, error display, storage handling, and editor handoff.
crates/enc-ffmpeg/src/remux.rs Adds fused packet validation and remux behavior while preserving encoded packet timing.
crates/recording/src/studio_recording.rs Adjusts multi-track shutdown ordering and recording metadata compatibility.
crates/rendering/src/lib.rs Updates rendering behavior and supporting synchronization logic for editor and export paths.
apps/desktop/src/utils/tauri.ts Regenerates the desktop command and event bindings required by the changed native interface.

Reviews (6): Last reviewed commit: "fix: preserve saved recordings when temp..." | Re-trigger Greptile

@superagent-security

Copy link
Copy Markdown

Manage your Superagent protection

Superagent has paused scans for this repository because this unlinked GitHub App installation has used all three included PR scans.

You have 0 of 3 included PR scans remaining.

Create a free account to continue protection, manage scan settings, review security history, and control which repositories are protected.

@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai please review the PR

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@socket-security

socket-security Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​blake3@​1.8.781100100100100

View full report

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant