Skip to content

drawmask: card parts (interior, ring, focus) for the TV, and --save-logs keeps the profiler counters - #863

Merged
GLinnik21 merged 4 commits into
mainfrom
crx-card-attrib
Oct 20, 2026
Merged

GLinnik21 merged 4 commits into
mainfrom
crx-card-attrib

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

After #861, held paging on Home still spends 4.27M GPU cycles per frame on cards. The next step depends on where those cycles go: baking the resting ring as a shared 9-slice texture, or something else. Nothing could measure that on the TV. This PR adds the instrument and makes the harness keep its data.

What it adds

  • Card parts in the existing drawmask (plxnative-drawmask, extended in place, no new mechanism):
    • card.interior refuses the interior piece of every split card;
    • card.ring refuses the four ring pieces of every split card;
    • card.focus refuses every card drawn with the focus program.
    • Parts combine with commas or spaces, alongside the existing whole-class masks. An unknown name is logged with the valid names.
    • Both OVERDRAW ledgers book a card before its part is refused, so a part leg differs from its control only by the refused draws.
  • The harness keeps the profiler data. tests/run.py used to wipe plxnative-hwcnt.jsonl before each scene, so an --fps --save-logs leg lost its counters. Now:
    • run_fps_scene pulls exactly the file of each armed profiler: plxnative-hwcnt gives the HWCNT JSONL, plxnative-profile gives the GL-timer JSONL.
    • The pull happens once, after the app run and before the next wipe. It is saved beside the event log.
    • run_graphics_profile uses the same pull instead of its own.
  • The TV recipe for the per-part legs, and how to read their deltas, in docs/backdrop-blur-profiling.md Part 5.

Cost

  • Release (devtriggers off): masked_part is a constant false, and card_plan has one production instantiation, so the check folds away. Nothing is added per card or per piece.
  • Dev build, nothing armed: two thread-local reads per split card and one per focus card (about 40 a frame while paging). The draw loop is unchanged.

Verification

  • Tests:
    • every part mask refuses exactly its pieces, as a differential test over every row style and three clip shapes;
    • the drawmask text reaches the pieces;
    • each part has a distinct name;
    • the harness keeps the right file for an hwcnt leg and for a profile leg, says so when an armed leg left none, and pulls once for both callers;
    • kill, then wipe, then run, then pull, in that order.
    • Watched red: with the pull reverted to hwcnt-only, the profile-leg test fails with ['kill', 'wipe', 'run'] != ['kill', 'wipe', 'run', 'pull plxnative-gputime.jsonl'].
  • Gates on the committed tree (git status --short empty before and after):
    • make check exit 0: 103 steps — all ok, harness Ran 475 tests … OK, every test result: ok (plx_gfx 157 passed);
    • make test-hostsim ok. 932 passed; 0 failed;
    • make check-nodef clean;
    • make check-replay 3 fixtures, 6 replays, 0 failures, all SAME, so nothing visible changed.
  • One review: no blockers. The release path folds, each mask is exact, and the scissor state is restored on every path. Its shoulds are fixed here: the harness keeps the file, and the doc states what the harness does with the panel. Then a simplify pass.
  • No crate, Cargo, Makefile, build.rs or workflow change.

Not in this PR

The TV run itself (home-recent-paging-held, legs none / card / card.interior / card.ring / card.focus interleaved on one binary). It needs the next TV window.

🤖 Generated with Claude Code

GLinnik21 and others added 4 commits October 20, 2026 11:13
…the card class's work

After #861 the card class still costs 4.27M GPU cycles a frame while held paging on the TV, and
nothing says how that divides between the interior pieces of the split cards, their rings and the
cards on the focus program, so the next step (bake the resting ring, retire the focus program for a
spring that has all but landed, or something else) could not be chosen. The existing drawmask
instrument now takes three PART names beside the whole classes:

- card.interior: the interior piece of every split card
- card.ring:     the four ring pieces of every split card
- card.focus:    every card drawn whole through the focus program

A name with a dot is one word, so card.ring is not `card` plus an unknown `ring`. A part is asked
after the class ledger and the card-path ledger have booked the card and after the uniforms are
uploaded, so a part leg books and uploads what its control does and differs in GPU work alone.
`card` still refuses the whole class, `all` is every class. card_plan takes the refusal as data, so
the host tests check which pieces each mask leaves without a GL context.

Dev only: with devtriggers off masked_part is false at compile time and the names are never
referenced, so release behaviour is unchanged. The TV recipe (home-recent-paging-held,
hwcnt=frame.ui + overdraw + framedrop=0.01, legs none/card/card.interior/card.ring/card.focus
interleaved on one binary) and how to read the deltas are in docs/backdrop-blur-profiling.md.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…set, and drops an unmeasured noise figure

The harness wipes every plxnative-* file in the runtime root (the JSONL included) before each scene
and again at teardown, and --graphics-profile's HWCNT leg cannot carry a drawmask, so the recipe now
states that the file has to be copied before the harness exits. The "under ~0.1M cycles is noise"
figure was not measured on this scene; a delta is graded against the interleaved repeats' own
spread. Also names the log --save-logs writes, the analyze-hwcnt invocation, and that a still-fusion
card's scrim is priced with its interior and ring pieces.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…xnative-hwcnt

The harness wipes every plxnative-* file in the runtime root before each scene and at teardown, and
--save-logs kept only the event log, so a card-attribution leg (--extra-trigger
plxnative-hwcnt=frame.ui) lost the one file that holds its answer. run_fps_scene now pulls
plxnative-hwcnt.jsonl (and plxnative-gputime.jsonl when the set has one) right after the scene's app
run, through pull_runtime_file, the one pull run_graphics_profile uses too.

The card-parts note drops its "the harness does not keep the JSONL" paragraph and says what the
in-repo harness does: the panel is off and the sound muted under --fps --mock, the binary comes from
make ARM_PROFILE=release deploy, and an interior + ring total can exceed card on a scene with stills
(under card a still falls back to a separate scrim pass, under the part legs it stays fused). The
set_mask and draw_tex_core_in comments say what a part leg really skips.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…once

The harness kept plxnative-hwcnt.jsonl and a plxnative-gputime.jsonl that an hwcnt leg never
writes, and lost the one a plxnative-profile leg does. A trigger->file map now names the file of
each armed trigger (PROFILER_FILES, HWCNT_FILE, GPU_TIME_FILE), and run_fps_scene pulls it once
and carries it in `capture`, so run_graphics_profile no longer pulls the same JSONL again.
pull_runtime_log is a thin wrapper over pull_runtime_file, and save_logs_file is the one writer
under --save-logs. Tests drive behaviour (kill, wipe, run, pull; a plxnative-profile leg; one pull
for both callers) instead of reading source text.

Rust: card_plan tags its pieces by CardPart, the duplicate assert, the repeated set_mask comment
and the class_at helper go, and draw_tex_core_in points at masked_part for the booked-before-
refused contract instead of restating it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit d6ec840 into main Oct 20, 2026
19 checks passed
@GLinnik21
GLinnik21 deleted the crx-card-attrib branch October 20, 2026 09:17
GLinnik21 added a commit that referenced this pull request Oct 20, 2026
#866 per-card grid let-gos) into crx-grid-reveal

Both sides' behaviour is kept in every conflict:

- ui/poster_grid.rs: the branch's title-handover test next to main's GridBands canon test
  and the `at` helper (#866).
- ui/cards/grid.rs: #866's `self.pop.reset()` where the branch's side built a fresh
  GridPop, with the branch's band comment.
- ui/cards/tests.rs: the branch's title_only/details_only Cards fields beside #866's
  elem_calls counter.
- screens home/recommended `probe_card_pops`: main's (#864) versions; the branch's copies
  came from an earlier draft.
- app/bridge_test_support.rs: main's sole_card_off_rest / home_focused_item / home_card
  next to the branch's `poster_cell`, and `card_pops` stays `pub(super)` because the
  Under posters shelf route test reads it.

The semantic join: `Grid::rise_below` (the drawn top of the tile below a caption line) reads
that tile through `drawn_rect`, which now takes the pass's `LetGoCards` and goes through
`pop_in`, the one resolution the draw paints with after #866. A released card still shrinking
below a caption (a let-go) is therefore drawn above its rest top in the caption's rule too, by
element when the source moved since the last tick, and `card_paint` / `rise_below` /
`drawn_rect` share the pass's single `let_go_cards` answer (the frame's hash budget,
`grid_draw_hashes_no_drawn_card_while_cards_let_go`, is unchanged).

New test `no_caption_line_is_drawn_where_a_tile_letting_go_below_it_is`: a held Down then a
held Up (a press every three frames), every caption line against the live drawn top of the
tile directly below it, with a check that the walk really leaves a let-go under a line. Watched
red with `rise_below` reading the tile below with the let-gos left out (worst overlap 7.8 px),
green on the join.

Replay fixtures: main's are the base (the three anchors as #866 re-recorded them) and the
README keeps both sides' paragraphs in order. The anchors are re-anchored on this merged
tree in the next commit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Oct 20, 2026
…rn once on the merged tree

The merge of origin/main (#863, #864, #866) into crx-grid-reveal kept main's fixtures as the base.
On the merged tree `make check-replay` found 6-settings-family SAME (frames=1321, diverged=0, every
counter zero, Targets and Resolve) and two anchors that no longer match, with the shape unchanged
(state_fp 2896094977091175041, so `rerecord` refuses):

- 12-filmography-detail-return: DIVERGED in both modes, diverged=884 of 923, present/input/result/
  land/effect/focus/hit diffs all 0 (a pure state-hash divergence, no visible counter). Attributed by
  replaying the committed anchor against the merged tree with only person.rs put back to
  origin/main's (filmography labels through the one caption policy, the air under a shelf as
  StackPage::shelf_foot instead of Sec::Gap(kind)): SAME, diverged=0, every counter 0, Targets and
  Resolve. The fresh recording holds the same 136 metrics (text measurement) queries as the old one.
- 1-boot-home-chip-grid: diverged from frame 296, then REFUSED (replay measurement table miss) in
  both modes, because main's recording predates the Under posters captions this branch carries.
  Attributed from the measurements themselves: the metrics records of the fresh recording differ
  from the committed one by exactly one gained Width query (Home's focused poster caption
  "1992 . 1h 40m", 24 px) and three lost (the year alone and the two synthetic title names).

The owner approved re-anchoring for intended UI changes (README 2026-09-29/30 entries; the standing
instruction not to stall on it). Both anchors were recorded afresh on this merged, committed-source
tree (tests/focusfp.sh --rec --only 1,12), passed `plxnative-rec check` (synthetic) against the
unchanged alphabet, and only rec-0000.jsonl was replaced; the manifests (anchor flag included) are
byte for byte the committed ones and equal the new recorder's header. README paragraph added.

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