Skip to content

improve: speed up desktop editing and export with window and menu fixes - #2215

Merged
richiemcilroy merged 20 commits into
mainfrom
desktop-optimisations-etc
Sep 3, 2026
Merged

improve: speed up desktop editing and export with window and menu fixes#2215
richiemcilroy merged 20 commits into
mainfrom
desktop-optimisations-etc

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Sep 3, 2026

Copy link
Copy Markdown
Member

MP4 exports decode entire audio sources before the first frame, while editor previews repeat cursor, caption and waveform preparation. This adds bounded streaming audio for supported MP4 timelines, overlaps source preparation with renderer setup, indexes cursor lookups, prepares export zoom incrementally and avoids redundant sample copies and screenshot compositing. Unsupported timelines and destinations retain the existing export path. Cancellation and failures join workers, remove private temporary output and preserve retries; completed files retain the existing permission behavior.

The desktop changes also anchor menus to their buttons, improve selected states and drag cursors, dismiss indexed menus after clip deletion/history changes, and retain Windows caption controls during loading, errors and overlays. Window capture filters out invalid Windows targets, and committed app handoffs finish if the settings window closes. Editor controls and saves stay disabled until the loaded configuration and engine are published together. Cursor sampling preserves texture derivatives at sprite edges. Camera antialiasing derivatives are evaluated before pixel-dependent early returns, fixing distant camera-edge pixels exposed by the Windows cursor/ripple regression test.

Validation at 0886c8c3:

  • A/V Sync Tests passed on macOS, Windows and Linux. Linux checked all 41 matrix cases; macOS and Windows each fully checked 40 cases and passed the audio portion of one case whose video timing was skipped after a hosted-machine stall. No matrix retries or failed cases. Existing timing thresholds and skip policy are unchanged.
  • All three platforms passed 72 cursor-edge cases, 26 layout/ripple cases with zero changed RGB values outside the overlay alpha support, the isolated zoom timing gate, and the added streaming-audio/export regressions. Windows WASAPI loopback, 45 macOS AVFoundation tests and Linux 30-second editor playback sync also passed.
  • Original desktop CI passed Linux desktop build/tests (894 GPUI tests, one existing ignored benchmark), both dedicated Clippy jobs, formatting, lint, typechecking and mobile checks. The remaining macOS/Windows jobs were canceled by branch concurrency when the CI-only follow-up fix: install clippy for main branch cache checks #2217 started. Replacement desktop CI and corrected main CI are still running. The original PR CI checkout and actual desktop merge have identical complete source trees. The merged follow-up fix: install clippy for main branch cache checks #2217 adds only the missing Clippy component to the main-only cache job; its reviewed head and merge also have identical complete source trees, with all desktop/media code unchanged. Both PRs received Greptile 5/5.
  • CodeQL passed all six language analyses. Greptile reviewed this exact commit at 5/5; the implemented security review thread is resolved.

Performance evidence has narrower coverage than release acceptance. Earlier native Mac testing of the export implementation covered 99 cases, decoded video/audio equivalence, timestamps, cancellation, dropped futures and retries. One eight-second excerpt improved builder-to-first-frame time from 5.20s to 0.49s and peak export-process memory from 1.09GB to 274MB; total export changed from 5.96s to 5.34s. Those fixture-specific measurements predate the final UI, permission and camera fixes.

The hosted performance run used production-identical source (the successor commit changes only a test parser): all three Mac tests executed, while Windows skipped all three on its software adapter. Between two different Mac runner OS images, playback improved from 52.64 to 68.34fps but export fell from 50.57 to 41.65fps; these single runs do not establish the cause. A separate same-Mac compositor comparison measured approximately 0.039ms extra per default 4K camera draw and 0.068ms with borders for the antialiasing correction. This does not establish its effect on total export throughput.

Human-test packages from the merged desktop source are available for Apple Silicon macOS and Linux. The Mac app passed signing, notarization and stapling; Linux passed package-content and updater-signature checks. Intel macOS and Windows packages are still building. These Actions artifacts expire September 6; the release remains a draft.

Human acceptance before release should cover the prepared export path on physical Windows/Linux hardware, clipboard output, loading/edit/save behavior, cancellation/retry, long-session memory, and playback/export throughput on consistent hardware. The full 20-hour editor memory target and direct native clipboard prototype are outside this change. The historical settings-reset writer was not conclusively identified; the reproduced loading/save risk is guarded here.

Greptile Summary

The PR accelerates desktop editing and MP4 export while tightening editor loading, menu, window-control, and cancellation behavior.

  • Adds bounded streaming audio and prepared MP4 export with coordinated worker cleanup and fallback behavior.
  • Reduces repeated cursor, waveform, caption, zoom, sample-copy, and compositing work.
  • Publishes loaded editor configuration and engine state together before enabling edits and saves.
  • Anchors menus to controls and improves desktop window, selection, drag, and caption-control behavior.
  • Expands cross-platform export, audio, rendering, and UI regression coverage.

Confidence Score: 5/5

The PR appears safe to merge based on the reviewed changes and available prior-thread context.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/export/src/mp4.rs Coordinates prepared MP4 rendering, streaming audio validation, cancellation, temporary-output ownership, and worker joins without an accepted blocking finding.
crates/audio/src/streaming.rs Introduces bounded incremental audio decoding with cancellation and damaged-source handling.
crates/editor/src/export_audio.rs Prepares and renders export audio sources incrementally while preserving ordered source handling and failure propagation.
apps/desktop-gpui/src/app_windows.rs Publishes the loaded summary, configuration, and editor instance together and discards saves queued before readiness.
apps/desktop-gpui/src/editor_window.rs Gates editing and saving on project readiness and updates menu, shortcut, tooltip, and drag-cursor behavior.
apps/desktop-gpui/src/ui/menu.rs Updates menu positioning so popups anchor to their triggering controls.
crates/rendering/src/cursor_interpolation.rs Indexes cursor sampling and adjusts edge behavior without an accepted blocking finding.
crates/rendering/src/shaders/cursor.wgsl Preserves cursor texture derivatives at sprite boundaries.
.github/workflows/sync-tests.yml Expands synchronized platform testing to audio and export crates and isolates the long-running zoom timing test.

Reviews (6): Last reviewed commit: "test: accept Windows shader line endings" | Re-trigger Greptile

@superagent-security superagent-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superagent found 1 security concern(s).

Comment thread crates/export/src/mp4.rs
@richiemcilroy richiemcilroy changed the title improve: reduce editor and MP4 export startup work improve: speed up desktop editing and export with window and menu fixes Sep 3, 2026
@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

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy merged commit 312d8f5 into main Sep 3, 2026
28 of 30 checks passed
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