You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting network video playback on iOS, tvOS, and macOS paid avoidable overhead before the first video frame:
AetherLoadSpec left FFmpeg demux probes unbounded (allowing avformat_find_stream_info to scan up to 50 MiB / 60 s chasing sparse bitmap subtitles), read embedded container attachments even when no ASS track needed container fonts, and did not enable progressive segment delivery for local HLS.
Opening the player ran an unthrottled /settings/effective refresh on every playback start and fired trickplay, Now Playing artwork, Next Up, and On Deck catalog fetches before the first video frame.
Approach
Bound network VOD LoadOptions in AetherLoadSpec to a 4 MiB probesize and 2 s maxAnalyzeDuration, enable progressiveSegmentDelivery, and set skipsContainerAttachments whenever the plan has no embedded ASS/SSA track lacking a server font bundle (and during pre-load AetherEngine.probe calls).
Add a 5-minute scope-aware freshness window (refreshFromServerIfStale) in PlayerSettings so opening a title reuses recently fetched effective settings for the active account/profile scope while still refreshing immediately on scope changes.
Defer trickplay, Now Playing artwork, Next Up, and On Deck catalog requests in PlayerViewModel until first frame renders (preserving existing Next Up transition behavior).
Signed iOS Debug build on commit 7c44f743: passed (3/3 bundles validated).
Previously built and ran signed iOS and tvOS builds on physical devices against a live server alongside the companion engine and server changes: passed.
Unit tests added in AetherPlaybackBoundaryTests and PlayerSettingsFlushTests covering the new AetherLoadSpec options and scope-aware settings freshness check. Note: Xcode XCTest suite runs in CI; not executed standalone on the Linux workspace.
Evidence
No visual UI changes; playback startup behavior and options verified via:
Commit: 7c44f743 (rebased onto origin/main at 4cb600af).
Build verification: signed iOS Debug archive built and validated (3/3 bundles: Silo.app, SiloNotificationService.appex, SiloDownloadsActivity.appex).
End-to-end playback check on iOS and tvOS physical devices against 4K Dolby Vision Profile 8.1 MKV (36 PGS tracks) and 1080p SDR MKV sources confirmed clean direct-play and transcode startup without regressions in subtitle rendering, trickplay, or Next Up loading after first frame.
Risks
Bounding probesize to 4 MiB and maxAnalyzeDuration to 2 s may leave very late-starting subtitle streams undiscovered during the initial probe if a container places their first packet far past 4 MiB; standard MKV/MP4 headers still expose track metadata immediately, and ASS tracks without server font bundles continue loading container attachments as before.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
Council review
Rounds: 3, last reviewed at the round-2 fix head; round-3 fixes end at 38a324b0.
Member
Round 1
Round 2
Round 3
Sol (gpt-6.2-sol, medium)
7/10
8/10
8/10
Opus (claude-opus-5-5, medium)
7/10
8/10
8/10
Gemini (gemini-4-neon, medium)
7/10
9.5/10
9/10
Visual review: not run; nothing changes on screen. Fixed in review: settings freshness stamped only after a complete refresh and retired when a refresh starts, deferred previews keyed by load epoch, probe bound limited to network Matroska/MP4 sources. Round 3: overlapping refreshes share one answer, and direct-URL loads keep the default probe.
Adds bounded demux probes (4 MiB, 2s) in AetherLoadSpec.swift for non-file Matroska/WebM/MP4/M4V/MOV loads, and skips container attachments unless an original-HTTP embedded ASS-family subtitle needs fonts. Also enables progressive segment delivery only for non-server-HLS video loads.
PlayerSettings.refreshFromServerIfStale in PlayerSettings.swift reuses a refresh for 300 seconds when the scope is unchanged, no writes are pending, and migration is done. It waits for an in-progress same-scope refresh, and only stamps freshness after all reads answer for the same scope and generation.
PlayerViewModel.swift now defers artwork, Next Up/On Deck fetches, and server trickplay loading until first frame for online non-transitioning playback. Transition artwork stays immediate.
Pins AetherEngine to revision db3125af433a443f85f9914b211dd9b3dbc1e4c3 in project.yml and updates license notices.
Behavioral Change: startup settings refresh no longer always hits the server; direct-URL loads keep engine-default probe settings; TS/M2TS plans get no probe limits. Check AetherLoadSpec.validating-plan initializer and PlayerViewModel prepared-playback completion handler for the deferral logic.
Aether load construction now applies container-specific probe limits, progressive segment delivery, and attachment-skipping rules. Player startup defers catalog and trickplay work until a startup milestone. Settings refreshes can reuse complete, recent results for the active scope.
PlayerSettings records the scope and time of complete server refreshes. It reuses a result only when freshness, scope, pending-write, and migration conditions permit it. Tests cover reuse and incomplete refreshes.
The view model uses stale-aware settings refresh and defers catalog and trickplay work until the startup milestone. It handles load epochs and Next Up transitions, and skips attachments for the exact audio-track probe.
sequenceDiagram
participant PlayerViewModel
participant PlayerSettings
participant Server
PlayerViewModel->>PlayerSettings: refreshFromServerIfStale
PlayerSettings->>Server: Read settings when freshness conditions require it
Server-->>PlayerSettings: Return settings reads
PlayerSettings-->>PlayerViewModel: Return refresh result
PlayerViewModel->>PlayerViewModel: Release pending metadata at startup milestone
Loading
Possibly related issues
Silo-Server/silo-apple#1269 — The PR changes settings-refresh reuse conditions, including pending writes; the supplied summary does not establish that it fixes the reported old-device-value behavior.
Possibly related PRs
Silo-Server/silo-apple#814 — Both PRs change Aether load behavior; the engine pin change in #814 affects the engine behavior assumed by this PR.
Suggested reviewers:rhainland
Merge Risk: Moderate · up to 1561d
Player startup can reuse wrong settings for up to five minutes, some ASS subtitles can lose their fonts, and a Keep Watching remount can reset the viewer's autoplay cancellation. These are bounded edge cases, but they should be fixed or accepted before merge.
Security architecture risk: Low · up to 1561d
The performance changes are confined to the Apple player. Two remaining risks are local: overlapping refreshes can cause the next playback to reuse partially refreshed settings, and a replacement load can briefly use the previous file’s scrub previews. The reviewed changes do not expand media credential authority.
Retained concerns
Trivial · reliability · inferred: An overlapping same-scope refresh can leave the live settings certified by the wrong refresh. Both calls clear freshness at entry, but if one finishes completely and stamps the scope before the other applies a partial response, the partial response leaves that stamp intact. With migration complete and no pending or revision-gated writes, the next playback can skip the retry the merge base would have attempted. Clearing at entry protects sequential refreshes, not overlapping completions.
Trivial · reliability · inferred: Deferring the replacement trickplay fetch also defers retiring the old file’s sheets. If a different file is established before its startup milestone, PlayerViewModel activates the new scrub preview session but leaves the previous sheets and their request key intact. A scrub request in that interval can fall back to the old file’s thumbnails. The epoch check protects the deferred fetch, not the installed sheets; mismatched sheets are retired when the replacement fetch runs, or on full teardown. The merge base retired them at load establishment.
inferred — The demonstrated effects are within the active Apple app instance: settings reuse within the matching scope and preview state across replacement loads in one player. The inspected paths did not establish cross-account access or an expansion of service privileges.
Trust Boundaries and Controls
observed — Playback plan container and subtitle fields now influence demux and attachment options. The inspected merge-base comparison leaves the app-side request credential resolver and native server HLS boundary unchanged. The probe limits are startup tuning, not an independently verified sandbox or hard network deadline.
Public contracts
observed — The app-internal startup method returns the same result for a freshness hit as for a successful read. PlayerViewModel does not distinguish them; it applies the shared settings after either path. This is a client-side contract change, not a server API change.
Dependencies
observed — AetherLoadSpec requests a 4 MiB probe size and a two-second analysis limit for eligible non-file containers, preserves default probe settings for unknown or packet-described containers, and retains attachments when the plan indicates embedded ASS or SSA without a server font bundle. The app requests progressive delivery for Aether video routes, not native server HLS. The effective behavior of those options in the pinned engine was not independently established.
Data and control flow
observed — PlayerViewModel accepts events only from the active load epoch. A video first frame or an audio-only playing event takes the milestone once per epoch. Deferred trickplay is released only for a matching epoch; pending catalog detail can carry through recovery for the same item.
Resilience and Maintainability Implications
observed — For a non-overlapping refresh, failure or incomplete follow-up reads leave the stamp clear and the next startup retries. A successful subtitle-offset clear delegates freshness to the repaint. The reuse guard also rejects expired and nonmatching stamps or unsettled writes. None of those checks establishes which overlapping completion last applied the live settings.
observed — Replacement retires pending trickplay work for the previous epoch, and final teardown clears installed sheets. While waiting for a replacement’s milestone, the new epoch alone does not retire already installed sheets for a different file.
Rollout and rollback
observed — PlayerSettings, not a server operator, decides at playback startup whether to skip the effective-settings read by checking scope, age, pending writes, and migration. The PR leaves the AetherEngine pin unchanged; adopting the companion engine revision is a separate app dependency update.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names three changes: bounded network demux probes, settings freshness caching, and deferred startup metadata. The changeset implements all three in AetherLoadSpec, PlayerSettings, and Player…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description states the problem (player startup overhead on iOS, tvOS, and macOS), the approach (bounded probes in AetherLoadSpec, a 5-minute settings freshness window in PlayerSettings, and deferr…
Full details: Title check
Explanation
The title names three changes: bounded network demux probes, settings freshness caching, and deferred startup metadata. The changeset implements all three in AetherLoadSpec, PlayerSettings, and PlayerViewModel. The title is specific and follows the conventional-commit style. It is somewhat long at 94 characters.
Full details: Description check
Explanation
The description states the problem (player startup overhead on iOS, tvOS, and macOS), the approach (bounded probes in AetherLoadSpec, a 5-minute settings freshness window in PlayerSettings, and deferred trickplay, artwork, Next Up, and On Deck work in PlayerViewModel), validation steps, and risks. It relates directly to the changeset, so the check passes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The change is visible, but the Evidence section reports checks rather than showing the changed behavior.
PlayerViewModel.swift: deferring Now Playing artwork and Next Up/On Deck fetches changes when those surfaces populate; deferring server trickplay changes when seek previews are available. The shared code reaches iPhone, iPhone Duo folded and open, iPad, Mac, and Apple TV. Evidence is missing on all six: please provide recordings of startup timing that show the affected surfaces on each device. The current iOS/tvOS playback note is not a recording and provides no Mac capture.
PlayerSettings.swift: reusing settings for up to five minutes can leave older playback preferences in effect after a setting changes elsewhere. The shared code reaches iPhone, iPhone Duo folded and open, iPad, Mac, and Apple TV. Evidence is missing on all six: please provide recordings or before-and-after captures showing playback after a settings update on each device.
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.
The reason will be displayed to describe this comment to others. Learn more.
Freshness marker survives an unsuccessful intervening scope switch
After a failed scope switch, returning to the previous scope can leave the wrong cached settings active for five minutes. Invalidate lastRefreshedScopeID when the scope changes, or reapply the active scope's cache before returning a fresh result.
Prompt for LLM
File iosApp/iosApp/Screens/Player/PlayerSettings.swift, lines 906-908:
Freshness marker survives an unsuccessful intervening scope switch
A failed refresh after switching from scope A to B leaves B's cached settings active while retaining A's freshness marker, so switching back to A within five minutes returns without restoring A's settings. Invalidate the freshness marker when the active scope changes, or reapply the active scope's cache before returning a fresh result.
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed in 65daf67: when a refresh replaces the live values with another scope's cache, it drops the old scope's stamp, so returning to that scope after a failed refresh isn't counted fresh. Covered by testRefreshFromServerIfStaleRereadsAfterAnIncompleteOrForeignRefresh.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. Invalidating the previous scope’s freshness stamp when another scope’s cache is applied addresses the reported scenario. The regression test covers a return to the prior scope after an incomplete or foreign refresh.
I haven’t independently verified the commit or test run.
The reason will be displayed to describe this comment to others. Learn more.
Partial settings refresh failures are cached as successful
A failed cellular or buffering read can leave playback using stale quality settings for five minutes. Set lastRefreshedScopeID and lastRefreshedAt only when all applicable follow-up reads succeed.
Prompt for LLM
File iosApp/iosApp/Screens/Player/PlayerSettings.swift, lines 1006-1008:
Partial settings refresh failures are cached as successful
A transient failure in the cellular or buffering follow-up still marks the entire refresh fresh, so subsequent playback starts reuse stale quality settings for five minutes instead of retrying those reads. Only record freshness when all applicable follow-up reads succeed.
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed in 65daf67: the stamp is set only when the cellular, buffering, and repaint reads all answered, and the window is measured on ContinuousClock, so a wall-clock change can't keep it fresh.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for confirming. The reported issue is addressed in commit 65daf670: freshness is recorded only when all three reads answer, and ContinuousClock prevents wall-clock changes from extending the freshness window.
The reason will be displayed to describe this comment to others. Learn more.
Deferred trickplay metadata is not bound to the current load
A replacement load's first frame can trigger a trickplay fetch for the previous item. Bind pendingStartupMetadataPrepared to its load epoch and content identity, verify both before fetching, and clear it on replacement or disposal.
File iosApp/iosApp/Screens/Player/PlayerViewModel.swift, line 2429:
Deferred trickplay metadata is not bound to the current load
Bind the deferred prepared playback to its load epoch and content identity, and verify both before starting trickplay. Also invalidate it when the load is replaced or the player is disposed. Otherwise, a replacement load's first frame can drain prepared metadata retained from an earlier load and start fetching the wrong item's trickplay.
Kody rule violation: [Finalize outgoing playback before publishing a replacement item](https://kodus.siloserver.org/settings/code-review/1247142423/kody-rules/35c050ff-caf6-4a0c-ac27-aff0b2a1999f?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
The reason will be displayed to describe this comment to others. Learn more.
Confirmed for the seek-bar previews and fixed in bb1787d: the pending previews are keyed by the load's epoch, drained only on that epoch's first frame, and cleared on dispose. The catalog detail (artwork, Next Up) is replaced by every fresh load before any first frame can be handled, and it's deliberately kept across a route recovery of the same item, which reaches its first frame on a later epoch.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying. The epoch-bound preview handling addresses the reported stale trickplay fetch. Keeping catalog detail across a same-item route recovery also makes sense, given that a fresh load replaces it.
The reason will be displayed to describe this comment to others. Learn more.
Deferred trickplay can be consumed by a replacement load
A replacement load can fetch and install thumbnails for the previous item. Bind pendingStartupMetadataPrepared to its load epoch and clear it on replacement or disposal.
Prompt for LLM
File iosApp/iosApp/Screens/Player/PlayerViewModel.swift, lines 2429-2431:
Deferred trickplay can be consumed by a replacement load
Deferred trickplay metadata is not associated with its load epoch or cleared on replacement, so a replacement load reaching first frame before its own load completes can start the previous item's trickplay fetch and install its thumbnails. Clear pending metadata on disposal and associate it with the epoch that created it.
The reason will be displayed to describe this comment to others. Learn more.
Independently tested 7c44f743 against 4cb600afe5. Both app revisions built for iOS, tvOS, and macOS on the existing f470d8dc engine pin.
Keep that pin until the engine change includes LiveTelemetry.relayMediaReceivedBytes. The tested app base with the AetherEngine base and app head with AetherEngine #31 at 68e3bafd both fail to compile at AetherPlaybackController.swift:1385 because that member is absent. The standalone build on the existing pin passed. App call site
On the existing pin, the iPhone simulator’s native Play link to first frame report had a median of 8.67 → 8.73 s including cold relaunch, and 858 → 781 ms warm (4 trials per revision). Warm p95 was 912 → 1,100 ms. The focused settings and playback boundary run passed 166 XCTest cases on the PR. This comparison covers a single iPhone simulator and one playback route. tvOS and macOS coverage was build only.
AI-assisted validation · Codex (gpt-6.2-sol, xhigh) in T3 Code.
…he same scope
The startup refresh skip trusted any refresh that reached its end. A refresh
whose cellular or buffering read failed still stamped the scope fresh, so the
next Play within five minutes kept this device's older values for those keys.
A failed refresh after a scope switch put the new scope's cache on screen but
left the old scope's stamp, so returning to it reused the wrong values.
Stamp only when every read answered, drop another scope's stamp once its
cache is replaced, and measure the window on a monotonic clock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…queued them
The first-frame deferral kept the prepared playback in a slot that no load
owned. A load that set it up and was replaced before its first frame left it
behind, and the replacement's first frame fetched the previous item's
previews before its own replaced them.
Key the slot by the load epoch, drain it only on that epoch's first frame,
and clear it with the rest of the per-load state on teardown. The deferred
catalog detail stays as it was: every fresh load replaces it, and a route
recovery of the same item still needs it on the recovered load's first frame.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sources
The 4 MiB / 2 s probe applied to every load Aether demuxes. An original
MPEG-TS or M2TS file states its stream parameters only in its packets, so a
short probe can leave audio tracks unresolved, and a local file has no
network round trips to save.
Take the bounded probe only for a network source whose stream container is
Matroska or MP4/MOV, and keep the engine default for everything else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7c44f743. The inline finding is new; the settings-freshness and deferred-trickplay threads are answered in place.
For the maintainers: this PR keeps its existing AetherEngine pin f470d8dc, which is the head of AetherEngine PR #30 (not merged). AetherEngine #31 is based on engine main, which lacks LiveTelemetry.relayMediaReceivedBytes, so the app can't move to a commit with both until #30 lands and #31 is rebased, or #31 is rebased onto #30.
I checked the deferral against a Next Up transition (artwork is pushed in the transition branch, and the first-frame handler loads Next Up and On Deck) and offline playback (the cached poster is published; no server previews offline, as before), and found no defect.
The reason will be displayed to describe this comment to others. Learn more.
Extensionless direct stream URLs disable bounded probing
Extensionless session URLs select the default probe even for Matroska or MP4, causing long network scans during direct playback. Pass the known media container from prepared.selectedVersion to boundsDemuxProbe instead of inferring it from directURL.
Prompt for LLM
File iosApp/iosApp/Screens/Player/AetherLoadSpec.swift, lines 403-406:
Extensionless direct stream URLs disable bounded probing
Extensionless session URLs such as `/api/v2/stream/session-one` always select the default probe even when the underlying media is Matroska or MP4, restoring the long network scans this change is intended to avoid on the direct playback path. Pass the known media container from `prepared.selectedVersion` into this initializer instead of inferring it from the session URL.
The freshness stamp can describe an earlier complete refresh rather than the settings currently in use. If a newer same-scope refresh adopts the main settings batch but cannot read cellular or buffering preferences, it leaves an existing stamp intact. The next player startup can then skip the retry that the merge base would have made. There is a second route to the same inconsistency: after subtitle-offset cleanup, the outer refresh can stamp the cache because the repaint returns .refreshed even when one of its follow-up reads failed. Scope changes, expiry, pending writes, and incomplete migration can force a full refresh, but none guarantees a retry for a settled same-scope cache after a partial read.
1
Do not require an order between the concurrent follow-ups.
The new async let calls create independent child tasks. Awaiting cellularTask first does not force its request to enter the transport first. Swift defines these initializers as concurrently executing child tasks. (raw.githubusercontent.com)
On iOS, the fake can record buffering before cellular, which fails this assertion despite a correct refresh. Compare the remaining batches without order. Keep the count and first-batch assertions.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: a4b303b5-ea74-4373-aed6-09ae9c8b04f7
Commits
Reviewing files that changed from the base of the PR and between 4cb600a and 838b31f.
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Register font bundles for later embedded ASS selections before skipping attachments.
If subtitles start off and an embedded ASS track has fontBundleUrl, this skips the container fonts. However, subtitleFontRequests contains only the initially selected track.
When the viewer later selects that ASS track, registerProtocolV3EmbeddedSubtitleIfAvailable takes the native path. registerEmbeddedSubtitleTrack binds the IDs but does not register the font request. ASSSubtitleSession.prepareFonts then finds neither container fonts nor a bundle request. The track loses its authored fonts for that session.
Register the bundle on native embedded selection, or retain container attachments until that path supports bundles.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Invalidate freshness when a local mutation is queued.
After a complete refresh, call setAudioLanguage("") and let its clear finish successfully. The setter leaves audioLanguage as "", but the inherited profile language can be "en". Once the queue drains, these guards permit reuse without reading the inherited value.
Previously, the next startup refresh resolved "en". The new path can retain “no preference” for five minutes. Invalidate the stamp when queuing a mutation, not only while the mutation remains pending.
The reason will be displayed to describe this comment to others. Learn more.
Major · Functional Correctness · Quick win
Preserve viewer choices when starting the deferred Next Up lookup.
If the viewer cancels autoplay, encounters a premature end, and selects Keep Watching, beginFreshLoad restores that cancellation through carriedViewerChoices at Line 6742. This deferred call then resets nextUpAutoplayCancelled and nextUpPromptDismissed to false inside loadNextUpCandidate.
When the lookup completes inside the prompt window, the prompt can reopen and autoplay can advance against the viewer's choice. Previously, the reset ran before the carried choices were restored.
Separate the new-item reset from the lookup. Keep the reset for new items, but preserve the carried choices for a same-item remount.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Replacement loads can show the previous file's seek previews.
When a replacement load changes the file, the previous file's server sheets remain installed until the new load's first frame. The clear now waits for that frame (PlayerViewModel.swift:5220-5225). A scrub in this window can show a thumbnail from the old file. The provider answers by source time and does not compare file identity (AetherScrubPreviewProvider.swift:209-217).
Clear the previous file's sheets when the new load's file differs, before scrubbing can use them. Keep the sheets for a same-file reload, as the current design does.
A forced refresh whose follow-up read failed left the previous stamp in place, so the next Play skipped the retry. The stamp is now retired when a refresh starts and set again only when every read answers, and the subtitle-offset repaint returns its own result instead of letting the outer refresh stamp over it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fit: 8/10 · Readiness: 7/10 — conditional (assuming CI is green)
What changed in review
Settings freshness: a cached refresh counts as fresh only when every follow-up read answered, on a monotonic clock. A refresh retires the stamp when it starts, and the subtitle-offset repaint decides its own stamp.
Deferred seek-bar previews: keyed by their load's epoch and cleared on dispose. The deferred catalog detail is kept across a route recovery of the same item on purpose.
Probe bound: now applies only to network Matroska, WebM, MP4, M4V, and MOV sources. MPEG-TS and M2TS originals carry track parameters only in packets.
Checks: iOS and tvOS build through the build service, and the XCTest bundle compiles. The tests weren't run, because that needs a simulator.
The measured gain is in warm starts. On the iPhone simulator, cold starts measured 8,665 → 8,731 ms and warm starts 858 → 781 ms before the review fixes.
Fit is 8: a client performance change that matches the other apps. Readiness is 7 because the new XCTests haven't run, and the engine side can't be adopted until #30 lands.
A direct URL has no container metadata, and server stream URLs usually
have no file extension, so guessing the container from the path could
bound one load and not the next. Online loads take a v3 plan, so this
path now always keeps the engine's default probe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 3 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
An overlapping same-scope refresh can leave the live settings certified by the wrong refresh. Both calls clear freshness at entry, but if one finishes completely and stamps the scope before the other applies a partial response, the partial response leaves that stamp intact. With migration complete and no pending or revision-gated writes, the next playback can skip the retry the merge base would have attempted. Clearing at entry protects sequential refreshes, not overlapping completions.
Deferring the replacement trickplay fetch also defers retiring the old file’s sheets. If a different file is established before its startup milestone, PlayerViewModel activates the new scrub preview session but leaves the previous sheets and their request key intact. A scrub request in that interval can fall back to the old file’s thumbnails. The epoch check protects the deferred fetch, not the installed sheets; mismatched sheets are retired when the replacement fetch runs, or on full teardown. The merge base retired them at load establishment.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 1ca9c790-bbaa-4eab-86ca-5298374d6428
Commits
Reviewing files that changed from the base of the PR and between 838b31f and 1561d5e.
Files selected for processing: 2
iosApp/iosApp/Screens/Player/AetherLoadSpec.swift
iosApp/iosApp/Screens/Player/PlayerSettings.swift
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Keep attachments for sidecar ASS tracks without bundles.
For an original Matroska file with attached fonts and an external ASS track without a bundle, this guard skips the attachments. ASSSubtitleSession.prepareFonts previously used those attachments for sidecars too. The sidecar now loses its authored fonts. Include such tracks when deciding whether to keep attachments.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Heavy lift
Preserve a fallback when the font bundle fails.
For a selected embedded ASS track with a bundle URL, this skips the container fonts. If the bundle request fails, prepareFonts records a failure and stops drawing subtitles until the selection changes. Previously, it used the container fonts without making that request. Keep the attachments or provide a recovery path for a failed bundle request.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Data Integrity & Integration · Quick win
A profile round trip during a refresh can stamp mixed settings as fresh.
The final guard at line 990 and the stamp guard at line 1020 compare only the current scope with refreshScopeID. If the active scope moves to another profile while a follow-up read is pending and returns before these checks, both comparisons pass. The cellular or buffering values from the other scope are then applied to this scope and recorded with a fresh stamp. Startup can reuse them for up to 300 seconds without a server read.
Any scope change during the refresh must block adoption of its values and the stamp. This applies even when the scope returns to the starting value before the final check. Update the comment at lines 987-989 to match this behavior.
Two refreshes for the same scope could interleave. Each cleared the
freshness stamp on entry, and a complete one could restamp the cache
before the other applied partial results, so the next Play skipped a
read that was missing. A Play that started during a refresh also could
not reuse it and sent a second full refresh, flushes included.
Each refresh now runs as a tracked task with a generation number. Only
the newest refresh applies results and stamps freshness; an older one
returns the newest one's answer. refreshFromServerIfStale waits for a
refresh already running in its scope before deciding whether to read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
A superseded refresh can return another scope’s result
If the user switches from scope A to B and back to A, latestRefresh can return B’s successful result even though A’s result was never applied. Adopt the replacement result only for the captured scope, and recheck the scope and applicable generation after awaiting it.
File iosApp/iosApp/Screens/Player/PlayerSettings.swift, line 1028:
A superseded refresh can return another scope’s result
Only adopt the replacement refresh’s result when it belongs to the same captured scope, and recheck that scope and the applicable generation after awaiting it. For example, if an A refresh is superseded by a B refresh and the user switches back to A, this can return B’s successful result as the answer to A’s refresh even though A’s result was never applied.
Kody rule violation: [Fence asynchronous results by scope and invalidation generation](https://kodus.siloserver.org/settings/code-review/1247142423/kody-rules/ce041253-02ac-48cb-9576-81de9b2f41ef?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)
The reason will be displayed to describe this comment to others. Learn more.
Failed shared refreshes fan out into duplicate network requests
A failed refresh or missing freshness stamp can trigger duplicate network reads from every waiting playback request, worsening server outages or slowdowns. Return the shared result to waiters, or coordinate retries through a single shared task.
Prompt for LLM
File iosApp/iosApp/Screens/Player/PlayerSettings.swift, lines 919-920:
Failed shared refreshes fan out into duplicate network requests
When a shared refresh fails or cannot stamp freshness, every waiting playback request starts its own full refresh, producing a burst of duplicate network reads precisely when the server is unavailable or slow. Return the shared result to waiters, or coordinate any necessary retry through a single shared task.
Fit: 8/10 · Readiness: 8/10 — conditional (assuming CI is green)
What changed since the last summary
Overlapping settings refreshes now share one answer. Only the newest refresh applies what it read or stamps freshness. A Play that arrives while a refresh for the same scope is running waits for it, instead of starting a second one. The new XCTest fails without the change.
Direct-URL loads keep the engine's default probe. Online loads take a v3 plan, so the probe bound comes from the plan's container.
The XCTests ran on an iOS simulator: PlayerSettingsFlushTests (105), AetherPlaybackBoundaryTests, and ServerTrickplayTests all pass.
AetherEngine moves from f470d8dc, the unmerged head of
Silo-Server/AetherEngine#30, to db3125af on its main branch. That
commit carries #30 as merged, the cold-start changes from #31 that this
branch's startup work goes with, and #27's single sidecar fetch. The
engine's package dependencies are unchanged. The third-party notices
and the bundled open-source README name the new revision.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.
Reviewing changes in Silo
Include the related issue, expected behavior, and validation steps in the PR description.
For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
Follow this repository's AGENTS.md and CONTRIBUTING.md.
Request another review with @kody start-review in a PR comment.
React with 👍 or 👎 to give feedback on individual suggestions.
Review settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 3 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
The reason will be displayed to describe this comment to others. Learn more.
Register font bundles for embedded tracks before skipping attachments
When original-file playback starts with subtitles off (or a non-ASS track selected), an embedded ASS track with a fontBundleUrl now causes container attachments to be skipped, but AetherLoadSpec.subtitleFontRequests only registers the initially selected track's bundle. Selecting that ASS track later uses registerEmbeddedSubtitleTrack, which registers no font request and bypasses the sidecar path. Consequently, ASSSubtitleSession.prepareFonts has neither container fonts nor a bundle request, so subtitles lose their authored fonts and can display missing glyphs. Register bundle requests when mounting embedded tracks, or retain attachments until every locally selectable ASS track has a working font-loading path.
Useful? React with 👍 / 👎.
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
enhancementNew feature or requestimpact: perfUnusable slowness on normal hardwareneeds-reviewNeeds maintainer review to resolve uncertain classification, scope, or changed evidence.priority: P2Limited scope, workaround exists, or polishsize/L200–499 added + deleted lines (all files); change volume, not priority.
1 participant
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
Related issue: N/A
Validation tasks: none
Other clients: Apple (this PR); Android Silo-Server/silo-android#1135; Roku Silo-Server/silo-roku#129; Web Silo-Server/silo-server#5849
Starting network video playback on iOS, tvOS, and macOS paid avoidable overhead before the first video frame:
AetherLoadSpecleft FFmpeg demux probes unbounded (allowingavformat_find_stream_infoto scan up to 50 MiB / 60 s chasing sparse bitmap subtitles), read embedded container attachments even when no ASS track needed container fonts, and did not enable progressive segment delivery for local HLS./settings/effectiverefresh on every playback start and fired trickplay, Now Playing artwork, Next Up, and On Deck catalog fetches before the first video frame.Approach
LoadOptionsinAetherLoadSpecto a 4 MiBprobesizeand 2 smaxAnalyzeDuration, enableprogressiveSegmentDelivery, and setskipsContainerAttachmentswhenever the plan has no embedded ASS/SSA track lacking a server font bundle (and during pre-loadAetherEngine.probecalls).refreshFromServerIfStale) inPlayerSettingsso opening a title reuses recently fetched effective settings for the active account/profile scope while still refreshing immediately on scope changes.PlayerViewModeluntil first frame renders (preserving existing Next Up transition behavior).Companion engine startup improvements are in Silo-Server/AetherEngine#31. This PR pins AetherEngine to
db3125afon its main branch, which has #31 and Silo-Server/AetherEngine#30 merged, plus Silo-Server/AetherEngine#27's single sidecar fetch.Validation
7c44f743: passed (3/3 bundles validated).AetherPlaybackBoundaryTestsandPlayerSettingsFlushTestscovering the newAetherLoadSpecoptions and scope-aware settings freshness check. Note: Xcode XCTest suite runs in CI; not executed standalone on the Linux workspace.Evidence
No visual UI changes; playback startup behavior and options verified via:
7c44f743(rebased ontoorigin/mainat4cb600af).Silo.app,SiloNotificationService.appex,SiloDownloadsActivity.appex).Risks
Bounding
probesizeto 4 MiB andmaxAnalyzeDurationto 2 s may leave very late-starting subtitle streams undiscovered during the initial probe if a container places their first packet far past 4 MiB; standard MKV/MP4 headers still expose track metadata immediately, and ASS tracks without server font bundles continue loading container attachments as before.Checklist
Council review
Rounds: 3, last reviewed at the round-2 fix head; round-3 fixes end at
38a324b0.Visual review: not run; nothing changes on screen. Fixed in review: settings freshness stamped only after a complete refresh and retired when a refresh starts, deferred previews keyed by load epoch, probe bound limited to network Matroska/MP4 sources. Round 3: overlapping refreshes share one answer, and direct-URL loads keep the default probe.
Evidence: https://evidence.siloserver.org/r/silo-apple/pr-1360/
AI Disclosure
Note
Bound network demux probes, cache settings freshness, and defer startup metadata
PlayerSettings.refreshFromServerIfStalein PlayerSettings.swift reuses a refresh for 300 seconds when the scope is unchanged, no writes are pending, and migration is done. It waits for an in-progress same-scope refresh, and only stamps freshness after all reads answer for the same scope and generation.AetherLoadSpec.validating-plan initializerandPlayerViewModel prepared-playback completion handlerfor the deferral logic.Macroscope summarized 8b530df.