perf(scripts): scoreboard lanes for boot-time and reopen work (early open, boot metrics, stable first reopen)

Merged
LO
20d ago
+986-86

What

Three measurement lanes for the load hill-climb's boot-time and reopen work, added to scripts/perf/load-scoreboard.mjs (#9607).

  • browser-cold-early. A fresh browser picks the file at the first paint after the file input exists, with no quiet-shell arming.
    • The lane is timed from the pick, so the input event's dispatch delay behind boot work is inside its clock: it is what a user who opens at once waits through.
    • It is reported beside browser-cold, so a boot-time warm-up can be shown not to hurt the worst case.
  • boot. No file is opened; it runs once per round and side. It reports:
    • app-shell ready (stamped in page when the store and the file input exist);
    • boot time-to-interactive (end of the last long task before 1 s without one);
    • boot long tasks;
    • idle memory 5 s after navigation: Chrome PSS, JS heaps (measureUserAgentSpecificMemory), WebAssembly heaps summed explicitly over the page and every worker, and GPU memory (nvidia-smi).
  • Stable first reopen. A scene snapshot captured at the end of the cold load could otherwise race the first reopen and make the lane bimodal. Before the first reopen the harness now waits until the viewer's stored cache entry stops changing (cached tiers only).
    • The lane keeps its name. The report counts per reopen lane how many samples adopted a snapshot, and for the first reopen whether one was stored before it opened.

Why the WASM heaps are summed by hand

performance.measureUserAgentSpecificMemory() does not count WebAssembly memory. On Pop, a 64 MiB WebAssembly.Memory moved it by 0.3 MiB, both in the page and in a worker.

The boot lane therefore sums every live WebAssembly.Memory in the page and in each worker through CDP Runtime.queryObjects(WebAssembly.Memory.prototype). A shared memory counts once. This measured +64.0 MiB for the same allocations in the page and in a worker.

Today's viewer has no WASM memory and no workers 5 s after boot (idle: about 650 MiB PSS, 77 MiB JS, 0 MiB WASM, 129 MiB GPU, untimed).

Evidence

  • Tests: 33 scoreboard tests on Node 24 and 22.23, covering:

    • arm rebasing;
    • cache-entry stability;
    • boot time-to-interactive;
    • the WASM realm sum (shared memory counted once);
    • the boot pseudo-fixture and snapshot-adoption counts in the report.
  • scripts/perf/*.test.mjs passes on Node 22.23 (382 tests).

  • The revert oracle in CI mode reports OBSERVED. node scripts/pre-handoff.mjs passes; retained-free viewer is SKIPPED, since no viewer source changed.

  • An untimed smoke run on Pop (ifc-gpu-check) on two copies of main's build exercised every lane end to end, with 0 failed samples:

    • browser-cold, browser-cold-early, browser-warm1, browser-warm and boot;
    • FZK and advanced_model;
    • the memory pass, and identical per-element output.

    The early lane already shows the effect it exists to expose: one advanced_model early open had its pick queued 2.8 s behind boot work.

No product code changed. Not a CI gate. The lane documentation goes into the consolidated ledger PR #9673.

šŸ¤– Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added browser startup measurements and an early cold-open timing lane.
    • Scoreboard reports include startup readiness, interactivity, idle memory, cache snapshot status, and clearer startup and early-open results.
    • Reports show output-comparison verdicts and flag results that are unverifiable or inconclusive.
  • Improvements
    • Cached browser measurements check that cache entries are stable before the first warm reopen; missing or unstable entries are reported as failures.
    • Resumed runs fill in missing lane samples without repeating completed ones.
    • Missing or invalid browser memory measurements are reported as unavailable rather than zero.