Repository navigation
fix(live): preserve replay evidence across native and software recovery - #747
Conversation
f739371 to
8db5e83
Compare
8db5e83 to
b69b1a5
Compare
Retain source identity, cached media and transport intent through replay recovery. Verify paired-track overlap before admission, including damaged outgoing PES boundaries and clean pictures queued before timestamp rollback. Keep intact replacements once in video decode order and preserve unverified fresh media under bounded cadence-aware lookahead. Apply the same admission before software clock folding, recording and DVR append. Expose explicit retry ownership to hosts and opt-in SDR native output diagnostics that remain scoped to the session across item swaps. Packet identity, retained recovery and diagnostic cadence share these primitives, so this is one independently buildable correction rather than partially released dependent fixes. Document the public contracts and include encoded MPEG-TS, cancellation, recovery and observation regressions. Validation: complete macOS build and tests, 778 XCTest cases (one optional skip), 4,361 Swift Testing cases, 99 strict-pool regressions, and iOS/tvOS library builds passed. Integrated physical-device sessions are documented in the PR; the final lookahead adjustment has reproducible regression coverage.
596e931 to
1b0cb2d
Compare
Reconcile verified returning access units before timestamp repair and quarantine untimed fragments with the damaged boundary. Preserve ambiguous source data. Add opt-in bounded native video-progress recovery, privacy-safe seam diagnostics and native-decoder regression coverage. Document four-device evidence and the failing-before/passing-after reproductions.
…SourceReset (#747) The verified-replay exhaustion from #747 published only the new liveSourceReplayExhausted subject. A host that never subscribed to it (every existing integrator, Sodalite on a Jellyfin transcode respawn among them) held the last frame for good, where it used to retune on liveSourceReset. The new subject now fires only under LoadOptions.hostRetriesExhaustedLiveReplay; by default the session reports the exhaustion through onLiveSourceReset. The layer-unready presentation repair was wired for every native session, VOD included, and an in-place swap that joins audio-first while video waits for its IDR could earn it a nudge and an item replacement. It now runs only under nativeVideoFrameRecovery, like the decoded-output half. CHANGELOG: the PR's entries collapsed into one under Unreleased; three of them had landed under 7.35.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
397dcf7
into
superuser404notfound:main
|
Merged in 397dcf7, thanks a lot @yucelokan. The replay identity work, the truncated-PES regressions and the validation report are excellent, and the long-GOP fixtures that compare every decoded picture are a real gain for the test suite. Two defaults changed in the follow-up 7a6fc2f, both so that a host that does nothing new behaves as before:
The CHANGELOG entries are collapsed into one under Unreleased (three had landed under 7.35.0 after the release cut). Full suite green on both runners (XCTest 764, Swift Testing 4412). Not released yet. |
…aylist when a GOP outgrows the seal Conflicts with #747 resolved by keeping both: the reopen/exhaustion handlers and the renewal handler are registered side by side, and reloadStalledConsumerItem takes both preserveLivePosition (#747 presentation repair) and replacementURL (renewal); preserveLivePosition still wins the rejoin. The CHANGELOG line moved from 7.35.0 to Unreleased. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
|
Thank you for building and maintaining AetherEngine, and for taking the time to review and merge our contributions! I’m happy to be using it in WUW TV and glad I could give something back to the project. Really appreciate your work and everything you’re sharing with the community! 🙌 @superuser404notfound |
|
A data point from an Apple TV for the truncated-boundary work in this PR, which reached us in 7.36.0: it removed the repeated seconds we could stage on a reconnect, and on one cut of three the returning picture did not supersede the outgoing copy. Setup. Apple TV 4K (3rd generation,
On all three 7.36.0 cuts FFmpeg's No reopen, host reset, stall or leaked server stream on either engine. We have no recording of the tile, so we cannot say what the bump did to the picture. 7.35.1 is our app's engine pin as of today (2026-10-16); 7.36.0 is the candidate, measured beside it. |
|
Thank you, @cmcpherson274, this is a precise report, and the three lines in which cut 2 differs were exactly what located it. What happened on cut 2. The returning connection's audio rolled back first and opened the replay check ( The one-frame offset you saw on all three cuts is FFmpeg's: Fix. 5aca553 on main: while the check is open and no returning video has matched yet, a video packet past the retained frontier is treated as an outgoing straggler. It raises the frontier and joins the pending set, bounded like a held boundary (0.5 s or two frame intervals, at most 64 packets). The returning copies of both pictures then land in the verified batch, and the returning picture replaces the truncated one. A new test replays your cut 2 order and fails on the previous code at the same point ( On a retest, a cut of the cut 2 shape should log |
|
Our retest of cut 2 on the device, against your criterion above: a cut of the cut 2 shape should log Setup. As in our comment above, but now on tvOS 27.0 (24J361); those runs were on tvOS 26.6. Apple TV 4K (3rd generation,
Cut 2 shape: 1 cut of 6 on 7.36.0, 3 of 6 on 7.44.0. No The 7.36.0 cut of that shape (cut 3) logged the same sequence with 7.44.0 is our app's engine pin as of today (2026-10-21). |
|
Thank you, @cmcpherson274, for running the retest against the exact criterion and for keeping the 7.36.0 arm beside it. The three 7.44.0 seams of the cut 2 shape all committing with Your reading of the 7.36.0 arm is right, and worth keeping: whether the old code missed depended on whether the truncated successor was read before the returning copy of the flagged picture, so a single cut 2 shape that happened to commit cleanly says nothing either way. The test added with the fix pins the order that missed. On the two cuts with no overlap check (7.36.0 cut 1, 7.44.0 cut 2): I'm treating the cut 2 case as confirmed on device. Thanks again for the careful runs. |
Summary
Keep live source replay from showing already-admitted pictures or damaging the reference chain at a truncated transport boundary. Preserve source, viewing position and DVR identity through recovery, and repair sustained native video stalls independently of advancing audio.
What changed
liveSourceReplayExhausted/retryLiveSourceRecovery()so applications own retry timing.nativeVideoFrameRecovery(default off); diagnostics alone remain observational. Require fresh evidence and healthy pictures to rearm; exclude short gaps, seeks, pause, hidden layers and starvation.Test plan
23f548c0, FFmpegBuild 3.7.1.48c6aafd(current head adds validation documentation only):swift buildand completeswift testpassed: 781 XCTest cases (one optional skip), 4,376 Swift Testing tests in 603 suites, zero failures. The complete local strict-pool run also passed all 4,376 Swift Testing tests.-8969. A separate untimed-fragment reproduction produced missing references and FFmpeg decode-error flags. Both are fixed on native and software admission paths; an unverified boundary still preserves every packet.1.1.15, app build13, using the AetherEngine7.35.1-based fork at commita7933553, on a Mac running the iPad-compatible app (macOS 27.0.1), iPhone/iOS 26.6.1, iPad/iPadOS 26.6.1 and Apple TV/tvOS 27.0. The 26 archived parts contained 8,465 records; 219 older-build records were excluded. Live H.264 High 720p/1080p25 MPEG-TS + AAC-LC and MKV H.264 Main 1920×800/23.976 + AAC-LC 5.1 were exercised, including seeking, resume and five PiP return paths. There were 27 verified replay removals with no unsolicited sampled backward clock movement. Remaining video-output gaps exposed the two admission cases and the ready-layer recovery blind spot fixed here.a7933553. The final corrections at functional revision48c6aafdwere developed from those logs and subsequently validated by the local decoder/playback regressions and CI described above; that final revision has not yet been tested on all four physical devices. The application version/build identifies the field-test session, not the engine release or the final PR revision. A decoded-output gap is not itself proof of an identical screen freeze. Private raw packets were unavailable, so the deterministic reproductions do not establish the cause of every field gap.Detailed, sanitized device matrix, timeline correlation, reproduction and limits: validation report. No private media, provider addresses, credentials or support identifiers are published.
CI follow-up
The first CI attempt passed the normal macOS suite, all new native-decoder cases in both modes, iOS/release CLI, tvOS/visionOS and docs. Its strict-pool suite had one failure in the unchanged
SourcePrewarmAdoptionTests.fullyWarmedSourceOpensWithNoConnection(two HTTP requests instead of one). A complete local strict-pool rerun passed. No unrelated prewarm code or assertion was changed or disabled; the documentation-only follow-up records this. The fresh run passed all four checks atefd30fce, including the full normal and strict-pool macOS suites: CI run. The original intermittent result remains documented.Checklist
CHANGELOG.mdupdated