AetherEngine 5.20.7
Opt-in whole-source pre-buffer, bounded in bytes (#207)
LoadOptions.forwardBufferSegments (#102) could not honor a host option like "buffer without limit": the engine clamped every request above 150 segments (~10 min at 4 s), so a user who deliberately opted into pre-buffering a whole film for a flaky WAN still stalled once the connection dropped for longer than that.
The ceiling is now 2700 segments (~3 h), a sanity bound that covers a feature film, so a host can pass Int.max to mean "buffer the entire source". The floor (4) and the nil default (10) are unchanged, and 150 still passes through, so sessions that do not opt in are unaffected.
Raising the constant alone would have been unsafe. SegmentCache.pruneOutsideWindow never evicts the hard window, so the retention budget (min(2 GiB, a quarter of the tmp volume's free space)) bounds only the entries outside it. That holds by construction for the historical windows (10 segments ~ 100 MB, the 150 ceiling ~ 1.5 GB), but a whole-film window makes the window itself the footprint and the budget unreachable: ~18 GB of 4K HEVC would land on the volume unchecked, and a failed segment write degrades to a cache miss, i.e. a stall, which is the failure the option exists to prevent.
So the bound moved from segments to bytes:
- Windows past the historical 150 count as an explicit opt-in, so the retention budget drops its 2 GiB default cap for them. The quarter-of-free-space clamp, which is what protects a nearly full device, always applies, and an unknown capacity keeps the conservative cap.
- The producer parks once its race-ahead (bytes at or above the consumer's fetch target) has filled that budget, while the consumer still has at least 10 produced segments ahead of it. The eviction that follows the advancing playhead releases the park.
An opt-in prefetch therefore buffers as much of the source as safely fits and then tracks playback, instead of buffering a fixed segment count and hoping the volume has room. The park cannot starve playback: a short consumer lead keeps producing regardless of the budget.
Reported with a ceiling-raise patch by @fxndxs, whose ceiling change and test deltas are part of this release.
Covered by: PrefetchDiskBudgetTests (budget sizing, park decision, forwardBytes semantics, headroom park primitive, retained-history regression guard) and the updated ForwardBufferWindowTests. 999 tests green, strict-concurrency clean, tvOS and iOS Simulator builds green.