Repository navigation
feat(io): a remote disc image adopts a prewarmed source (AE#647) - #648
Merged
Merged
Conversation
HTTPDiscIOReader never looked at the prewarm store: a warmed .iso was fetched, then the disc reader probed its size with bytes=0-0 and pulled the head again while the warm sat unused until eviction. The reader now takes the warm under the same rule AVIOReader adopts by (head at zero, size stated, headers equal), uses its size instead of the probe, serves reads inside the warmed spans from RAM and starts its first request at the frontier. Forks share the spans and the size, so a subtitle side reader or forward prefetcher no longer re-probes either. A disc-image URL that is no disc hands the warm back to the store for the streaming reader it falls back to. Measured with aetherctl on an authored DVD over a 20 Mbit/s, 100 ms origin: 10 requests after the warm instead of 19, first frame at 23.9 s instead of 29.6 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf
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.
Refs #647.
HTTPDiscIOReadernever consulted the prewarm store. On a warmed.isothe disc reader probed the size withbytes=0-0, fetched the head again into its own buffer, and left the warm in the store until something evicted it.Change
HTTPDiscIOReader.takePrewarm(for:extraHeaders:)takes the warm under the same ruleAVIOReaderuses (head at zero, size stated, headers equal).prewarmed:uses the warm's size instead of the range probe. Reads inside the warmed spans come from RAM, a refill stops at the next span, and the first request starts at the warm frontier. The adaptive window treats that frontier as a sequential continuation.makeIndependentReader()passes the spans (immutableData, no copy) and the known size, so forks (subtitle side reader, forward prefetcher) skip the probe and the head.Demuxer.openHTTP: when a disc-image URL turns out not to be a disc, the warm goes back into the store, and the streamingAVIOReaderit falls back to adopts it.Measured
aetherctl playon a dvdauthor-built DVD ISO (49 MB) served by a logging range origin at 20 Mbit/s with 100 ms per response:bytes=0-0)--prewarm--prewarm8388608Most of the remaining time is
find_stream_info. MPEG-PS setsAVFMTCTX_NOHEADERand never clears it, so every DVD open reads the full playback probe budget (50 MB / 60 s). That is a separate issue.Tests
Issue647DiscReaderPrewarmTestsruns againstThrottledOriginServerwith a patterned body:Full suite green locally: 3522 swift-testing tests + 17 XCTest.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mf4MXgM9bqugHoe5TW4BYf