Repository navigation
test(bench): report which selector regime an FCP arm ran in - #133
Conversation
A timing comparison for the demand-installed `nodes-ref` selector is unreadable from the FCP column alone: a cell that stamps every node and a cell that stamps none look identical there, so an unchanged number cannot be told apart from an unchanged build. The counts live in the wire chassis, which the browser harness does not run. `driver-client.mjs` gains `countAttribute(name)`, walking the same composed tree — piercing shadow roots — that `findByClass` already walks. `run-fcp.mjs` reports `octane-ref` per sample and per cell, so every FCP row carries the regime that produced it. The report heading now names its cells instead of asserting the fixed octane-vs-direct pair, which stopped being true once `--extra` could add one. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
…rect §4 The count harness said 40,028 selector writes become 0. Run in Chromium at 10,000 rows with the background owning the first commit, that buys median view-attach FCP 2,134.9ms -> 2,102.2ms, about 1.5%, and the ranges overlap: the eager arm's fastest sample beats every announcing sample. At n=5 that is not a detectable win. Announcing earns its place on the wire contract and the per-node work it removes, not as a first-paint lever. The same run corrects a claim §4 was making. The plugin's main-thread entry installs with `firstScreen: true`, so an app it builds paints its first screen through main-thread direct emission and the background adopts it. Both sites stamp every node by construction and neither reads a commit's announcement, so a plugin-default build reads 40,028 selector attributes whether or not the background announces, to within 0.2ms of the same first paint. §4's arms bound the background-commit path -- a declined `<list>` topology, a host that does not enable the first screen, any commit after the first -- and no longer claim the after-render arm is how production starts. Also recorded: the background-commit path is ~560ms behind direct emission at this scale, which is the number standing behind that `firstScreen: true` default. Both figures are Lynx for Web in headless Chromium; native `__SetAttribute` crosses into engine code and is not measured here. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Measured. The selector count goes to zero; first paint does not move — and the production first screen never took this path.Pushed as
Four bundles, distinct checksums, differing in one boolean each. The count result holds in a real browser. The timing result is negative, and I am not going to dress it up. 2,134.9 → 2,102.2 ms is ~1.5%, and the ranges overlap — the eager arm's fastest sample (2,048.7 ms) beat every announcing sample. At n=5 that is not a detectable win. Forty thousand A claim I had to withdraw. I found this only because the selector column exists. The FCP figures for the top two cells are indistinguishable, so without the count this run would have read as a clean null result rather than as two builds that never differed. Consequence worth taking seriously before anyone proposes the obvious follow-up. The natural next slice is teaching direct emission and adoption to install selectively, since those two now own the whole 40,028 on the production path. This run argues against spending it: removing exactly those writes on the background path bought nothing measurable, so removing them on the direct path should not be expected to either. I would treat that as NO-GO on first-paint grounds unless someone brings a different reason — retained attribute memory, or native attribute-selector matching cost. Scope: Lynx for Web in headless Chromium. Native Incidental, and larger than anything above: the background-commit path is ~560 ms behind direct emission at 10k (2,102.2 vs 1,540.6). That is the measurement standing behind the plugin's One correction to my own method: the first attempt at the Generated by Claude Code |
Summary
Stacked on #132. This is the instrument half of turning that PR's count into
a wall-clock number; the measurement itself is running and lands on this branch
as a second commit.
prototype/run-fcp.mjsnow reports how many nodes carry theoctane-refselector attribute, per sample and per cell, beside the FCP it measured.
Why
#131 and #132 are counts taken at the fake Element PAPI in the wire chassis:
40,028 selector writes for a 10,000-row first screen, then 0. The browser
harness does not run that chassis, so nothing in an FCP report says which
regime the arm it timed was actually in.
That matters for the specific comparison this serves. A cell that stamps every
node and a cell that stamps none produce the same-shaped FCP row, so a null
result — the plausible outcome, since
setAttributeis cheap — isindistinguishable from having accidentally measured one build twice. The
selector column is what separates "no effect" from "no difference between the
arms."
Changes
web/driver-client.mjs—x.countAttribute(name)counts elementscarrying an attribute over the composed tree, piercing shadow roots the same
way
findByClassalready does. Lynx-for-Web mapspapi.setRefSelectoronto areal DOM attribute, so the page is observable this way.
prototype/run-fcp.mjs— each sample records its count; the per-rep logline prints it; the report table gains a
selector attrscolumn carrying thedistinct values seen across samples, so a cell that is not stable in that
dimension cannot be read as if it were.
prototype/run-fcp.mjs— the report heading names its cells rather thanasserting the fixed octane-vs-direct pair, which stopped being true once
--extracould add one.Validation
pnpm format:fileson both changed files — cleanpnpm sync— no generated changespnpm typecheck— not applicable:benchmarks/lynx-tablecarries notsconfig, so
typecheck:filesreports no project includes these files andthe repo lane does not cover them. Both are
.mjs.pnpm test— not run for this diff: it touches onlybenchmarks/, whichis in no Vitest project.
next commit, and if the probe turns out not to observe the attribute
through the web host's element model, this column comes out rather than
shipping as a zero that means "not measured".
Risk / follow-ups
announces nothing it is the same number either way; for one that holds refs it
would report the steady state rather than what was installed eagerly. It is a
regime indicator, not an install counter — the install counter lives in the
wire chassis, where it can see the difference.
Provenance
agent-authored)Generated by Claude Code