Skip to content

fix(subtitles): keep Vision OCR off the cooperative executor - #568

Merged
superuser404notfound merged 6 commits into
superuser404notfound:mainfrom
brandomoore:brandomoore-ci-test-hang
Sep 20, 2026
Merged

superuser404notfound merged 6 commits into
superuser404notfound:mainfrom
brandomoore:brandomoore-ci-test-hang

Conversation

@brandomoore

Copy link
Copy Markdown
Contributor

Summary

Fix the pre-existing macOS full-suite hang. Samples from unchanged 0027df2d showed all three cooperative workers blocked inside synchronous Vision OCR, with no Swift Testing completions.

What changed

  • Await OCR on a dedicated utility thread with one process-wide admission slot. Queued cancellation removes work; cancelling active work does not admit a replacement before Vision returns.
  • Preserve completed cues in their original store and replay interrupted embedded batches on re-selection. Add executor, concurrency, cancellation and cue-retention regressions.
  • Update the changelog and architecture notes. No public API changes or net CI workflow changes.

Test plan

  • Xcode 26.3 / macOS 15.7.9: full-suite steps passed twice, 641 XCTests (1 existing skip) + 3,109 Swift Testing tests. Full-suite evidence.
  • Separate strict-worker validation: 15 OCR tests passed, plus packet-cache regressions, H.264 runtime regression and TransportProbe build.
  • Xcode 27 / macOS 27: the same full-suite totals and 15 strict-worker OCR tests passed. Documentation links pass; independent review findings addressed.
  • Media: synthetic subtitle text. No physical-device playback; optional local .sup fixture absent. Earlier diagnostic-launch failures are retained; temporary instrumentation is removed.

Checklist

  • CHANGELOG.md updated
  • Conventional Commits
  • Engine fix, not a host workaround
  • Public API unchanged

@superuser404notfound
superuser404notfound merged commit 256f2d4 into superuser404notfound:main Sep 20, 2026
7 checks passed
@superuser404notfound

Copy link
Copy Markdown
Owner

Merged, thank you. This one is worth more than the CI stall it was chasing: the same synchronous Vision call sits in the shipping OCR worker and the sidecar fill, so on a device with few cores a bitmap subtitle track could park the cooperative pool for the duration of a batch. A dedicated thread behind one admission slot is exactly the shape the rest of the engine uses for blocking work, and the diagnosis (samples showing all three workers inside Vision) is what made it reviewable.

Two things I want to call out for the release notes, because they are easy to miss in the diff. The cursor rollback fixes a defect that predates this PR: a batch cut short already advanced the cursor past cues it never recognised, so the native rendition quietly lost those lines on a track switch. And keeping completed cues in the originally captured store is the right call, the store dedups on (start, end, text), so re-collecting the abandoned window costs a decode and never a duplicate line.

Verified locally on macOS before merge: 625 XCTests (1 skipped) and 3155 Swift Testing tests green on the merge commit, the executor suite green three runs in a row, and the Vision suite green with the documented ANE precompile cost on the first call. No follow-up needed from your side.

superuser404notfound pushed a commit that referenced this pull request Sep 20, 2026
…573)

External contribution by @tschuegy. `SoftwarePlaybackHost.seek(to:)` handed
the session-axis target straight to the demuxer, the packet store, the
decoder's skip threshold and the synchronizer clock, all of which speak the
source's own timestamps. On a mid-stream-joined source (#107) the demuxer
clamped to the start of the file and the store's reservoir read as the whole
offset, so the producer stopped reading and the picture stood with nothing
reported.

Verified on merge: `Demuxer.seekBounded(to:)` takes an absolute source
timestamp (it passes `seconds * AV_TIME_BASE` into `avformat_seek_file`, and
the time-seekable path subtracts `sourcePTSOriginSeconds` itself), so the
carry does not double-apply; `SoftwarePacketReadAhead` is fed the raw clock
via `updatePlayhead`, so its keyframes and frontier really are source-axis;
and `clockSessionZero` is `firstSample - initialSeconds`, which keeps the
mapping correct after a resume as well.

Resolved the CHANGELOG conflict against #566/#568 and dropped three em-dashes
for the house style. CI green on 51b4b78, local `swift build --build-tests`
green.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
brandomoore added a commit to brandomoore/Plozz that referenced this pull request Sep 20, 2026
Pin the upstream release containing the merged background diagnostic-read
and bounded subtitle OCR fixes from superuser404notfound/AetherEngine#566
and superuser404notfound/AetherEngine#568.

Resolve the engine's FFmpegBuild 3.4.0 dependency without changing unrelated
pins. Update the playback documentation and exact-release source credit,
and assert the compiled engine version in the integration suite.

Keep existing playback routing and optional feature settings unchanged.
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