Repository navigation
Bound the player's text prewarm drain by time, not string count - #376
Merged
Merged
Conversation
…ve queue first The drain was bounded by string count (eight live, one background), but a string costs 1-3 ms on the television, so one presenting frame spent warmdrain:22.7 at playback start (total 34.9), warmdrain:15.8 at 0.0 s and warmdrain:9.8 on the track menu's open frame. The drain now takes a microsecond clock (the product passes the heartbeat clock, host tests a counted one) and spends at most PREWARM_BUDGET_US, always at least one string; the parked other-tab queue only gets what the live queue leaves. Strings left over are rasterised by the draw on demand, as before prewarm. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 1, 2026
… back-buffer-wait capture showed (#377) The first TV run read the non-consuming `trace` file, which re-walks the ring on every read on the 4.4.84 kernel: 3.3 s of data took about nine minutes, the ring had overrun, a third of the events were arch-timer noise and no syscall events were enabled for the analyser. The read-back now drains trace_pipe on the set (gzipped there), ends when the per-CPU stats show an empty buffer, and is bounded on the host by --read-timeout (default 90 s); a stopped read-back keeps what arrived as a valid gzip. Entries and overrun are printed per CPU. The arch timer is filtered out of the irq events (string filter, falling back to irq numbers). The ring is sized for the capture and capped at 32 MB. --tid N enables raw_syscalls for that thread. Restore clears all of it. tools/test_tv_sched_trace.py drives the script against a fake tracefs and a fake tv-ssh and is wired into check-python. docs/player-submenus.md replaces the "next TV session" plan with the results: the GPU is idle during the long waits; osd_irq paces commits at 8.33 ms; 29 of 31 steady-state waits of 18 ms or more followed an on-time commit and are the compositor's, 2 followed platform threads preempting the frame thread; the text prewarm drain was unbounded (fixed in #376); the #372 preload did not drop a frame; WAYLAND_DEBUG printed nothing on this firmware. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 2, 2026
A simplify pass over #376 and #377, with the review follow-ups from #376. The background prewarm drain now runs only when the live drain leaves at least BACKGROUND_MIN_US (1 ms) of the 2.5 ms budget, so a sliver does not buy a whole parked string; a host test covers the sliver and the empty-live-queue case. Stale "one string a frame" and "six-millisecond" comments in text.rs and track_menu.rs describe the time-budgeted drain. tv-sched-trace.sh defaults to --secs 6 (the measured loss-free length on the 4.4.84 kernel), its usage() prints the usage line, and the ring sizing names its event rate and size. Its test has one env builder, one clock constant and one ps per pid. docs/player-submenus.md agrees on the default and records the measured effect of #376. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What
The player's text prewarm drain (
PanelMotion::drain_queued_text) was bounded by string count only: eight live strings per presenting frame. A string costs 1–3 ms on the television, so one drain could take most of a frame or more. The drain is now bounded by time:PREWARM_BUDGET_US= 2.5 ms per presenting frame, with a floor of one string so the queue always advances.app/run.rs(heartbeat::now_us); nothing underui/reads the wall clock.ClockWarmis a client of the same queue and falls under the same budget.Measured on the television (2026-10-02, guest profile, mock server, player with the track menu opened by the
menu=1trigger)warmdrainon the menu-open frameNot fixed: one frame about 1.1 s after playback start still spends 18.9 ms in the drain (22.7 ms before). It is a single string, so the one-string floor admits it whole; which string, and why it costs that much, was not investigated.
This does not change the steady-state back-buffer waits. The same capture session showed those follow an on-time commit in 29 of 31 cases and the GPU is idle while the frame waits; the write-up is in the tooling PR.
Verification
ui::panel_motion::tests::a_drain_stops_at_its_time_budget_and_the_rest_carries_over_live_first, red before the change withframe 1 rasterised 7, budget admits 3.make checkon the committed tree:test result: ok. 5447 passed; 0 failed; 7 ignored,test result: ok. 102 passed; 0 failed,test result: ok. 5527 passed; 0 failed; 7 ignored.cargo +nightly check --lib --no-default-features: rc=0. ARM cross-build: rc=0.🤖 Generated with Claude Code