Skip to content

Simplify the prewarm drain budget and the sched-trace tool (#376, #377 follow-up) - #382

Merged
GLinnik21 merged 2 commits into
mainfrom
simplify/prewarm-drain-and-sched-trace
Oct 2, 2026
Merged

GLinnik21 merged 2 commits into
mainfrom
simplify/prewarm-drain-and-sched-trace

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

What

A simplify pass over #376 and #377, plus the review follow-ups from #376.

Prewarm drain (rust-modules/src/ui/panel_motion.rs)

  • The background (parked other-tab) drain now runs only when the live drain leaves at least BACKGROUND_MIN_US (1 ms) of the 2.5 ms budget. Before, a live drain ending at 2.4 ms left a 100 µs remainder, and the at-least-one-string floor still charged a whole background string (1–3 ms on the television) to that frame.
  • New test a_sliver_of_budget_left_by_the_live_queue_skips_the_background, seen failing first (the background took a string with 100 us left, left: 2, right: 1). It also checks that the parked queue still drains when nothing live is queued.
  • Comments that still said "one string a frame" (track_menu.rs, text.rs) and "six-millisecond caller budget" (text.rs) now describe the time-budgeted drain.

tools/tv-sched-trace.sh

  • --secs defaults to 6, the measured loss-free length on the 4.4.84 kernel (8 s overran CPU 0's ring).
  • usage() printed the header's title and a blank line; it now prints the usage line.
  • The ring sizing names its event rate and event size instead of repeating 60000 * 64.

tools/test_tv_sched_trace.py: one env builder, one clock constant, one ps per pid, one redundant assertion removed.

docs/player-submenus.md: agrees on the 6 s default and records the measured effect of #376 (open frame warmdrain 9.8/6.6 ms → 3.3/3.2 ms; one single-string 18.9 ms drain at about 1.1 s after playback start remains).

Verification

  • make check on the Rust commit: test result: ok. 5448 passed; 0 failed; 7 ignored, test result: ok. 102 passed; 0 failed, test result: ok. 5528 passed; 0 failed; 7 ignored. cargo check --lib --no-default-features exit 0. Both ran before the rebase onto CI: bound every job, apt refresh and download (no more multi-hour hangs) #375 (CI-only changes); CI here covers the rebased tree.
  • make check-python on the tools commit: every suite OK; bash -n and shellcheck clean on the script.
  • Not run on the television: the 1 ms rule is covered by the host test only.

🤖 Generated with Claude Code

GLinnik21 and others added 2 commits October 2, 2026 02:52
…llow-up)

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" 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) and its usage line now prints
the usage. docs/player-submenus.md agrees on the default and records the
measured effect of #376.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… pid; name the ring-sizing event rate

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 26c235d into main Oct 2, 2026
9 checks passed
@GLinnik21
GLinnik21 deleted the simplify/prewarm-drain-and-sched-trace branch October 2, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant