Repository navigation
fix(tv): make the seek rate mean what the chip says, and reach the end - #209
Conversation
…ing away Hold-to-seek advanced 2.0 seconds of content on every 100ms tick, so the rate on the chip was a twentieth of the truth: "8×" moved at 160× real time, and the top speed of "32×" moved at 640×, crossing a 45-minute episode in four seconds. That is the whole reason it felt ungovernable rather than merely quick — the viewer aims with the number on screen, and the number was wrong by 20×. A rate is now exactly its own multiple of real time: rate × tick seconds per tick. 8× means 8×. Two things fell out of fixing that. The ramp reached the top speed after three seconds of holding, so a press meant to nudge forward a few seconds crossed the scene; the milestones are now 1.5s / 3s / 5s. And a sustained hold now stops at 16× — reaching 32× takes a deliberate repeat-press, so holding cannot fall into the fastest speed by accident. 1× is dropped from the ladder. It scans at exactly playback speed, so the first press looked like nothing had happened. Speeds and ramp move into TvSeekRateLadder as pure functions, and the test asserts the property that was violated: a rate advances exactly that multiple of real time. A magic multiplier in the tick now fails a test instead of shipping another chip that lies. Verified: :androidTvApp:testDebugUnitTest 983 tests, 0 failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The honest-rate fix made the labels true but left a fixed 32x ceiling, and a fixed ceiling cannot serve both ends of this control. Nudging past an intro wants single digits. Reaching the end of a 45-minute episode at 32x takes 84 seconds of holding, and a three-hour film takes five and a half minutes — that is not a seek. The top of the ladder now comes from the item's runtime, targeting about ten seconds to cross the whole thing: 22-min episode 256x 5.2s to cross (was 41s) 45-min episode 512x 5.3s (was 84s) 90-min film 1024x 5.3s (was 169s) 3h film 1024x 10.5s (was 338s) The ramp follows from the same place: it keeps doubling every 900ms until it reaches that item's ceiling, so a long film goes on accelerating past the point where a short episode has already topped out. Reaching the top takes 6-8s of deliberate holding, and the first step is still 4x, so the aimable half of the control is untouched. An unknown runtime falls back to 32x rather than guessing — live content and un-probed files both arrive as zero duration. Two corrections to the previous commit's tests. The traverse assertion caught a real bug: 512x was too low a cap for a three-hour film, which crossed in 21s against a 10s target, so the cap is 1024x. And the reverse-bump test asserted semantics the key handlers do not use — delta is a direction along the signed ladder, not "faster" — so it now pins the property that actually matters: a bump never crosses zero and flips direction mid-seek. Verified: :androidTvApp:testDebugUnitTest 985 tests, 0 failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Warning Review limit reached
Next review available in: 11 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The ceiling is derived so STEADY-STATE crossing lands near TRAVERSE_TARGET_SECONDS, but a hold does not start at the ceiling — it doubles every 900ms to reach it, and the early rungs cover almost nothing. A three-hour film spends 8.1s ramping and covers only ~920s of itself in that time, so the real cost is ~17.8s, not the ~10.5s the docs claimed. The test claimed to check this and could not: it computed duration / topRate, arithmetic the implementation never performs, so it reported 10.55s against a 15s tolerance and passed while the real behaviour was 17.75s. TvSeekRateLadder.traverseSeconds now models the ramp the code actually runs, the test asserts against it, and the documentation states the honest envelope: ~10.6s for a 22-minute episode to ~17.8s for a three-hour film. The property worth keeping is the SPREAD — under 2x across runtimes, versus 41s vs 338s before the ceiling was derived — not the absolute number, and that is now what is asserted. Mutation-checked: changing the ramp cadence fails it. Also pins the unknown-duration case. Protocol v3 (#200) declares duration server-side and deliberately refuses a Media3/catalog fallback, so an omitted duration now reaches the ladder as 0 and lands on MIN_TOP_RATE. That is more reachable than it was before v3, so it is worth a test. androidTvApp 1003 -> 1005, all green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
c84a8b6 to
e0e3830
Compare
The header still described the fixed ceiling this branch replaced. The rate now doubles to a runtime-derived ceiling — 256x for a 22-minute episode, 1024x for a feature — which is the whole point of the change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Reported from use: fast-forward "accelerates so it can get insanely fast".
The chip was lying by a factor of 20
Hold-to-seek advanced
2.0seconds of content on every 100 ms tick. The rate shown on screen was the multiplier in that expression, so it was a twentieth of what actually happened:That is why it felt ungovernable rather than merely quick: you aim with the number on screen, and the number was wrong. A single tick at the top rate covered 64 seconds of content, so there was no way to land near a target. The slowest rate available was still 20× real time, so there was no gentle speed at all.
A rate now advances exactly that multiple of real time —
rate × tick. 8× means 8×.A fixed ceiling cannot serve both ends of this control
Making the labels honest exposed the other half. Nudging past an intro wants single digits; reaching the end of a three-hour film at a fixed 32× takes five and a half minutes of holding.
So the top of the ladder is derived from the item's runtime, targeting ~10 s to cross the whole thing:
The ramp follows from the same place: it keeps doubling every 900 ms until it reaches that item's ceiling, so a long film goes on accelerating past the point where a short episode has topped out. Reaching the top takes 6–8 s of deliberate holding and the first step is still 4×, so the aimable half of the control is untouched. An unknown runtime falls back to 32× rather than guessing — live content and un-probed files both arrive as zero duration.
1×is dropped from the ladder: it scans at exactly playback speed, so the first press looked like nothing had happened.Structure
Speeds and ramp move out of the composable into
TvSeekRateLadderas pure functions, and the test asserts the property that was violated — a rate advances exactly that multiple of real time. A magic multiplier in the tick now fails a test instead of shipping another chip that lies.The property test earned its place immediately: it rejected a 512× cap, which left a three-hour film taking 21 s to cross against a 10 s target. The cap is 1024×.
Verification
:androidTvApp:testDebugUnitTest— 986 tests, 0 failures (9 new).Built as a telemetry APK and exercised on a Google TV Streamer; the reporter confirmed the feel. The device pass is what set the target — an earlier revision of this branch was correct but too slow to reach the end, which is what the runtime-derived ceiling fixes.