perf(scripts): the report shows both interactive marks and the post-finalize stall share
Merged
LO
19d ago+157+157+012345678901234567890123456789-2-2-0123456789
#10012 and #9952 are on main; this PR's diff is the both-marks report section and its tests.
What changes: every scoreboard report gains a "Both marks" table. It covers each fixture × lane and each side, and is computed from the same samples.
- current: the interactive mark every verdict uses, unchanged.
- frame: the first frame the renderer started (canvas texture acquired,
getCurrentTexture) at or after the scene finished (finalize end,geometryMs), never earlier than the current mark. It comes from the per-sample frame times recorded since #9857. Texture acquisition starts a frame; it is not the compositor's presentation time, so this mark is a lower bound on what the user sees: a frame acquired at the mark and presented 80 ms later reads as no wait. - Early-arm rows: frame times are moved to the first-paint clock by
pickDelayMs, like the milestones. - stalls: samples whose next frame starts more than 50 ms after the mark, as
k/n. Samples without frame times are listed as unknown, never counted as "no stall". - gains: the base-vs-branch gain under both marks. The frame gain is shown only when every sample on both sides has a frame mark (same cohort); sides with fewer than three values in a column are listed, never summarized, and get no gain.
Verdicts stay on the current mark. This makes a tail that one side hits more often visible beside the median, ahead of a decision on switching the definition.
Why (untimed sizing, 2026-11-13, Pop):
- On main, cold-load medians move 0–6 ms and reopens 0.
- Holter and advanced_model cold have a 95–170 ms tail: no new frame is started for that long after the scene completed.
- On main vs #9900, Holter cold, the branch hit it in 2 of 3 samples against main's 1 of 9.
- Re-reading that run with this report: Holter cold gain is +1.4% on the current mark and −3.3% on the frame mark; stalls are 0/3 on base and 2/3 on the branch.
Tests (load-scoreboard-bothmarks.test.mjs, built on the measured #9900 Holter samples; scoreboard suite 86/86 on Node 24 after the review fixes):
- the frame mark;
- no wait when the settle paint already follows finalize;
- unknown when frame times are missing or none falls in the window;
- per-side stall shares and unknown counts;
- gains under both marks;
- table rows omitted when neither side has frame times;
- early-arm rows shifted by the pick delay;
- frame gain withheld when a frame mark is unknown;
- fewer than three values listed per column.
Module-size and source-text gates pass.
🤖 Generated with Claude Code
Summary by CodeRabbit
- New Features
- Performance reports now include a comparison between interactive-time marks and the first frame presented after scene completion.
- The comparison summarizes median timings, delays over 50 ms, unknown samples, maximum wait, and gains when values can be compared. It appears only for lanes with known frame marks; existing verdicts remain based on the current mark.
- Tests
- Added coverage for frame-mark eligibility and the comparison’s reported metrics and Markdown output.