Repository navigation
Conversation
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.
Problem
Software VOD can retain substantial compressed-packet history and satisfy backward/forward seeks from its disk FIFO, but
AetherEngine.residentRangesis only populated by the native segment-cache observer. A host that draws its cache band from this public property therefore sees no software cache coverage.Using
[currentTime, bufferedPosition]as a host fallback is insufficient:bufferedPositionis a continuous forward frontier, not evidence of a resident start. Moving the playhead moves the inferred start, and a backward scrub can leave that inferred range even though the packets are still retained. In a target-filtering timeline, that produces a disappearing/reappearing cache band.This PR publishes software VOD residency through the existing
residentRangescontract, on the same display timeline ascurrentTimeandseek(to:).Implementation
Derive ranges from packet evidence
SoftwarePacketCoveragewith exact integer-to-seconds checks. Invalid/inexact timestamps do not manufacture coverage.SoftwareVideoPacketCoverage's verified successor-PTS intervals for H.264/HEVC. Preserve reordering, discontinuities, invalidation and the unknown end of the final picture.Respect actual disk retention
Publish without tying residency to the playhead
The public property's type is unchanged. Native segment-cache and live-window behavior stay separate. This patch does not change decode routing, source reads, download policy, disk budgets, seek admission, or dependency versions.
Synthetic example
For a video-only store holding
[0, 4]seconds, moving the clock or committing cached seeks to 3, 1, 2.5 and 0.5 seconds continues to publish[0, 4]. A cold seek outside the store clears it. With video coverage[0, 4]and selected audio islands[0.5, 1]and[2, 3], the published spans are exactly those two intersections.These are synthetic packet-test values, not excerpts from a playback session.
Regression coverage
SoftwareResidentRangesTests.swiftcovers:Tests use generated packet envelopes, temporary FIFOs and controlled asynchronous publication. They require no media files, network server, account or playback logs. Waiting follows the shared
waitForhelper, and the blocking FIFO consumer runs on a dedicated thread with cancellation closing the source.Validation
CI follow-up (2026-10-13): The first full macOS CI run executed 4,355 tests and reported one issue: the source-wide rule requiring
BlockingWork.detachedfound the newly added bare detached task in the residency publisher. Commit761b031bswitches that call to the upstream blocking executor. The equivalent source scan now passes; the updated commit has been pushed for a fresh full CI run, including the one-thread cooperative-pool lane. The focused local results below describe the preceding revision; they are not a claim that this fresh CI run has completed.On the PR branch based on upstream
mainat833a9f1:python3 Scripts/check-doc-links.py: all relative links and anchors in the six published documents resolve.git diff --check: passed.Package.swiftandPackage.resolvedare unchanged.The focused selection can be reproduced with:
Local execution used the native SwiftPM build system and explicitly signed the host test bundle with a valid Apple Development identity. No full-suite result is claimed.
The corresponding downstream fix was separately built, signed, installed and accepted by the tester on Apple TV 4K (3rd generation), tvOS 27.2 beta. The reported backward/forward scrubbing and cache-band flicker issue passed that physical check. This is downstream integration evidence; it is not a claim that an app built from this exact upstream-base PR was installed or that the entire upstream suite/device matrix passed.
No media titles, filenames, URLs, screenshots, playback positions, account details, device identifiers or raw session logs are included in this PR.
Documentation and review scope
docs/api.mdto describe software residency and distinguish it from the forward frontier.main, carrying only this cache metadata/publication change and its tests/docs. Application-specific timeline code and unrelated downstream changes are excluded.Residency remains a conservative observation, not a guarantee of instant seek/decode. Bounded metadata and missing/invalid timestamps may under-report retained bytes; the implementation deliberately does not fill unknown coverage from byte counts, bitrate or a historical maximum.