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.
Summary
Two increasing audio PTS values can still overflow signed subtraction when they straddle the Int64 range. The duration-less coverage path subtracts them before checking its gap bound, trapping the read-ahead worker. Reject the overflowing difference instead.
This branch also includes the independently reviewable prewarm repair from #831 as a prerequisite for reliable CI. Merge #831 first if preferred; the audio coverage change remains unchanged.
What changed
Use
subtractingReportingOverflowbefore converting the delta to seconds or inserting coverage. The existing 0.5-second bound, positive-duration behavior, repeated TrueHD timestamps, and source-epoch cleanup are unchanged. This does not add a new coverage model or codec policy.Initial audio-only validation
Host: Apple Silicon Mac17,3, macOS 26.7.1, Swift 6.4. Synthetic compressed-packet metadata through the real read-ahead worker and disk FIFO, with duration-less audio PTS
Int64.min + 1followed byInt64.max - 1. The producer must finish without a trap and must not invent audio coverage that permits a cached seek. Existing duration-less TrueHD, ordinary-duration and real-hole regressions run alongside it. No real codec decoding or device playback claimed.SIGTRAP). With the subtraction guard, the same test passes and rejects the cached seek.LIBDISPATCH_COOPERATIVE_POOL_STRICT=1.git diff --checkpassed; platform and all-traits coverage remain for upstream CI.Checklist
Combined-branch validation and CI repair
Merged the original #831 commit
71096dd61c1a9ab375d20b928ad9574d06c18ddf, preserving its ancestry. The only merge conflict was the changelog; both entries are retained. AVIOReader, prewarm tests and API documentation match #831 exactly; the original audio implementation and tests are unchanged. No API or dependency changes.The previous macOS failure came from a fully adopted source issuing an unnecessary suffix request. This branch now contains the production fix and complete/partial-warm regressions instead of merely linking a separate PR. #831 remains open as the focused upstream contribution.
On the combined branch, the native host build and 64 prewarm/redirect/audio-coverage tests across 11 suites pass under the strict cooperative pool. Test bundle and CLI signatures were verified with a valid Apple Development certificate. Documentation links and diff checks pass. Full default/all-traits and platform CI has now passed against the new head (details below); the old failed run remains historical evidence. No device playback is claimed.
Final combined-head CI
All four checks passed at
240f3a6bf96b57b27b49a985ac52591ddebd7c24: macOS tests (default/all traits, normal/strict cooperative pool, standalone regressions and probes), tvOS/visionOS builds, iOS/release CLI builds, and documentation links. Successful run 39107380102. The original failed run is retained as history.