Skip to content

Add desktop Rewind encoder diagnostics and bounds - #8150

Merged
Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:fix/desktop-rewind-ffmpeg-bounds
Jun 24, 2026
Merged

Git-on-my-level merged 2 commits into
BasedHardware:mainfrom
Git-on-my-level:fix/desktop-rewind-ffmpeg-bounds

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add Rewind/FFmpeg encoder lifecycle counters to ResourceMonitor diagnostics: buffer limit/depth, restart count, emergency reset count, not-ready count, current chunk age, and process state
  • Add Rewind capture state and memory-pressure context to diagnostics so hang/memory Sentry events have the right operational context
  • Bound repeated FFmpeg not ready loops by resetting the encoder after 3 consecutive not-ready states, with explicit reset reasons for buffer overflow, start failure, write failure, and not-ready loops
  • Add source-level regression tests to guard the diagnostic fields and bounded-reset symbols

Closes #8127

Validation

  • git diff --check
  • xcrun swiftc -parse desktop/macos/Desktop/Sources/Rewind/Core/VideoChunkEncoder.swift desktop/macos/Desktop/Sources/ResourceMonitor.swift desktop/macos/Desktop/Tests/RewindEncoderDiagnosticsSourceTests.swift
  • xcrun swift package --package-path Desktop describe
  • Source-level diagnostics assertion script for the new test invariants

Note: I did not rerun full SwiftPM tests locally because prior targeted runs in this repo spent the tool budget downloading SwiftPM binary artifacts and hung in GitHub keychain lookup; parse/package validation completed successfully.

Review in cubic

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

@Git-on-my-level
Git-on-my-level merged commit c213651 into BasedHardware:main Jun 24, 2026
2 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.

Desktop: investigate app hangs, critical memory, and Rewind/FFmpeg encoder failures

1 participant