Repository navigation
feat(cache): expose session byte budgets and lifecycle status - #830
Merged
superuser404notfound merged 1 commit intoOct 21, 2026
Conversation
superuser404notfound
merged commit Oct 21, 2026
7e4fd03
into
superuser404notfound:main
4 checks passed
superuser404notfound
pushed a commit
that referenced
this pull request
Oct 21, 2026
…for #830 SegmentCache, PrefetchDiskBudget and the window sizing read a 0 budget as "no byte bound", so sessionCacheByteBudget: 0 (or any request the volume clamp reduced to 0) dropped the park and the quarter-of-free-space guard instead of keeping only the window. An explicit request now enforces at least 1 byte; the status still reports the clamped request. Also restores the AE#451 ordering comment and the spared-live-dir log line in the stale sweep, reattaches sessionRetentionBudgetBytes' doc comment, and moves the changelog entry into Unreleased in house style. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
superuser404notfound
pushed a commit
that referenced
this pull request
Oct 21, 2026
…s stay sweepable The sweep rewrite in #830 skipped a session directory whose creation date could not be read, so such a remnant was never removed; it counts as old again, as before, and liveness still spares a held one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
Owner
|
Merged in The branch predated #827, #829 and #348, so the merge resolved eight conflicts: the requested byte budget now goes through Follow-ups on main:
Full suite green after each step (780 XCTest, 4753 Swift Testing). Ships with the next engine release. |
Owner
|
Released in 7.45.0 ( |
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.
Hosts can choose a forward window but cannot request an exact temporary VOD cache budget or tell whether cleanup succeeded. Add optional
LoadOptions.sessionCacheByteBudgetand a separateEngineDiagnostics.sessionCacheStatussnapshot with requested/effective budgets, resident bytes, protected-window overflow, producer parking, eviction and typed cleanup/failure results.Nil preserves existing automatic sizing. Explicit requests reuse the quarter-of-available-space safeguard and
RetentionClaimsallocation after other sessions' unwritten claims. Unknown capacity keeps the conservative ceiling. Zero keeps the necessary working window rather than promising zero I/O; the software disk path keeps a bounded working spool. A protected fMP4 playback window may exceed the request, which the snapshot reports explicitly. The tvOS memory default and live DVR policy remain unchanged; live reports this VOD byte policy as unsupported.State is sampled off-main from the segment ledger at the existing telemetry cadence. Cleanup may publish after stop, but session tokens reject callbacks from a superseded load/rebuild and an old startup callback cannot revive a stopped cache. Remote HLS is reported as AVPlayer/server managed, not successful zero-byte caching. Detailed snapshots cover fMP4 segment caching; software packets retain their existing telemetry.
Keep the existing #720 ENOSPC classification and #714 live DVR limits. A bounded stale-directory sweep retains the liveness marker, reports enumeration/deletion failures, and never reuses another session's bytes. This is not the cross-launch source cache discussed in #706. No UI settings or host-specific cache tiers are included.
This is independent of #827 (explicit packet-store selection), but both touch
SoftwarePlaybackHostconstruction and the LoadOptions inventory. If #827 lands first, the requested-byte resolution belongs inside its disk factory; the memory branch andautomaticplatform choice must stay unchanged. No combined-branch or device performance acceptance is claimed.Tests cover default equivalence, explicit/zero/unknown capacity, shared claims, actual segment writes and replacements, parking, hard-window overflow, bounded sweep, failed directory/write/adoption/cleanup, real engine load/stop cleanup and rejection of old-session updates.
Validation: 66 focused tests under the strict cooperative pool passed. Full serial host suite passed: 795 XCTest tests (1 existing skip) and 4,636 Swift Testing tests across 637 suites. Published documentation links and
git diff --checkpassed. Existing Issue451 creation-time/liveness assertions remain unchanged, and a callback-type regression preserves the public zero-argumentHLSVideoEngine.stop()API. Platform and optional-trait validation is left to CI; no new device acceptance is claimed.