Skip to content

HUD plugins: one renderer for the compact HUD, Up Next and Skip; builtin:classic draws through it - #1154

Merged
GLinnik21 merged 27 commits into
mainfrom
hud/pr7-render
Oct 30, 2026
Merged

GLinnik21 merged 27 commits into
mainfrom
hud/pr7-render

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

PR7 of the player-HUD plugin series (docs/hud-plugins.md, "PR breakdown"). The player's compact HUD (the scrim, title, control row, bar, clocks and tabs), the Up Next card and the Skip pill used to be arranged and drawn by hand-written code in player_hud/classic.rs. They now draw through ONE renderer, player_hud::render, that walks the compiled draw list of a HUD package. builtin:classic is embedded once (hud_format::CLASSIC_PACKAGE), compiled once per process at boot, and draws pixel-identically to what main draws (identity table below). The hand-written arrangement is deleted, so there is no second path to keep in step: geometry (focus, pointer stops, the caption band, the overscan audit, both player menus' anchors) comes from the same compile.

A dev trigger, plxnative-hud=<path> (under devtriggers), compiles and draws a package from a file instead of classic; the reference package's compact state renders under it in the simulator and on the TV.

The widget extensions

Every one is additive, with the old entry point delegating to the new one over classic's own values, so no other caller's frames change (the trailer's three calls, draw_scrim, draw_title, draw_playbar, are untouched and their pins are unedited):

  • TransportButton: rest_face(Film | Bare | Solid) and focus_face(Accent | Ring), defaults Film/Accent; .svg(Svg) draws a package glyph in the disc's glyph box. icons.rs keys its cache by Builtin(Icon) or Package(source hash).
  • classic::PlaybarLook (track, fill, ink, clock size, knob tick|always, clocks follow_head|ends, mark), TitleLook (positions and sizes) and draw_scrim_at; draw_playbar, draw_player_title and draw_scrim delegate with the defaults. A test pins draw_playbar equal to draw_playbar_look(default).
  • up_next::draw_over over a Layout and skip_pill::draw_at(rect): the drawing half, so the renderer places and the widget paints.
  • HudModel gained skip_secs and stats (sampled by the app), so the draw reads the model and not the app's state. It is not global-free: tab_labels reads the process's language through i18n::current().
  • The geometry report widened past five buttons (HudGeometry::items is MAX_ROW_ITEMS = one segment's bound, two ci/list-caps.ini rows); RowPop likewise.

Where the app compiles classic now

src/app/run.rs::boot_hud is called once from app/boot.rs, before the App literal and outside any frame: it compiles builtin:classic for the current language with the bridge's measurer and seeds the player page's mounter (AppMounter.player_compiled), so PlayerScreen::new(entry, Arc<Compiled>) takes its compile as a constructor argument. The compile runs once per process: a language change cannot recompile it, because plx_platform::i18n's current language is a OnceLock and the saved preference is the "confirmed next-launch setting". refresh_hud runs in prepare_window, inside the frame iteration, and compiles only when boot did not (a controlled run) or for a plxnative-hud=<path> package; the frame that does it pays the compile. Once App.hud is set it does nothing. (An earlier revision of this body, and the code comments, said a language change recompiles outside the frame; both were wrong, and the dead language arm is removed.)

The boot compile is gated if !controlled: a controlled replay or record run has a measurer that answers only the keys its recording holds, and measuring before the recorder's resources exist latches a failure for the whole run. No replay or record fixture reaches the player (nothing under tests/fixtures/replay/ changed); the first player frame's refresh_hud compiles and reseeds, inside that frame. Normal and host-test builds compile at boot.

The deletions

classic::draw_hud, frame_geometry, geometry, tab_hit_rect, icon_hit, scrub_hit_rect, btn_x, title_right, ctrl_slot*, draw_tabs and their helpers; ControlSlot::item_rect, Controls::rect; skip_pill::rect/draw; up_next::layout, layout_peek, layout_of and the measuring draw; HudMotion::widths; and the fallback itself (PlayerScreen::compiled: Option, the screen's classic arms, the Option<&Compiled> parameters of geometry.rs). Before the title function went, its values were frozen as classic-title-right.golden.tsv (84 cases) beside classic-geometry.golden.tsv (320) and the census (1480), and the title tests grade the compile against them.

classic.rs measured by content, not by a diff stat: 44038 non-space bytes (1151 lines) before the cut, 31156 (795 lines) after, -12882. No file was deleted or renamed.

The compiler fix the TV found

On the TV, the reference's More disc was drawn over the remaining clock. Cause: the clocks sit one line under the bar, but the compile reserved no height for that line, so the next band landed on it, and the lint passed the reference because the compile emitted no rect for the clocks. Fixed in the compiler, with the red test first: the compile now emits both clock rects where draw_clock draws them (hud_format/clocks.rs), the bar's cell is CLOCK_TOP + clock_line_h(size) tall, and the lint (I4, I10) reads the clocks as app text. To keep classic exactly where it was, its tabs band's gap_before went from 59 to 7 (the bar's cell grew by 52 px; classics_tabs_gap_is_the_distance_left_after_the_clocks_line derives the number from the constants). Also found on the TV: the reference's back10 and fwd30 drew two bars where their digits should be; they now draw real 1, 3 and 0 outlines (a 0 with a counter wound the other way), with a test that pins them. The owner then found the back-10 arrow wrong: its outline closed at the wrong point, so the arrowhead collapsed into a sliver, and its ring was centred on (12,13) while forward-30's was on (12,12). back10 is now the exact mirror of fwd30 about x=12 (M12 1v2a9 9 0 1 1-9 9h2a7 7 0 1 0 7-7v3l-4-4z), both rings are centred on (12,12) with inner radius 7, and the digits moved up one unit (y 8..16) so each pair is centred in its ring. A test compares the two outlines as mirror images and was run red against the old art first; all four copies of the assets (fixtures/reference.plxhud.json, site/hud/examples/reference.plxhud.json, docs/hud-plugins.md, EXAMPLE_ASSETS) carry the same strings. Reviewed in the simulator at 12x: two matching, mirrored arrows with centred digits (ref-digits-zoom.png).

The review round also made the reserved clock line a whole number of pixels: clock_line_h was unrounded (a 26 px clock gave 32.5, a 22 px one 27.5), which put every band above the bar on a half pixel; it now rounds up, and classic's 30 does not change.

Pixel identity, in the simulator

BEFORE is main at 8b634f4 (origin/main has not moved), AFTER is this branch at eb13ec9 (the review round's code is at bed3bc127; eb13ec98e changes only ci/build-budgets.json); both are the simulator frame dump against tests/mock_pms.py (mock only), a frame hash per settled virtual frame, the same storyboards in both. The hash is sha256 of the frames' xxh3 column.

Columns: frames is the number of settled frames in BEFORE / in AFTER; old BEFORE is the same storyboard's hash from the stage 2 run on the earlier main, new BEFORE is the stage 3b run on 8b634f436 (it stands: main has not moved, and its simulator binary, md5 d90d42603d5454fb92acc3a2d60c2c11, is the one that run used), new AFTER is this round's run on the final code (run names after-g-*, simulator md5 de9536fc3b0b32ee170dbbb88f491b2d); the last column asks whether BEFORE reproduces the stage 2 value.

state frames old BEFORE new BEFORE new AFTER BEFORE = AFTER new BEFORE = old BEFORE
probe1 60/60 545d72b18308 545d72b18308 545d72b18308 identical yes
movie_final 800/800 a1051beef121 a1051beef121 a1051beef121 identical yes
movie 800/800 f86e694371bb f86e694371bb f86e694371bb identical yes
episode 680/680 f333cd36c9a4 f333cd36c9a4 f333cd36c9a4 identical yes
upnext_pre 420/420 387607a4e637 387607a4e637 387607a4e637 identical yes
skip-intro 420/420 2abc1d56fa53 2abc1d56fa53 2abc1d56fa53 identical yes
skip-credits 420/420 bd0ea5801b26 bd0ea5801b26 bd0ea5801b26 identical yes
paused 400/400 5c7fecd3c4a8 5c7fecd3c4a8 5c7fecd3c4a8 identical yes
menus 760/760 68bcde1f6434 68bcde1f6434 68bcde1f6434 identical yes
failure 320/320 f80c21c1a09a f80c21c1a09a f80c21c1a09a identical yes
ep-first 480/480 0aa5fed3af10 0aa5fed3af10 0aa5fed3af10 identical yes
ep-last 480/480 0aa5fed3af10 0aa5fed3af10 0aa5fed3af10 identical yes
upnext_spin 160/160 ed9d43ed60c9 ed9d43ed60c9 ed9d43ed60c9 identical yes
chapters_b 112/112 a934b965d714 a934b965d714 a934b965d714 identical yes

All 14 storyboards are identical frame for frame, every settled frame, in the two builds (cmp.py: differ 0 for each). ep-first and ep-last are the failure read-out of two different episodes and draw the same frames, as they did in stage 2. upnext_spin is the Up Next card with a Left press on frame 40 (a scrub that fades the chrome), pressed through the remote FIFO.

chapters_b has a known real-time flake at frame 102 of 112, and it did not occur in this run (112/112 agree). The frame is the clock readouts (1963 px inside (954,868)-(1822,943), largest channel step 233) of a seek that lands in real time; it is not the HUD, because the SAME binary produces both values: stage 3b's eight runs gave BEFORE 864a23 / 1b64f5 / 864a23 and AFTER 1b64f5 four times and 864a23 once (frame 102's xxh3, first six hex digits). This round's one AFTER run drew the BEFORE value. The classification stands; the table is not evidence that the flake is gone.

The stage 3b BEFORE hashes equal the stage 2 ones in all 14 rows, so the earlier merge of #1159 changed no player frame, and nothing came in since.

TV

The captures below were taken on earlier heads: the classic identity on cf5b90949, the reference on cf5b90949 and again on 93fc5091d (the clock line fix). The deletion commits came after those captures, and the classic frames on the final head are covered by the simulator table above. On the final head eb13ec98e the reference was captured on the TV again: the mirrored 10 and 30 arrows and their digits are correct, and the row sits below the clocks.

  • Classic, BEFORE (main aef53a3f6) vs AFTER (cf5b90949), paused at 7:18 with the HUD pinned, five states (paused, Subtitles disc focused, Subtitles menu open, More focused, More menu open): identical except the knob (peak 51/255) and the elapsed digits (one pixel), the follow-head clock's snap to a pixel column; AFTER vs an AFTER rerun differs the same way. All of it is inside x 922-977, y 868-937.
  • The reference under plxnative-hud on the TV drew the compact state, with the More disc over the remaining clock: the defect fixed above. On 93fc5091d the row sits a full clock line below the bar, the remaining clock is whole, and every glyph is 18-24 px and unclipped.

TV cost calibration

Measured on the TV on the final head eb13ec98e, ARM_PROFILE=release, against the mock, English, muted. The running binary's md5 was checked on the set. The scene is Sintel paused at 7:18 with the HUD pinned and the Discs focused, about 1,500 steady frames.

GPU cycles per frame (Mali HWCNT, frame.ui). A 60 Hz frame has about 11.2M. The glFinish brackets serialize this leg, so no pacing number comes from it.

HUD GPU_ACTIVE p50 p95 max FRAG_ACTIVE p50 host estimate, blended px
classic 4.38M 4.41M 6.50M 8.63M 934,912
reference 3.82M 3.86M 5.99M 7.51M 837,024

The reference is cheaper than classic because its scrim is smaller, as the compiler's estimate says.

Frame pacing, paused with focus moves and scrub ticks driven by key (FRAMEDROP armed at 20 ms):

run heartbeats lowest fps worst frame frames > 33 ms dropped
classic, fe862db3c 109 59 33.3 ms 1 0
reference, fe862db3c 97 60 33.4 ms 1 0
reference, eb13ec98e, one GRAPHIC capture in the run 114 59 41.4 ms 3 0
reference, eb13ec98e, kernel trace, no capture 68 59 34.5 ms 3 0

Attribution of the late frames:

  • The HUD's own CPU draw (page span) was 0.9-1.3 ms on the three slowest frames of the capture run. The rest was clear, the wait for a back buffer at the first framebuffer command (39.1 ms of the 41.4 ms frame).
  • tools/tv-sched-trace.sh and analyze-sched-trace.py --latch, reference, 6 s with focus moves and scrub ticks: 244 frame pairs, 239 waits of 10 ms or more, every one classed compositor-side (238 on time, 1 two ticks late). On-time margin: the GPU finished 10.38 ms before the compositor's pass at p50, 9.50 ms at p95, 9.03 ms at p99. Tracing loads the set, so these are mechanisms and a margin, not rates.

Not determined:

  • Why the compositor was late. The trace classes the side, not the cause inside surface-manager.
  • The 41.4 and 38.9 ms frames. They appeared only in the run with a capture, but the trace window did not include them, so the capture is not proven to be their cause.
  • Classic's pacing on the final head: its row is from fe862db3c, one fix round earlier. Classic's counters are from the final head.

Not measured: the episode state with the Previous/Next pair and chapters, on either HUD. It was not run on the TV, so that state has host estimates only (11 and 13 ops); PR8's calibration takes it. Cost stays reported, never enforced, so this PR sets no ceiling.

Build budget

Binary size

ci/build-budgets.json's binary_bytes (the stripped ARM binary make ipk FLAVOR=debug stages, default features) failed on the first head: 15,476,360 B against the limit 15,180,000. It is raised in its own commit (eb13ec98e): measured 15,451,784 (CI's armv7 cross-build and artifact assertions row on bed3bc127, the code of this head), measured_on 2026-10-30, limit 17,000,000 (measured + 10%, rounded up to the next 10,000: 16,996,962 -> 17,000,000), "headroom": "10%" as #836 set it. Nothing else in the file changed. The owner accepted the new limit on 2026-10-30. CI on eb13ec98e: | binary_bytes | 15,451,784 bytes | 17,000,000 | 15,451,784 (2026-10-30) | ok |.

What was added. main (8b634f436) measures 15,156,872 B, this head 15,451,784 B: +294,912 B. (The head before the review round measured 15,476,360, +319,488; the round's size savings and removals took 24,576 B back.) The accounting below is nm -S --size-sort -C of a release ARM build, quoted as measured at fe862db3c (no release ARM build of this branch exists on this host; the one under hud-sim-base/pkg/ is main's and has no HUD code), so it is the pre-round figure:

  • hud_format 222,360 B: compile 110,596; parse 74,600; svg_subset 22,216; nearest and edit_distance 4,352; schema 3,472; reach 3,288; Finding 2,616; other 1,220.
  • player_hud 27,428 B: render 15,268; loaded 9,940; geometry 2,220.
  • About 70 KB nm cannot attribute: string data, the schema's Field arrays and unwind tables.

hud_format was dead code on main (nothing in the app called it); this PR makes it live, because the app now compiles builtin:classic at boot and draws every HUD through the compiled list. player_hud is the renderer that replaced the hand-written drawing, which was deleted (classic.rs lost 12,882 non-space bytes), so its figure is the new code and not new behaviour.

Why it cannot be smaller. The lint, the report, schema_emit and hud_cli link 0 symbols: they are not in the binary. What is in it is what the app runs: the parser and the SVG-subset checker stay, because docs/hud-plugins.md:597 makes package input attacker-controlled on the TV and the bytes must be checked there, for every source. The review round took three savings that left Compiled byte for byte the same (the goldens prove it): top (the cost's three heaviest ops, with its sort) is CompiledState::top_contributors(), computed when a report asks, and nothing outside a test reads it today; a Skip state makes its credits layout only when the two pill rects differ; fill_bands orders by partition_point and insert (stable) instead of sort_by_key. The schema's doc strings (12.4 KB, linked because the validator walks those tables) are the named follow-up, tracked in the handoff.

What it cost. main was 23,128 B under the old limit, so this is the PR that crosses it, not the only growth since the baseline of 2026-10-18: main alone grew 13,799,944 -> 15,156,872 B (+1,356,928) since then, and this PR is 294,912 B on top of that.

Tests

Added in this lane. The three compiler-fix tests and the numeral test were run red against the old behaviour first, then green:

  • Compile: the_playbars_clocks_stand_where_the_playbar_draws_them_as_wide_as_the_widest_clock, no_band_under_the_bar_starts_on_the_clocks_line and classics_tabs_gap_is_the_distance_left_after_the_clocks_line (the compiler fix); a_control_carries_the_command_with_its_parameters, a_control_carries_its_face, a_ladder_face_picks_the_viewers_interval_then_its_default, the_focus_face_and_the_playbar_looks_reach_the_draw_list, the_geometry_reports_every_item_of_the_references_row, every_state_tiles_its_ops_with_band_spans; the frozen-value graders over classic-geometry.golden.tsv (320), classic-title-right.golden.tsv (84) and the census (1480).
  • Renderer: classic_through_the_renderer_draws_what_the_hand_written_hud_draws (the renderer's census hash against the frozen one), the_package_faces_reach_the_painter, the_play_disc_wears_the_ring_when_focused, the_bar_keeps_its_knob_and_its_clocks_at_the_ends, a_seek_disc_without_a_duration_draws_disabled, a_failure_read_out_owns_the_frame_in_the_renderer_too.
  • Widgets: the_default_look_is_classics (draw_playbar equals draw_playbar_look(default)), an_always_knob_replaces_the_tick_at_rest, ends_clocks_sit_at_the_bars_two_ends, a_busy_only_mark_draws_the_spinner_and_nothing_else, the_overscan_audit_grades_the_compiled_classic_rects.
  • Player page: the_pointer_stops_and_the_focus_rects_are_the_compiled_packages, the_row_group_is_as_long_as_the_packages_row, the_caption_band_and_the_scrub_mapping_are_the_compiled_packages, the_menu_anchor_is_the_compiled_openers_and_follows_the_held_control, a_press_asks_for_the_command_of_the_control_the_package_placed, a_package_controls_stop_is_its_commands_enabled_predicate, the_row_parks_on_the_primary_control_of_the_package, a_page_on_builtin_classic_places_at_classic, a_package_with_no_state_for_the_frame_answers_the_empty_report; in the app crate a_seeded_menu_anchor_is_mounted_into_the_next_menu_and_only_that_one.
  • Reference art: the_ten_and_thirty_faces_draw_numerals_clear_of_the_ring (three sub-paths per face, a real outline for the 0 with a counter wound the other way, every vertex clear of the ring, and now both digit pairs centred on (12,12) with the extent centred); red against the old two-bar art. the_ten_arrow_mirrors_the_thirty_arrow pins both ring strings and compares back10's commands against fwd30's mirror about x=12; red against the old back10 (its outline closed at the wrong point and its ring sat on (12,13)).
  • Review round, each red first or pinned against the old behaviour: the_clocks_reserved_line_is_a_whole_number_of_pixels_at_every_rung (a non-CAPTION rung gave 32.5), bands_fill_in_z_order_and_equal_z_keep_their_declared_order (the insertion that replaced sort_by_key), a_skip_state_carries_a_credits_layout_exactly_when_its_pill_rects_differ, and the_caption_band_is_classics_in_every_state_the_pins_cover (caption_band() now returns Compiled::band(); the test shows it equals what the old per-frame path returned for classic in every state the pins cover). classic_compact_cost_is_pinned reads top_contributors().

Removed with their subject: the tests of the deleted frame_geometry, geometry, icon_hit, scrub_hit_rect, layout_of and the Option::None classic fallback. Their hit-test content is re-asserted against the real HitMap the compiled geometry produces (a_click_lands_on_the_disc_under_it_and_falls_through_to_the_scrubber_in_the_gaps). The tests that compared against the hand-written side now grade the compile against the frozen files; their expected values are unchanged, only the source they are compared against moved.

Gates

The full gate is CI. What I ran on the committed head, one command at a time, with git status --short empty before and after each (the code is bed3bc127; eb13ec98e on top changes only ci/build-budgets.json):

  • make test-crate C='plx_appkit plx_screens':
    • test result: ok. 760 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 11.55s (plx_appkit)
    • test result: ok. 1792 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 28.53s (plx_screens; its three single-test sub-runs each print test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1791 filtered out; finished in 0.00s)
  • make test-crate C=plxnative-modules: test result: ok. 1116 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 26.85s
  • make test-hostsim: test result: ok. 1249 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 33.93s
  • make check-nodef: Finished \dev` profile [unoptimized + debuginfo] target(s) in 3.33s` (exit 0)
  • make lint (clippy with ifs_same_cond, same_functions_in_if_condition and if_same_then_else denied; the first head failed if_same_then_else at the knob branches in classic.rs, now merged into one condition): exit 0, no warning or error
  • python3 ci/check-list-caps.py: check-list-caps: 303 sites, every one classed: work 97, preview 15, format 46, not-a-list 145, reach(open) 0
  • python3 ci/check-localization.py: Localization inventory: product text boundaries passed
  • python3 ci/check-module-layers.py: check-module-layers: green — 14 layers, 1543 modules, 0 migration entries left in ci/allow/layers.txt, 0 of them into [port webos]; 0 cfg(test) items still named across layers (--report)
  • ci/check-deps.sh: check-deps: all gates green
  • python3 ci/test_shipped_faces.py: Ran 2 tests ... OK; python3 ci/test_ci_workflows.py: Ran 77 tests ... OK

CI on eb13ec98e: every check passed (the armv7 cross-build and artifact assertions job included).

make check and the replay check were not run here; the ARM build is CI's armv7 job (green). The diff touches none of Makefile, Cargo.toml, Cargo.lock, a build.rs, .cargo/, .github/workflows/ or ci/module-layers.ini, so no make build-bench table is owed.

No issue tracks the HUD-plugin work; none was opened for this PR.

🤖 Generated with Claude Code

GLinnik21 and others added 27 commits October 30, 2026 09:17
… the compile carries band chrome, focus faces and the playbar's looks

builtin:classic's bytes are one const (hud_format::CLASSIC_PACKAGE); player_hud::loaded parses and
compiles them for a language (AppLabels from the catalog, a CompileKey of the digest, the release and
the language). The compiled state gains spans (which band each op belongs to and whether that band
fades under a live scrub), ControlRect::focus, and the knob, clocks and mark of the Playbar op.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… write

HudGeometry::items was five stops wide (classic's row) and the compiler's zip dropped every control
past the fifth. It is now MAX_ROW_ITEMS wide, derived from the format's own bound on one segment
(schema::MAX_SEGMENT_ITEMS), with a list-caps row each; a replaced row wider than that is a compile
finding instead of a silent cut. The PR5c test that pinned the limitation now pins the whole row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d, not the current catalog

labels_in(cx) builds the compiler's strings from a LocaleContext argument, and load/load_classic take that context, so the app layer passes the current locale once at compile time and no machine or draw path reads a registry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…pill draw over rects a caller hands them

draw_scrim_at, TitleLook, PlaybarLook, up_next::draw_over and skip_pill::draw_at are the existing draws split at the point where the layout is decided; each old entry point calls the new one over classic's values, so the trailer and the hand-written HUD keep their frames.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rough the shared widgets

player_hud::render walks CompiledState::spans (a fading band on the chrome alpha, a steady one at full alpha, the stand-in right after its host band), draws the scrim, title pair, discs, tabs, Skip pill, Up Next offer and playbar at the compiled rects, and the scrub preview after the bar. A census test pins builtin:classic through it to classic::draw_hud primitive for primitive in all ten languages: it was red on the stand-in's order before the renderer put the stand-in after its host band.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…enderer

The app compiles builtin:classic outside the frame in the viewer's language (recompiling on a language change) and pushes the Arc into the player page next to the HudModel. PlayerScreen::draw_hud draws it through player_hud::render; a page without one, or a package with no state for the frame, draws the hand-written layout (a stage-to-stage bridge, deleted with draw_hud).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e compile owner and the lint

The lint's private labels_in (PR5d) and the loader's public one (PR7) were the same nine
msg::*_in lookups. They are now an associated function next to the type; both callers use it.
A pure move: no behaviour change, the tests that grade either caller are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d package's geometry

PlayerScreen::hud_geometry, the caption band, the scrub mapping, the row group's extent and length and
Focusable::place read the compile's report through ONE helper (player_hud::geometry::{geometry,
frame_geometry,row_len}), which falls back to classic only while the page holds no package or the package
has no state for the frame (the exit the draw takes too). The renderer's state lookup is the same function.

The menu anchor derivation (opener rest rect widened to the segment's outer edge) moves from the lint into
the compile (CompiledState::menu_anchor, segment_align, widen); lint_menus calls it, its pins unchanged.
The overscan audits take the compiled classic's report.

Red first: compiled_geometry_tests builds a classic variant (bar moved, a sixth control) and held the page
to its numbers; it answered classic's rects until the consumers were wired.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ough the mounter

Both player menus took their anchor from classic's constants: the overlay's
default `menu_anchor()` was `classic::frame_geometry().row` whichever package
drew the row. `PlayerScreen::menu_anchor(kind, chapters)` now answers from the
compile: the control the engine holds when its command opens that menu, else
the first control of the state that does, else the replaced row's region (the
failure read-out's quality entry has no disc), through the one derivation the
menu lint already grades (`CompiledState::menu_anchor`: the rest rect widened
to the segment's outer edge). Under classic that is the row ending at
`CTRL_RIGHT` in the disc row's band, so the panels settle where they do today.

The rect travels as a mounter seed (`AppMounter::player_menu_anchor`,
`Bridge::seed_player_menu_anchor`, stamped in `app::playback` before
`open_player_overlay` at the three open sites), not on `PlayerOverlayArg`: that
argument is canonical (`ARG_SHAPE`), so a float rect on it would change the
replay fixtures. The mount takes the seed once; a press that re-addresses a
menu already up, a panel that is not a menu and a page with no package clear
it, so a later mount never inherits an earlier press's rect.

Tests: classic's four openers anchor at the segment edge in the row's band;
non-menus and a page with no package have none; the anchor follows the held
control of an edited package; the mount takes a seeded rect once and only once
(watched RED with the mount ignoring the seed).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ch control's command parameters and face

The trigger reads a package path once on the first player frame; the app layer
reads the file, compiles through player_hud::loaded::DevPackage and keeps what it
refused per language, so a bad file logs one line and classic draws, and is not
re-read or recompiled every frame.

ControlRect gains `act` (the typed HudCommand with its `by`/`tab`/`page`/`section`,
built by HudCommand::from_item) and `face` (one glyph, the per-state map, or a
seek ladder); Compiled::asset answers a declared asset's SVG.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The page resolved a row press through classic's table (slot.command(i)), so
under a package with more than classic's five controls the Play disc asked for
whatever classic's fourth control is. player_hud::geometry now owns row_command,
row_enabled and row_primary: for the discs of a package the control at that
stable index of the compiled state, its typed HudCommand with its parameters,
enabled by the command's own predicate over the frame's HudModel; everywhere
else the slot's. The pointer click path (activate_player_row) asks the page the
same question, so both routes end in the one performer.

Under builtin:classic the answers are Controls' table for every valuation of
the pair and the restart target (classic_resolved_through_the_compile_is_classics_table).
The row's focus pop is sized for the longest row the format lets a segment hold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cus on TransportButton, package glyphs, the playbar's knob/clocks/mark, faces by command state

TransportButton gains a rest face (film, bare, solid) and a focus face (accent, ring) in place;
film and accent stay the defaults, so no existing caller's frame moves. A disc can draw a glyph
from a package's SVG source through the shared icon cache (keyed by the source's hash). The playbar
look gains knob (tick|always), clocks (follow_head|ends) and mark (after_elapsed|busy_only) with
classic's values as default, and the title look its two sizes. The renderer draws a disc of any
index with the control's own command (enabled by the command's predicate), its face picked at the
command's state (play/pause, previous/restart, stats on/off, the Skip interval), and resolves Text
binds through one function. HudModel carries the Skip interval and the stats flag.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ks are app text the lint sees

The playbar draws its clocks on a line CLOCK_TOP under the track, but the compiler
reserved no height for that line and emitted no rect for either clock. The reference's
next band therefore landed on the clock line (its More disc was drawn over -52:33 on the
TV) and the lint reported nothing, because I4 and I10 had nothing to read.

- classic.rs names the line once: CLOCK_TOP (the clocks' line top below the track's top,
  which draw_playbar_look now draws at) and CLOCK_LINE (1.25, a ratio so no measurer can
  move a band), with clock_line_h(size).
- compile.rs: the playbar's cell is CLOCK_TOP + clock_line_h(clock_size) tall, or the
  thickness if taller. DrawOp::Playbar carries ClockRects, from the new hud_format/clocks.rs:
  each clock's rect on the clock line, as wide as the widest string the app can print in
  the weight it is drawn in (measured, digit by digit); under follow_head the elapsed
  clock's rect is the whole track.
- lint_zorder.rs reads both clocks as decor (I4, HUD-E1003); lint_text.rs judges them as
  app text against the controls on their line and each other (I10, HUD-E0601/W0602).
  The text lint's room for an end-anchored clock grows leftwards and has no SAFE bound.
- classic.plxhud.json: the tabs' gap_before is 7 (was 59). tab_y 949 less the cell's foot
  882 + 60. Classic's compiled geometry is unchanged to the f32 under both measurers.
- The lint_text closed-world pin of "which app texts are judged" counts the playbar's
  clocks (5 pointers, now 6). The schema's thickness description and docs/hud-plugins.md
  no longer say the clocks overhang the band.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…efore it is deleted

compiled_classic_matches_the_hand_written_layout now also compares the compile to
fixtures/classic-geometry.golden.tsv (320 cases: the items and tabs of every case, plus the
slot-independent facts as literals), and the stage-1b census compares the frame hash of
census-classic.golden.tsv (1480 cases: 10 languages x 148 frames) against both the hand-written
draw and the renderer. Both files were written from the HAND-WRITTEN side (classic::geometry and
classic::draw_hud) at 93fc509, and both sides are still present and green here, so the next
commit can delete the hand-written side and the same numbers keep holding.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ompile is graded on, before the function is deleted

The two title tests compared the compile against classic::title_right. Their expected values are now
fixtures/classic-title-right.golden.tsv, written from the hand-written side; both sides still run and
agree, so the deletion that follows can drop the live side and keep the numbers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…etry and the title edge come from the compile

classic::draw_hud, frame_geometry, geometry, tab_hit_rect, icon_hit, btn_x, scrub_hit_rect, the title_right chain
(title_right, ControlSlot::item_rect, Controls::rect, ctrl_slot_w, up_next::layout_peek/layout_of) and the
tab drawing nothing else reads are gone. The geometry report, the row's commands and the page's stops are read
from the Compiled classic; a frame the package has no state for answers an empty report. The two golden tests
keep only their frozen side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ent, with no hand-written fallback

PlayerScreen::new takes the Arc<Compiled> the mount hands it (AppMounter::player_compiled, seeded by the app), the
draw and every geometry reader take their one answer from it, and a package with no state for the frame draws
nothing and places nothing, logged once. The pins that graded the hand-written constants read the compiled
classic instead; the click-through pins of the disc row now read the real hit map.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…page

run::boot_hud compiles builtin:classic outside any frame (a controlled replay or record run defers to its first
player frame, where measuring is allowed), run::adopt_hud keeps it and seeds the mounter, and the host rig builds
its App the same way. The audits and the pointer rig read the compiled classic's report.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Re-words the module and doc comments that named classic::draw_hud, geometry,
title_right and icon_hit as present (appkit hud_format, player_hud, ui icons,
the player screen). No code change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vigation's classic.rs row

The module's #![allow(dead_code)] came from the pre-split player_hud.rs and was not added for the hand-written arrangement, so the
deletion leaves it alone. docs/playback-navigation.md said classic.rs holds the row's icons; the
row is drawn by render.rs and classic.rs keeps the row's width and band.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o bars

The reference package's back10 and fwd30 assets drew their digits as bare
rectangles (M9 10h1v6H9z M12 10h3v6h-3z), which the TV showed as two vertical
bars inside the ring. The ring and arrowhead are unchanged; the digits are now
straight-sided outlines with a 1.5-unit stem: a 1 with a flag, a 3, and a 0
whose counter is a sub-path wound the opposite way (the fill rule is nonzero).
Every vertex stands at least one unit inside the ring's inner edge, and the
numerals sit on whole-pixel columns at the 24 px the faces draw at, so the two
digits never share a half-covered column.

All four copies change together: the fixture, the site's example, the
worked-example text in docs/hud-plugins.md, and the hand-copy in
svg_subset.rs, whose existing test still proves the copies equal the fixture.
A new test reads the two assets' paths and pins the numerals: no bare
rectangle, a counter wound against its outline and inside it, and the clearance
from the ring. It failed against the old art first.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…wi, so check-deps' libm gate passes

The new numeral test measured each vertex's distance from the ring's
centre with a square root and powi; ci/check-deps.sh's libm gate flags
the method-call spelling of powi outside ci/allow/libm.txt. The bound
is the same: 6 units from the centre, compared as 36 squared, with the
squares written as products.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… round (lint, whole-pixel clock line, three size savings, false claims)

The reference's `back10` outline closed at the wrong point, so its arrowhead collapsed into a sliver,
and its ring was centred on (12, 13) while `fwd30`'s is on (12, 12). `back10` is now `fwd30` turned
about x = 12, both rings sit on (12, 12), and both digit pairs moved up one unit to centre on it. A
test holds the two ring-and-arrow sub-paths to be mirror images, the digits centred, and every digit
vertex clear of the ring; all four copies of the assets change together.

Review findings:
- `classic.rs`: the two knob branches that drew the same disc are one condition (clippy's
  `if_same_then_else`; `make lint` is clean).
- `classic::clock_line_h` rounds up to whole pixels (LABEL 32.5 -> 33, MICRO 27.5 -> 28; classic's
  CAPTION stays 30), so no band above the bar stands on a half pixel.
- `PlayerScreen::caption_band` returns `Compiled::band` instead of building a state report on every
  drawn frame; a pin holds it equal to the old report's band for every occupant of the row.
- `compile.rs`, three size savings that leave the compile unchanged: the cost report stores only its four
  sums (`CompiledState::top_contributors` weighs and sorts when a report asks); a Skip state compiles
  its credits layout only when its two pill rects differ, the one way the kind reaches the layout; the
  bands fill in `z` order through `z_order` (a stable insert) instead of a sort.
- Docs and comments that said a language change recompiles the HUD (the locale is a `OnceLock`; the
  setting takes effect at the next launch), that `refresh_hud` runs outside the frame, that only
  `prepare` and `draw` read `PlayerScreen::model`, that the renderer reads no global, that classic draws
  tabs, that every draw takes the model, and the stale `HudRenderer`, `draw_tabs`, `layout_of`,
  `skip_pill::draw` and `ctrl_slot` names. `refresh_hud`'s dead language arm is gone.
- `player_hud/render.rs` lists what PR10b owes before a package can be installed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…7,000,000

The HUD plugin format and its renderer (hud_format, player_hud) went from dead
code on main to live code on the TV; CI's armv7 job measured 15,451,784 bytes
against a limit of 15,180,000. The limit follows the #836 convention: measured
plus 10%, rounded up to the next 10,000. The justification is in the PR body
under 'Binary size'; the limit is pending the owner's acceptance.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 marked this pull request as ready for review October 30, 2026 18:04
@GLinnik21
GLinnik21 merged commit 533991f into main Oct 30, 2026
19 checks passed
@GLinnik21
GLinnik21 deleted the hud/pr7-render branch October 30, 2026 18:04
GLinnik21 added a commit to BamischijfNL/plx-native that referenced this pull request Oct 30, 2026
main's plxnative#1154 raised the binary size budget (limit 17,000,000), which is what this branch's cross-build needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit to BamischijfNL/plx-native that referenced this pull request Oct 30, 2026
…counts plxnative#1154 pinned

The frozen goldens (classic-geometry 32, classic-title-right 8, census-classic 148
rows per language) were written from the hand-written classic layout, which plxnative#1154 then
deleted, so main has no generator for a language that arrives afterwards. The nl rows
come from that hand-written side at edd3d0d (the last commit before its deletion,
both sides live) with the Dutch catalog applied; the generator reproduced all 320, 84
and 1480 existing lines byte for byte before the nl rows were taken. At edd3d0d the
compile and the renderer agree with the hand-written side for nl in all three tests.

The four tests still iterate every SHIPPED language with their count asserts intact.
The language-count pins and prose the new language made false now say eleven (11 / 352
cases): loaded.rs, compile_tests.rs, docs/hud-plugins.md, the two lint_size test names,
the month-table doc comment, and the hud_cli --lang usage pin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit to LovelessCodes/plx-native that referenced this pull request Oct 31, 2026
Main landed the HUD plugin work (plxnative#1151, plxnative#1153, plxnative#1154): the layout compiler,
the lint and one renderer drawing from the embedded builtin:classic package.
The hand-written classic draw this PR edited is gone, so the Skip pill joining
the transport row now lives in the compiled layout.

- classic.rs, motion.rs: main's versions. The PR's join_slot / draw_discs /
  icon_hit edits targeted code main deleted; their behaviour is carried by
  the compiler (`layout.up_next.joins`, set by builtin:classic) and state.rs.
- hud_format/compile.rs: a joined Skip state keeps the five disc stops from
  the package row and puts the pill at items[BTN_SKIP], a CONTROL_GAP left of
  the run. A package that does not set `joins` still replaces the row.
- player_hud/geometry.rs: frame_state looks the Skip state up with the
  episode pair; row_len / row_command / row_enabled / row_primary treat a
  Skip pill that replaces the row as the row's one stop; new row_joined.
- player_hud/render.rs, skip_pill.rs: the Disc widget draws under a Skip
  slot; the SkipPill widget draws at its own ordinal when joined.
- player/mod.rs: neighbour walks ControlSlot::travel when the pill is joined.
- Re-recorded the Skip rows of the three frozen goldens (geometry,
  title-right, census). Every non-Skip line is byte-identical.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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