Skip to content

fix(native-preview): 4-part remediation from macOS beta telemetry (sessions 598/616) - #352

Merged
theunavailableguy merged 1 commit into
masterfrom
fix/native-preview-telemetry-remediation
Sep 21, 2026
Merged

theunavailableguy merged 1 commit into
masterfrom
fix/native-preview-telemetry-remediation

Conversation

@AIEraDev

Copy link
Copy Markdown
Owner

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.

…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
theunavailableguy merged commit 8127f56 into master Sep 21, 2026
2 checks passed
@theunavailableguy
theunavailableguy deleted the fix/native-preview-telemetry-remediation branch September 21, 2026 13:59
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.

2 participants