fix(native-preview): 4-part remediation from macOS beta telemetry (sessions 598/616) - #352
Merged
theunavailableguy merged 1 commit intoSep 21, 2026
Conversation
…ssions 598/616)
Fix 1 — Canonical POSIX path resolution (defense-in-depth):
- nativeVideoPreview.ts: wrap videoPath with toNativePath() for visual and
background layers, preventing raw WebKit asset:// URLs from reaching FFmpeg
(root cause of direct native export failure on frame 0 in session 598)
- native_preview.rs: add normalize_file_path() in to_video_project_request
and render_native_preview_frame as a Rust-side fallback
Fix 2 — Synchronous fast-path for playback text + 1-frame clock tolerance:
------------------------------------------------------------------------------------------------------------------------------------------------------------------d re-renders-------------------------------------------ti------------------------------------------- ms visible-raster-bridge overhead on
scenes with many text scenes with many text scenes with many text sceneset scenes with many text scenes with mntFrame scenes with many text scenes with many text scenes with many text sceneset scenes with many trict equality failing when
the audio clock ticked forward duri the audio clock ticked forward duri the audio clock ticked forwardhold:
the audio clock ticked forward duri the audio clock ticked forward duri
reshold resholei 8 loo reshold �� Surface visibility caching, eliminate WindowServer contention:
- native_surface.rs: add atomic is_shown to NativeSurfaceRuntime; call
show_surface() only once on initial reveal and skip on subsequent ticks,
preventing macOS WindowServer display-sync locks at 60 Hz (root cause of
surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir surfaceAcquir sur8/8
theunavailableguy
approved these changes
Sep 21, 2026
theunavailableguy
deleted the
fix/native-preview-telemetry-remediation
branch
September 21, 2026 13:59
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.
Fixes root causes identified from macOS beta telemetry uploads. tsc clean; Vitest 81/81; cargo check clean; native_preview::tests 18/18; native_surface::tests 8/8.
Fix 1 — asset:// URL reaching FFmpeg (session 598, frame 0 export failure)
Wrap videoPath with toNativePath() in nativeVideoPreview.ts. Add normalize_file_path() in native_preview.rs as Rust-side fallback.
Fix 2 — 25-40 ms raster-bridge stall + cascading drop spiral (session 616, 61.7% drops)
Synchronous zero-await fast-path for visible-playback in nativeRasterBridge.ts — returns cached snapshots instantly, schedules background re-renders without 40 async closures. Relax playbackTargetStillCurrent to Math.abs(currentFrame - frameIndex) <= 1 in NativeProgramPreview.tsx.
Fix 3 — 1,598 lookahead misses, queueResidencyUs p95 = 96.0 ms (session 598)
Decouple MAX_LOOKAHEAD_RESIDENCY_US = 100_000 from MAX_LOOKAHEAD_EXPIRATION_US = 250_000 in native_preview.rs so frames decoded within the 100 ms horizon are not purged before presentation.
Fix 4 — surfaceAcquireUs spiking to 423.5 ms (session 616)
Add atomic is_shown to NativeSurfaceRuntime in native_surface.rs. show_surface() called once on initial reveal only, eliminating macOS WindowServer contention at 60 Hz.