Add reload cap and visibility backoff to buffer monitor (release)#33
Merged
Add reload cap and visibility backoff to buffer monitor (release)#33
Conversation
9a6acbe to
ab43bbc
Compare
Inspired by TTV-AB v5.1.4 stability improvements: 1. One-reload-per-recovery cap: after buffer monitor escalates to a player reload once, subsequent buffer fixes stay on pause/play until playback resumes healthily. Prevents reload cascades during persistent stalls. The recoveryReloadUsed flag resets when playback advances. 2. Visibility-aware poll backoff: when document.hidden is true, poll 5x slower (5s instead of 1s). Reduces background CPU on multi-tab users. Returns to normal poll rate on next tick after visibility restored. Graduating from testing scripts to release. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ab43bbc to
a53f019
Compare
After initial sizing, 5x delay gives 4s worst-case stall detection on hidden tabs. Tuning to 3x keeps CPU savings meaningful (~67% fewer monitor iterations vs ~80% at 5x) while reducing worst-case delay to 2s, which stays below the user-perception threshold for "something broke" (typically ~3s). Better trade for users with background audio streams — 2-3s silence window on stall instead of 4-5s. Chained off feat/reload-cap-visibility-backoff — merge that first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tune visibility backoff from 5x to 3x
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.
Inspired by TTV-AB v5.1.4 stability improvements:
One-reload-per-recovery cap: after buffer monitor escalates to a player reload once, subsequent buffer fixes stay on pause/play until playback resumes healthily. Prevents reload cascades during persistent stalls. The recoveryReloadUsed flag resets when playback advances.
Visibility-aware poll backoff: when document.hidden is true, poll 5x slower (5s instead of 1s). Reduces background CPU on multi-tab users. Returns to normal poll rate on next tick after visibility restored.
Graduating from testing scripts to release.