Skip to content

fix(playback): report a slow link on a stall only with slow-transfer evidence - #1011

Merged
Quick104 merged 3 commits into
Silo-Server:mainfrom
Rhainland:fix/buffering-slow-link-evidence
Nov 22, 2026
Merged

Quick104 merged 3 commits into
Silo-Server:mainfrom
Rhainland:fix/buffering-slow-link-evidence

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none
Paired pull requests (same report): Silo-Server/silo-server#4639, Silo-Server/silo-server#4640, Silo-Server/silo-server#4641, Silo-Server/silo-server#4642, #1010, #1012, #1013, Silo-Server/silo-apple#1237, Silo-Server/AetherEngine#30

Other clients: Apple Silo-Server/silo-apple#1237; Roku N/A (Roku sends no bandwidth estimate source and learns no limit); Web Silo-Server/silo-server#4643

Once a plan had played, every stall that lowered quality told the server bandwidth_estimate_source: "observed_rebuffer", and the server records that as this device's learned bandwidth limit on that connection. A stall caused by the server producing media slower than real time (a slow encoder, subtitle burn-in, a remote node starting) was reported the same way, so later playbacks on a fine connection started at lower quality, labelled "Auto · limited after buffering".

This change keeps lowering quality on such a stall but reports a slow link only when the transfer was measurably slow.

Approach

The lowering still goes out on any counted stall, since a smaller output also helps a slow encoder. It carries observed_rebuffer, and with it observed_throughput_kbps, only when the controller's existing slow-link evidence holds: the playback throughput meter shows the plan's media arrived more slowly than its delivered bitrate. The meter times transfer from each request's first byte and ignores requests that received for under a second, so segments that waited at the server and then arrived in a fast burst are no evidence. Without evidence the step-down estimate goes without a source: the server plans under it and does not record it. The start-deadline lowering already required this evidence and is unchanged.

The playback architecture note in docs/playback/ now describes when the source is sent.

Pairs with Silo-Server/silo-server#4640 (the server side of the same report), Silo-Server/silo-apple#1237 (the same client change for Apple) and Silo-Server/AetherEngine#30 (timing relayed segment bodies from first byte to last).

Validation

  • ./scripts/test-check-build-supply-chain.sh and ./scripts/check-build-supply-chain.sh: pass.
  • ./gradlew testDebugUnitTest: pass, including a new controller table test (a stall after the first play lowers in both Always and Ask modes, and claims a slow link only with measured slow transfer).
  • :android-shared:lintDebug :androidApp:lintDebug :androidTvApp:lintDebug :androidApp:lintVitalRelease :androidTvApp:lintVitalRelease: pass.
  • :androidApp:assembleDebug :androidTvApp:assembleDebug: pass.
  • Review fix (36c881d, 2427cd0): the replan builder drops observed_rebuffer when the plan's reading is gone at build time, as after a network change. aLoweringWhoseReadingIsGoneWhenSentClaimsNoSlowLink fails on 9623931 and passes on the head. The controller table test fails on main's code (1 of 27) and passes here.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-android/pr-1011/

No screen changes: the lowering and its notice behave as before; only what the request tells the server changes. Results, from ./gradlew :shared:testDebugUnitTest on this branch (head 9623931):

BufferingQualityControllerTest  tests="27" failures="0" errors="0"
  after the first play a stall lowers, but claims a slow link only with measured slow transfer
    slow transfer measured                         -> quality_change auto 44100, source observed_rebuffer
    no transfer timed                              -> quality_change auto 44100, no source
    media arriving above the delivered bitrate     -> quality_change auto 44100, no source
    an accepted prompt without evidence            -> quality_change auto 44100, no source
    an accepted prompt on a slow link              -> quality_change auto 44100, source observed_rebuffer

On main every row sends observed_rebuffer.

Risks

A real slow link whose throughput the meter cannot time (every request receiving for under a second) no longer teaches the server a limit; the lowering still happens for that playback. Progressive delivery reads held-open requests as slow, so a server-paced stall there can still be reported as the link, 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 says there is none.

Council review

Rounds: 2, last reviewed 36c881d (2427cd0 after it changes only tests and docs)

Member Round 1 Round 2
Sol (gpt-6.2-sol, xhigh) 6/10 8/10
Opus (claude-opus-5-5, high) 8/10 8/10
Gemini (gemini-4-neon, xhigh) 5/10 8.5/10

No screen changes, so no visual review.

Fixed: the slow-link claim no longer outlives its reading between the controller's decision and the request build; the session-manager tests cover a sourced lowering again; the playback note gains the network-change and progressive limits and the 24-hour lifetime. Answered: a build-time reading above the delivered bitrate still learns only the step-down estimate. Left for maintainers: progressive delivery's evidence, and a resend after a network change.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code, Codex CLI (review only)
  • Model(s): claude-opus-5-5 (author and reviewer); gpt-6.2-sol and gpt-6.2-astra via Codex CLI, Claude Fable 5.2 (reviewers)
  • Involvement: Fully AI-generated, human verified
  • Council review: see Council review above. Earlier, a four-model review (Sol, Astra, Opus, Fable) of the branch diff found no correctness issues. Fixed: the playback note still said every lowering sends observed_rebuffer; a repeated inline comment was trimmed; a meter-plus-controller test that repeated existing meter tests was dropped. The Web parity gap is filed as above.

Note

Send observed_rebuffer source only with slow-transfer evidence in lowering replans

  • A stall now reports a slow link only when the playing plan's measured transfer was slower than its delivered bitrate. A server-side media-production wait is not treated as link-time evidence.
  • BufferingQualityController gates the observed_rebuffer source on slowLinkEvidence(plan) while keeping the step-down estimate. PlaybackSessionManager captures the playing plan's throughput only when the source is observed_rebuffer and drops the source when no reading is available.
  • Updates tests in BufferingQualityControllerTest.kt and PlaybackSessionManagerBufferingQualityTest.kt, and revises the architecture doc.
  • Behavioral Change: a lowering replan still carries its bandwidth estimate but may omit the observed_rebuffer source and observedThroughputKbps fields.

Macroscope summarized 2427cd0.

…vidence

Once a plan had played, every stall that lowered quality sent its
step-down estimate as bandwidth_estimate_source observed_rebuffer, which
the server stores as this device's learned limit for 24 hours. A stall
caused by the server producing media slower than real time (a slow
encoder, subtitle burn-in, a node starting) then lowered every later
playback on that connection, although the link was fine.

The lowering still goes out on any counted stall, since a smaller output
also helps a slow encoder. It carries observed_rebuffer, and with it
observed_throughput_kbps, only when the playback throughput meter shows
the plan's media arrived more slowly than its delivered bitrate. The
meter times transfer from each request's first byte and ignores requests
that received for under a second, so segments that waited at the server
and then arrived in a fast burst are no evidence. Without evidence the
step-down estimate goes unsourced: the server plans under it and never
records it.
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 30144760-c98a-4034-b5a5-f3f12129e240
Commits

Reviewing files that changed from the base of the PR and between 1b4732d and 2427cd0.

Files selected for processing: 5

  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionManagerBufferingQualityTest.kt
  • docs/playback/01-media3-only-player-architecture.md
  • shared/src/commonMain/kotlin/org/siloserver/silo/domain/player/BufferingQualityController.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/domain/player/BufferingQualityControllerTest.kt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@silo-triage silo-triage Bot added bug Something isn't working impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish labels Nov 20, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 20, 2026

Copy link
Copy Markdown

Subsequent Auto playback quality and limited status (shared/src/commonMain/kotlin/org/siloserver/silo/domain/player/BufferingQualityController.kt): Omitting observed_rebuffer when transfer is not measurably slow changes whether the server learns a device bandwidth limit, which can change quality and the “limited after buffering” status on later playback. Evidence is missing for Android phone, tablet, foldable folded and open, and Android TV; add before-and-after captures of the resulting playback state on each device, naming the device and build or commit, plus a recording of the stall-to-next-playback flow.

Suggested fix: No diff; add the requested device captures and recording to the Evidence section, or explain why any device cannot be reached.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@Rhainland

Copy link
Copy Markdown
Contributor Author

No screen changes here: the lowering, its notice and the Auto label behave as before on the stall itself. What changes is whether the server records a limit for later playbacks. That depends on the server-side learning in Silo-Server/silo-server#4640 and on a stall the server causes, which a capture cannot pin down. The Evidence section has the controller results for each case instead.

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 9623931. The controller change is right and sits at the right boundary. One medium defect is left where the request is built, plus a doc nit; I'm fixing both on this branch. A summary with scores follows.

🤖 Claude Code (claude-opus-5-5)

The controller decides observed_rebuffer from one meter reading, but the
request is built later and reads the meter again. When the default network
changed in between, the meter has no reading and the request still claimed a
slow link, so the server learned the old network's stall against the new
connection. The builder now keeps observed_rebuffer only with the reading it
sends; otherwise the estimate goes out alone and still lowers.

Also note the network-change and progressive-delivery limits in the playback
note, and correct its learned-limit lifetime to 24 hours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

The harness defaulted to no plan reading, so after the send-time check its
lowerings went out unsourced and the resend and kept-estimate tests no longer
covered a sourced lowering. Default the harness to a reading, and check that a
resend keeps observed_rebuffer. Also widen the playback note's progressive
caveat to buffer-full pauses and rewrap the paragraph.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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 settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Nov 22, 2026

Copy link
Copy Markdown

Next-playback quality after a network change (android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt): The new request-time guard prevents a stale slow-link reading from being learned on a changed connection, which can change the quality and “limited after buffering” status on the next playback. The Evidence section reports controller/request tests, but does not show this resulting playback behavior. This shared player path reaches Android phone, tablet, foldable folded and open, and Android TV; add a recording of the stall-to-next-playback flow and before-and-after captures for each device, with device and build or commit details. The earlier explanation that a capture cannot isolate server-side learning does not show the resulting state for this newly added network-change case.

Suggested fix: No diff; add the requested evidence or explain why any device cannot be reached.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@Quick104

Quick104 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: 2427cd0 (council round 2 on 36c881d; 2427cd0 changes only tests and docs).

Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)

Fit. This fixes a real problem at the right boundary. A stall the server caused was being learned as this device's bandwidth limit for a day, which lowered every later title on a fine connection. The shared controller now claims a slow link only on measured slow transfer. The lowering itself still happens, and a smaller output helps a slow encoder too. It changes no wire fields and adds no settings. It follows the slow-link rules in silo-server#4640, and the Apple change is silo-apple#1237.

Readiness. The PR's controller table test fails on main's code (1 of 27) and passes here. The one defect the review found is fixed on this branch, with a test that fails on the original head. What's left is older behavior in the throughput meter and the resend path, outside this diff and listed below for the maintainers.

Addressed

  • The slow-link claim could outlive its reading (medium), fixed in 36c881d. The controller chose observed_rebuffer from one meter reading. The request was built later, behind the phone's replan coroutine or the TV's subtitle transaction, and read the meter again. After a network change in that gap the meter has no reading, but the request still claimed a slow link, and the server would have learned it against the new connection. The builder now keeps the claim only with the reading it sends; the estimate still lowers. aLoweringWhoseReadingIsGoneWhenSentClaimsNoSlowLink fails on 9623931 and passes here.
  • Session-manager tests (low), fixed in 2427cd0. After that fix, the test harness's default of no reading turned its lowerings unsourced, so the resend and kept-estimate tests stopped covering a sourced lowering. The harness now defaults to a reading, and the resend test checks the source survives.
  • Playback note (nit). §3.6 now gives the network-change rule and the progressive limit, and the learned-limit lifetime reads 24 hours instead of 7 days.

For the maintainers

  • Progressive delivery's evidence. The meter counts pauses inside a request, including a full buffer holding a progressive request open. On direct play or a progressive remux, a stall that wasn't the link's can still read as slow, and silo-server#4640 never judges a progressive remux as encoder-bound. This is older meter behavior and the PR body discloses it; main sends observed_rebuffer on every lowering, so this PR doesn't make it worse. Options: claim no slow link on progressive plans, give the meter an evidence reading that ends a span at read gaps, or accept it for now. A follow-up for the second option looks right.
  • A resend after a network change. When the first replan POST never reaches the server and the device reconnects on another network, the resend carries the original sourced body under the same request ID, so the old reading can be learned against the new connection. This is older behavior and needs a protocol choice, since changing the body under the same ID is a conflict.
  • Smaller meter gaps, unverified and older than this PR: an open request under a second can carry bytes across a plan's count reset, and the meter's network check compares only the default network handle, not VPN or local-route changes.
  • A build-time reading that has risen back above the delivered bitrate still goes out with the claim; the server learns min(estimate, observed), which is the step-down estimate either way.

Checks

  • Validated features: not run. This review's token lacks the read:project scope the validation board needs.
  • User manual: affected. "If playback keeps buffering" on the Watch movies and series page and "Lower quality when buffering" on the Preferences page say Silo remembers the slower speed after any lowering. After this PR and silo-server#4640, it remembers only a measurably slow connection. I recommend a siloserver.org issue for those two passages; siloserver.org#432 edits the same paragraph for a related rule.
  • Apple/Android parity: paired with silo-apple#1237, and both clients now send the source only with a reading for the same plan. Apple also checks the device's whole receive rate before claiming a slow link, which Android has no equivalent of. Android's meter covers the player's media requests but not sidecar subtitle downloads. That gap is small and older than this PR.
  • Live verification: not run. The change is in request fields, not on screen, and the fix covers a window between two reads that a sandbox can't stage reliably; the tests above are the proof. Evidence: https://evidence.siloserver.org/r/silo-android/pr-1011/

Council

Member Round 1 (9623931) Round 2 (36c881d)
Sol (gpt-6.2-sol, xhigh) 6/10 8/10
Opus (claude-opus-5-5, high) 8/10 8/10
Gemini (gemini-4-neon, xhigh) 5/10 8.5/10

All three found the split read in round 1, and all three marked it resolved in round 2. Their remaining points are the maintainer items above.

🤖 Claude Code (claude-opus-5-5)

@Quick104
Quick104 merged commit 878c972 into Silo-Server:main Nov 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants