Repository navigation
test(bench): port the Element PAPI boundary instrument onto new-lynx - #151
Merged
Merged
Conversation
Issue #148 W0 asks for the instrument before any FCP claim: the +18.8/33.6/45.0% first-screen excess and the ~27% publication share on file were all measured on main, and new-lynx has moved under them (#108-#113 direct first screen, #109 first-screen records, #110 decline-before-paint, #132 announce-from-composing). Nothing may be claimed here until this harness runs here. The probe is host-side, not framework-side. @lynx-js/web-core installs the whole Element PAPI onto the hidden main-thread script realm with one Object.assign from LynxViewInstance.onPageConfigReady; papiInstrumentJs wraps that single assignment, so the identical instrument measures Octane, ReactLynx, and the Vue cells by construction. No framework is patched, no reference bundle is rebuilt, and the vendored bundles keep the hashes the featured runs recorded. Ported from the issue-#50 branch and re-derived against this base rather than copied wholesale: - driver-client.mjs takes the probe as a patch, because new-lynx has since added countAttribute to the same file. - The main-era results JSON is deliberately left behind. papi-{1000,10000, 30000}.json, papi-boundary.md, papi-scaling.json and the predicate-cost record are frozen main measurements; re-landing them here would read as a new-lynx baseline that was never taken on new-lynx. - chromiumLaunchOptions replaces the two open-coded launch blocks in stages/ run.mjs and web/run-web.mjs, so all three harnesses resolve a provided Chromium the same way instead of only one of them. - analyze.test.mjs anchored its two esbuild import paths to the process working directory, so `pnpm test:stages` -- its own package script -- could only pass from the repository root. Both are now anchored to the test file. The README section is renumbered to 6 and its subheading disambiguated, since this base already carries five numbered sections and an "Observation contract" under section 3. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
`papi-run.mjs --smoke` writes `stages/results/papi-smoke.json` so a smoke exercises the same reporting path it is checking. That directory holds committed evidence, and an n=1 non-interleaved run is not evidence: left untracked it invites being committed beside records that were measured properly. The reportable artifacts in the same directory -- papi-<rows>.json, papi-boundary.md, papi-scaling.json -- stay committed. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
…ew-lynx The instrument's whole purpose is that nothing about this branch's FCP is claimed from a main-era measurement. This is the measurement. n=5 per variant per cell at 1k/10k/30k, fresh page per sample, control/counts/ timed rotating inside one host window, quiet host (1-minute load 0.43 at start, 1.39 at end over 4 CPUs). Both builds agree on counts in every cell, which is the control on the timed build's 1.06-1.17x cost. Octane's first-screen excess over its own post-mount path for the identical tree, which is what the issue-#148 oracle is written against: 1,000 16.1 ms 9.7% (main-era record: +18.8%) 10,000 204.2 ms 18.0% (main-era record: +33.6%) 30,000 898.7 ms 28.5% (main-era record: +45.0%) The main-era figures are beside them as history, not as a comparison: they were taken on a different branch and a different host, and only the same-window numbers on each row are claimed. Two things the decomposition says that the main-era framing did not: Publication is not the owner it was recorded as. papi_flush gains 11.5/123.7/ 456.8 ms on the first-screen path while papi_topology loses 11.5/109.4/304.3 ms, because the page is detached until the first flush -- so the same node insertions are billed to flush there and to topology on the create path. Netted, publication owns 0% of the excess at 1k, 7% at 10k, 17% at 30k, not a near-constant 27%. The first-screen path issues 11 more host calls per row than the create path for the same rendered tree: 7 __GetElementUniqueID and 4 __SetAttribute, neither of which the create path issues at all. That is 330,000 extra host calls at 30k, worth 17.3/44.5 ms of papi_read and 28.0/91.8 ms of papi_props at 10k/30k. Both are Octane-owned and both sit before paint. Absolute milliseconds here are host-bound and are not comparable to any other session or host; the shares and the same-window ratios are the portable claims. Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
This was referenced Aug 23, 2026
…he fcp tick walking twice
- The deltas block and firstScreenControl dereferenced cells.octane
unconditionally, so any --cells value without octane crashed after the
whole measurement window and lost every collected sample. Both now
degrade to no-deltas / no-control, pinned by a red-verified regression.
- runFcpSample passed an explicit contentAtLeast spec, so every pre-paint
polling frame walked the composed tree twice; { minContent: rows } is
the same boundary on the count the tick already computed, matching
run-fcp.mjs and stages/run.mjs.
- Deleted the dead round() copy in papi-run.mjs; rendering owns rounding.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YHfFsy9CLaRovTFH8pTGyY
Huxpro
marked this pull request as ready for review
August 25, 2026 08:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue #148 W0: put the host-boundary instrument on
new-lynxbefore anythingabout Lynx FCP is claimed here.
Every number the campaign is arguing from was measured on
main— the+18.8% / +33.6% / +45.0% first-screen excess at 1k/10k/30k, the ~27% share
__FlushElementTreepublication owns of it, the 16.7–20.1%captureLynxFirstTreepaint delay.
new-lynxhas moved underneath all of it since: the L3 directfirst-screen applier, #113's direct first-screen lists, #109's first-screen
records, #110's decline-before-paint, #132's announce-from-composing. Those
figures are history, not a baseline, until the same instrument runs on this
branch.
The probe is host-side, which is what makes it usable across frameworks.
@lynx-js/web-coreinstalls the whole Element PAPI onto the hidden main-threadscript realm with a single
Object.assignfromLynxViewInstance.onPageConfigReady.papiInstrumentJswraps that one assignment, so the identical instrument measuresOctane, ReactLynx, and the Vue cells by construction. No framework is patched, no
reference bundle is rebuilt, and the vendored bundles keep the hashes the featured
runs recorded.
This PR is the tooling and its unit tests. The
new-lynxbaseline it exists toproduce is measured next and pushed onto this branch, so nothing here is yet a
claim about this branch's FCP.
Why
stages/run.mjsdecomposes Octane from inside Octane, so every segment stops atthe Element PAPI call and the entire far side — prop and insertion work,
__FlushElementTree, Web Core DOM publication, style, layout, observer delay —collapses into one
layout_flush_residual. That residual cannot be comparedagainst a framework whose internals are not instrumented, which is exactly what
the FCP question needs. This measures the other side of the same call.
Changes
Ported from the issue-#50 branch and re-derived against this base rather than
copied across:
stages/papi-run.mjs,papi-analyze.mjs,papi-report.mjs,papi-analyze.test.mjs,papi-predicate-cost.mjs— new, unchanged from thereviewed originals.
web/driver-client.mjstakes the probe as a patch rather than wholesale,because
new-lynxhas since addedcountAttributeto the same file. AddspapiInstrumentJs,shellCount/shellAtLeast,papiSnapshot, and theboundary counters on the FCP and predicate resolutions.
papi-{1000,10000,30000}.json,papi-boundary.md,papi-scaling.jsonand the predicate-cost record are frozenmainmeasurements; re-landing them here would read as anew-lynxbaselinethat was never taken on
new-lynx.chromiumLaunchOptionsreplaces the two open-codedchromium.launchblocks instages/run.mjsandweb/run-web.mjs, so all three harnesses resolve aprovided Chromium the same way instead of only one of them doing it.
stages/analyze.test.mjsanchored its two esbuild import paths to the processworking directory, so
pnpm test:stages— its own package script — could onlypass from the repository root. Both are now anchored to the test file, and the
suite passes from either location.
disambiguated, since this base already carries five numbered sections and an
### Observation contractunder section 3.No package source is touched, so there is no changeset.
Validation
pnpm format:checkpnpm typecheckpnpm test— ran to completion on this head: 4 failed | 21,226 passed(21,230) across 2,208 files, 2,388 s. All four are pre-existing or
environmental, and none can be reached by this diff: it is 17 files under
benchmarks/plus one.gitignorerule, with nopackages/source at all.-
rspeedy-plugin-octanenative-demo"escalates cleanup for a detacheddescendant" — the known pre-existing container failure recorded in Execution plan (#58): complete L2, then drive L4→L6 — full context handoff #66 §2.3.
-
dreiupstream-e2e— the scene never finishes becausepotsdamer_platz_1k.hdrcannot be fetched in this sandbox, and thewaitForFunctionthen times out.-
syntax-highlighterlight-async— passes 5/5 when that file is run onits own; a full-run-only snapshot interaction.
-
octanesuspense-hydration"restores focused input and its selectedtext after a keyed DOM reorder" — reproduces in isolation on a quiet host,
so it is not a load flake. It is also not this branch's:
packages/octane/src/runtime.tsandpackages/octane/tests/browser/suspense-hydration/are byte-identicalbetween
origin/mainandorigin/new-lynx, somainfails it the sameway. Reported separately rather than absorbed here.
node --test benchmarks/lynx-table/stages/*.test.mjs—32/32, from the repository root and from the package directory (the
second location is what the path-anchoring fix above buys).
node stages/papi-run.mjs --smoke --scales 1000drove all three page variants (
control,counts,timed) against allthree cells and reported startup, create, and — for Octane — a direct FCP
window. Not reportable by construction (n=1); it proves the harness runs
here, nothing more.
Risk / follow-ups
--reps 5at 1k/10k/30k on aquiet host), which is what re-establishes the excess and the publication share
for
new-lynxrather than quotingmain. It moves both: the first-screenexcess over Octane's own post-mount create path is +9.7% / +18.0% / +28.5% at
1k/10k/30k here, against the +18.8% / +33.6% / +45.0% recorded on
main; andpublication's share nets down to 0% / 7% / 17% once the topology work it
absorbs is subtracted, rather than the near-constant ~27% the
mainfigureread as. The decomposition is in
stages/results/papi-boundary.md.--smokewritesresults/papi-smoke.jsonand is not a reportable artifact;only
papi-run.mjswithout--smokeproduces one.shares and never for wall-clock claims; what that overhead actually is on this
base comes from the baseline run, not from the recorded
mainfigure. Thecounts build is the control on it: both builds count identically by
construction, and the report prints the agreement per cell, so a costlier pass
that disagrees on what the framework called cannot pass as the same workload.
Provenance
agent-authored)Generated by Claude Code