Skip to content

test(bench): give the FCP window a reference control - #251

Merged
Huxpro merged 9 commits into
new-lynxfrom
bench/lynx-react-first-screen-cell
Aug 31, 2026
Merged

Huxpro merged 9 commits into
new-lynxfrom
bench/lynx-react-first-screen-cell

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

The FCP window had no cross-framework control. This gives it one, and then gives
the harness's own delta attribution the section it could never render.

A pre-populated first screen is a build-time define of the app source, so every
vendored reference reported FCP@N as "not measured", and Octane's first
screen could only be compared against its own composed startup + create@N
projection — a projection whose own error was the only bound on how far it sat
from a real first screen.

This vendors ReactLynx built with a pre-populated first screen, one bundle per
row count, as reference/react-first-screen, registers it as a cell, and adds
the FCP delta section to the boundary report.

This also closes a gap that has already reached new-lynx. The base branch
now documents the react-first-screen cell in three places in
benchmarks/lynx-table/README.md, but carries none of its implementation: no
firstScreen section in reference/manifest.json, no cell in
stages/papi-run.mjs, and no bundles. That prose arrived without this diff, so
the base currently describes a cell a reader cannot run. This PR is what makes
the README true.

Why

Because the question the window is for could not be asked. Issue #247 Order 1
asks where Octane's first screen spends ~610 ms more than ReactLynx's at 10,000
rows. Every segment of that answer needs a reference measured in the same
window on the same host
, and the harness could not produce one — not for lack
of an instrument, but for lack of a bundle.

It is a second vendored set rather than a rebuild of reference/react, for
exactly the reason that cell gave for having no variant: "rebuilding the
reference would change the bundle hash the featured runs recorded."
That is
still true, so the existing artifact is left alone. Vendoring beside it costs
316 KB and costs those runs nothing.

Changes

reference/react-first-screen/rows-{0,1000,10000}/main.web.bundle — the
vendored set, taken from the campaign entry that already builds and hash-pins
these variants (Huxpro/lynx-js-framework-benchmark, entries/react), built
upstream from Huxpro/vue-lynx@28f7acba with BENCH_AUTOROWS set per variant.

reference/manifest.json — a new firstScreen section: source, upstream
commit, build command, framework version, and the sha256 of each bundle. Kept
separate from the cells block above it, which all share one upstream commit
that this set does not.

stages/papi-run.mjs — the react-first-screen cell.

  • Which scales exist is read from the manifest, not written in the code, so
    the harness can only offer a scale the manifest pins. A scale nobody vendored
    returns null and reports "not measured" through the existing path, rather
    than DNF-ing against a 404.
  • Each bundle is checked against its pinned digest on first use. This is the
    one cell whose bytes nothing in this repository builds — every other cell is
    compiled from source on each run, so a wrong bundle is a wrong build and shows
    up as a wrong number against a known one. A vendored bundle has no such
    backstop.
  • bundle is the rows-0 variant, so this cell's startup and create windows come
    from the same build family as its FCP window. Nothing is borrowed across
    builds.

stages/papi-run.mjs + stages/papi-report.mjs — the FCP delta section.
The report has always split the Octane-minus-reference delta into candidate
owners with GO/NO-GO verdicts, for create and startup. The first-screen window
had none and could not: the delta needs both cells to have measured FCP, and no
reference ever had. Computed beside the other two and rendered the same way,
absent rather than zero when either side did not measure the window — a
missing delta is a window nobody ran, and nothing downstream should be able to
read it as a gap of nought.

stages/reference-manifest.test.mjs — new, four tests, making the record
binding rather than decorative.

Three records under stages/results/, each with a reason to exist:

docs/measurement/fcp-attribution.md — new, the procedure built on top of
the instrument. The bench README documents the observation contract; what it did
not document is how to use it against a reference, and that part has two traps
in it. Written down rather than left in an issue comment:

  • buckets 1 and 2 are irreducibly fused. sliceStartEpoch is the moment the
    hidden main-thread iframe is handed its Blob script URL — before the browser
    loads, parses or evaluates anything — so bundle evaluation and framework boot
    both sit inside start_delay, and the only event in that window observable
    without knowing either framework's internals is the first host call. Any line
    between them would have to be drawn from framework-specific knowledge, which is
    what stops the two cells being measured the same way.
  • bucket 4 cannot nominate an owner, however large it is, because
    off_boundary is a named exclusive remainder — arithmetic, not an observation.
    That is the The create residual: attribute it, tax-test it, then extend compiled programs to steady-state mounts (E-train) #230 rule applied to this window.
  • the share denominator is the octane-minus-reference wall, not the sum of the
    bucket deltas. Dividing by the latter forces the shares to exactly 100% and
    silently discards the median non-additivity, which is real.
  • the ±0.04 resolution, and the step that establishes it: repeat the control
    arm, not just the candidate.

Every figure in it is recomputed from the two checked-in records rather than
restated from the report.

README.md — documents the cell, rewrites the two-windows paragraph (which
said the references have no FCP variant; one now does), and points at the recipe.

Validation

  • pnpm format:check — via pnpm format:files on all changed files, clean
  • pnpm typecheck — n/a, no TypeScript changed
  • pnpm test — not run; this touches only benchmarks/lynx-table and
    docs/, which vitest.config.js does not include. The owning suite is
    node --test stages/*.test.mjs, run below.
  • targeted tests
  • pnpm sync — clean, no generated changes

Both new tests red-verified.

node --test stages/reference-manifest.test.mjs is 4/4 green; appending one byte
to rows-0/main.web.bundle turns test 1 red, and adding a stray file under
rows-1000/ turns test 3 red. Restored, and the digest re-checked against the
manifest afterwards.

The FCP-delta test renders the checked-in c247-o1 record and asserts the
section is there for react-first-screen and not for react — which
measured create but not FCP, in the same file. Removing the delta.fcp !== undefined guard turns it red, and turns the two tests beside it red as well,
which is the guard doing its job on a delta that has no FCP member.

The cell works, and the workload control passes. --cells octane,react,react-first-screen --scales 1000 --reps 5:

cell create ops/row create ms FCP@1000 ms
octane 20.001 123.2 169.0
react 21.001 124.9 not measured
react-first-screen 21.001 127.1 109.3

The two react cells issue the same 21.001 host calls per row in the create
window and land within noise of each other on the wall clock, which is the check
that says the two builds still do the same work operation-for-operation. Without
that row agreeing, no delta against the new cell would mean anything, which is
why the README tells a reader to look at it first.

react keeps reporting "not measured" for FCP, unchanged and deliberately.

What the new section renders, on the checked-in record at 10,000 rows —
included here because it is the first output of a code path that had no output
before, not as a finding:

candidate owner delta ms share verdict
Publication op count 271.9 57.1% GO
Framework script and browser paint outside the host boundary 298.5 62.7% GO
Flush cadence -12.4 -2.6% NO-GO
First-paint scheduling 9.4 2.0% NO-GO
Per-element creation stream shape -132.5 -27.8% NO-GO
median non-additivity 41.5 8.7% —

Risk / follow-ups

  • This is a black-box artifact and stays one. Nothing here builds it, and the
    only claim made about its contents is the digest. What certifies it as a
    comparable workload is the ops-per-row control above, measured every run — not
    the provenance note.
  • The two react cells are different builds (different upstream commit,
    @lynx-js/react 0.124.0 against 0.122.1). Their create windows agree today; if
    that row ever diverges, the two are no longer measuring the same benchmark and
    the divergence, not the delta, is the finding.
  • Only rows 0/1000/10000 are vendored. 30,000 exists upstream and was left
    out; adding it is a copy plus a manifest entry, and the code needs no change.
  • A record's meta does not carry the source commit, which is why
    c247-o1-causea-* needed its provenance written into a commit message. That is
    a gap in the harness worth closing separately; this PR does not close it.
  • The FCP ratio's resolution is now known, and it is coarse. Two windows of
    identical code give ±0.04 on the octane÷react FCP@10k ratio. Any claim of a
    first-screen improvement smaller than that needs more windows, and this PR is
    what makes that bound measurable at all. It is written into the recipe rather
    than left here, so the next first-screen claim meets it before it is made.
  • docs/measurement/heap-after-clear.md is still unlinked, on perf(lynx): stop describing detaches a clear's own destroy performs #249's branch.
    It is not linked from here because the file does not exist on this branch and
    the link would be broken; adding the pointer on perf(lynx): stop describing detaches a clear's own destroy performs #249 instead would touch this
    README on two branches and manufacture a conflict that does not currently
    exist. Whichever lands first should give docs/measurement/ an index.
  • The attribution itself is not published here. Attribute the 1.6× web-startup gap to ReactLynx before deciding whether to chase it #247 Order 1 is reported
    there.
  • Base merged in, one conflict resolved. perf: measure the second create and its teardown in the lynx-table gate #235, test: judge a device round's correctness before it measures anything (#234 D1) #237, test: pin what a background-originated program mount cannot name (#230 E1) #238, test: pin why the incremental compact path refuses a live segment (#230) #239 and perf(lynx): #230 Order 3 — the four-build split #240
    landed on new-lynx after this branch opened, so origin/new-lynx is merged
    into the head rather than rebased onto it — no history rewritten, no
    force-push. The single conflict was in benchmarks/lynx-table/README.md: the
    base had acquired this PR's own FCP prose (see the note at the top), and this
    branch adds the recipe-link paragraph immediately after it. Resolved by keeping
    both — the base's text is unchanged and the paragraph sits after it. The
    remaining #245/#248/#249/#250 branches were checked against the same
    base and all merge clean.
  • Branch-name deviation. The harness assigned
    claude/octane-issue-66-phase-a-7wz97z, but create-a-pr mandates a topic
    branch so label-pr.yml can derive the type label. Topic branch used; flagging
    rather than silently picking a side.

Provenance

  • An agent produced this diff (agent-authored)

FCP@N was the one window with no cross-framework control. A pre-populated
first screen is a build-time define of the app source, so every vendored
reference reported it "not measured" and Octane could only be compared
against its own composed `startup + create@N` projection — a projection
whose own error was the only bound on how far it sat from a real first
screen.

Vendor ReactLynx built with a pre-populated first screen, one bundle per
row count, as `reference/react-first-screen`. It is a second set rather
than a rebuild of `reference/react` for exactly the reason that cell gave
for having no variant: rebuilding it would change the hash the featured
runs recorded. Vendoring beside it costs 316 KB and costs those runs
nothing.

The two are different builds — different upstream commits, different
`@lynx-js/react` — and that is disclosed rather than hidden. It is also
checkable: both cells run the same create window, and their host calls
per row is the control that says whether the two workloads still do the
same work. They agree at 21.001 each.

`reference/manifest.json` gains a `firstScreen` section naming the source
and pinning each digest. `papi-run.mjs` reads that section for which
scales it can offer, so a scale nobody vendored reports "not measured"
rather than failing against a 404, and re-checks each bundle against its
pinned digest on first use. This is the one cell whose bytes nothing here
builds, so what a run reports is only as good as the bytes it drove.

`stages/reference-manifest.test.mjs` makes the record binding: the pinned
bundles are present with the pinned bytes, the row keys are unique and
ordered, the tree carries nothing unpinned, and the two react artifacts
are still distinct. Red-verified by appending a byte and by adding a
stray file.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
The report has always split the Octane-minus-reference delta into candidate
owners with GO/NO-GO verdicts — for the create and startup windows. The
first-screen window had no such section, and could not: the delta needs
both cells to have measured FCP, and until `react-first-screen` no
reference ever had.

Compute it in `papi-run.mjs` beside the other two, and render it in
`papi-report.mjs`. Absent rather than zero when either side did not
measure the window: a missing delta is a window nobody ran, and nothing
downstream should be able to read it as a gap of nought. The `react` cell
in the checked-in run is exactly that case, in the same file as a cell
that did measure one.

The record it renders on, `results/c247-o1-*`, is the first run to carry
a reference first screen — octane, react and react-first-screen at 1,000
and 10,000 rows, five repetitions, one interleaved window. Its own
verdicts at 10,000: publication op count GO at 271.9 ms of a 476.4 ms
timed delta, off-boundary GO at 298.5 ms, and NO-GO for flush cadence,
first-paint scheduling, and per-element stream shape — Octane's calls are
cheaper per call than the reference's, and it makes 100,081 more of them.

Red-verified by removing the guard: the new test goes red, and so do the
two beside it, which is the guard doing its job on a delta that has no
FCP member.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Huxpro and others added 3 commits August 30, 2026 11:39
`c247-o1-direct` is the same cells, the same scales and the same five
repetitions as `c247-o1`, on the same code, in a separate window. It is
here because a ratio nobody has repeated has no known resolution.

Repeated, it does: the two windows put octane over react-first-screen at
FCP@10,000 at 1.411x and 1.452x. That +-0.04 is the floor any
first-screen improvement claim has to clear, and repeating the *control*
arm rather than only the candidate is what made it visible.

The buckets it bounds, read against `c247-o1`: bundle eval plus boot
lands at 2.0% and 2.3% of the gap, and the off-boundary delta at 298.5
and 291.4 ms — stable. The host-boundary render delta is 128.1 against
63.2 ms, which is not, because the timed probe's overhead on the
reference cell varied 6.8% between windows while its control wall varied
1.2%. That bucket is reportable as row-scaled and second-largest, not as
a number.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
#247 asked for Cause A to be measured in this window rather than guessed.
This is that measurement, and the finding is parity: after the fold,
Octane's first screen issues the same count of every element-creating and
tree-shaping call as ReactLynx's — __CreateView, __CreateText,
__CreateRawText, __AppendElement, __SetClasses and __AddEvent all
identical, zero spread across five repetitions. The whole residual is the
adoption read (6 per row against react's one call in total), two extra
attribute writes per row, and one extra flush.

Total host calls at FCP@10,000 go 310,195 to 290,169; the gap to react
goes +100,081 to +80,055.

Its wall clock is not claimed. The ratio reads 1.441x here against 1.411x
and 1.452x for two windows of unchanged code, so the reading sits inside
the same-code spread.

Provenance, which the record's own meta does not carry: the octane arm is
this branch's cell driven against the head of the static-text fold, the
two merged in a local branch that was never pushed. Reproducing it needs
both — this branch for the react-first-screen cell, the fold for the
octane one. The react arm is this branch's vendored bundle, unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
…tion

#247 Order 1's four-bucket split lived only in an issue comment. The instrument
is documented in the bench README, but the procedure built on it was not: which
buckets a fair boundary can separate, what denominator the shares use, and what
resolution the result has.

Writes down the part that is load-bearing and easy to get wrong:

- buckets 1 and 2 are irreducibly fused, because sliceStartEpoch precedes the
  browser's load/parse/eval and the only framework-agnostic event in that window
  is the first host call — a limit of a fair boundary, not a missing probe;
- bucket 4 is a named exclusive remainder, so it cannot nominate an owner however
  large it is, which is the #230 rule applied to this window;
- the share denominator is the octane-minus-reference wall, not the sum of the
  bucket deltas — dividing by the latter forces the shares to 100% and discards
  the median non-additivity, which is real;
- the workload control (create ops/row agreeing across two different react
  builds) is what licenses any delta between them.

And the bound worth carrying forward: two windows of identical code put the
octane/react FCP@10k ratio at 1.411x and 1.452x, so a single-window ratio here
resolves to +/-0.04. That is wider than most changes move it, which is why the
counts are the oracle and the milliseconds only size things. Establishing it
needed the control arm repeated, not just the candidate — the step usually
skipped.

Every figure is recomputed from the checked-in c247-o1 and c247-o1-direct
records rather than restated from the report.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
…first-screen-cell

# Conflicts:
#	benchmarks/lynx-table/README.md
Huxpro and others added 2 commits August 30, 2026 13:11
…ed for

docs/measurement/heap-after-clear.md opens by noting that grepping
benchmarks/ for heapMtsAfterClear returns nothing and invites the
conclusion that #241's retention oracle is unmeasurable. Nothing in
benchmarks/ pointed back at it, so that grep still returned nothing and
the recipe fixed only half the problem it named. The bench README now
carries the pointer beside the FCP one.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy

Huxpro commented Aug 30, 2026

Copy link
Copy Markdown
Owner Author

Base merge onto the live new-lynx, plus the orphaned-recipe pointer

This branch was 11 commits behind the live base, not level with it. Its
previous merge (2da33ba1) took an earlier new-lynx — the one carrying
#235/#237/#238/#239/#240 but not #243/#245/#248/#249, which landed afterwards.
Since the PR is out of draft, the "head contains the live base" gate applies, and
it did not. Merged origin/new-lynx (432c6485) in as 07164ed9; clean this
time, no conflict, no force-push.

Owning surface re-run on the merged head: node --test stages/*.test.mjs —
184 tests, 18 suites, 0 failures. pnpm sync clean.

The second commit: a recipe that fixed half the problem it named

docs/measurement/heap-after-clear.md arrived in this branch with the base
merge, and its own first paragraph says:

Grepping benchmarks/ for it returns nothing and invites the conclusion that
the oracle is unmeasurable.

Nothing in benchmarks/ pointed back at it — I checked the whole repo, and the
file was referenced by zero other files. So that grep still returned nothing,
and the recipe cured the half a reader never reaches. dbeb236d adds the pointer
beside the FCP one in the bench README, so both recipes are reachable from the
directory where someone actually looks.

This is the same amendment that put the recipe there in the first place — a
metric self-certifies and its recipe is in a repo
— with the observation
that "in a repo" is not yet "findable from where you would look for it".

CI

Still not executing. classify changeset release on this PR's earlier run
(33312665521) never
left queued, and neither has the new-lynx push run
(33312574787) — two
different concurrency groups, so not queued behind one another. The last ci.yml
run to reach success was on 2026-08-27. Root cause not established;
recorded as hypothesis, not verdict. The push above created a new run, which will
show whether that has cleared.


Generated by Claude Code

… no rows-0 digest

The rows-0 fallback path drove the cell's startup and create windows from
unverified bytes whenever reference/manifest.json was unreadable or lost
its pin — while the surrounding comments promise the opposite. The cell
now refuses, the same way its FCP windows already report 'not measured'
rather than substituting.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YHfFsy9CLaRovTFH8pTGyY
@Huxpro
Huxpro merged commit 4ef55c3 into new-lynx Aug 31, 2026
1 check failed
Huxpro added a commit that referenced this pull request Aug 31, 2026
#254's base branch bench/lynx-react-first-screen-cell landed in new-lynx as
#251, so the PR retargets to new-lynx and takes the base directly.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Huxpro added a commit that referenced this pull request Aug 31, 2026
… which window it comes from

The phase split invites two different shares and #254 reported them by hand.
Only one of them is section 3's: framework excess over the FCP gap is a claim
about the reference, while framework over Octane's own bucket 4 is a
composition statement about one cell that says nothing about it. Quoting the
second as the first overstates the finding by about 22 points, so the report now
emits both with their denominator named beside them and no reader has to
reconstruct either.

The gap denominator is the timed FCP walls, the same one attributeDelta divides
by and the window the numerator's off-boundary terms come from. Taking it from
the control walls instead divides a timed numerator by an uninstrumented
denominator, and the mismatch is not small: it moves this share from 61.6%/61.9%
across the two same-code windows to 68.0%/85.0%. Both the unit test and the
rendered-report test fail on that substitution, and were seen to.

fcp-attribution.md gains the two subsections the split was missing: which
denominator each share uses and why they are not interchangeable, and the
split's own resolution measured the way section 3 measured the ratio's. Section
3's +/-0.04 is the resolution of a single-window FCP ratio and does not transfer
here. From the two same-code windows, the gap share replicates to 0.003 and the
own-bucket share to 0.027, while frameworkMs spreads 11.2% and 11.5% within a
single window -- the derived shares are steadier than the terms they are built
from, because a hot window is hot for both cells and the common-mode drift
divides out of a ratio taken inside it. It does not divide out of a millisecond.

Also records that frameworkMs and residueMs are medians of their own per-sample
series, so summing the four phase medians by hand gives a different and wrong
answer, and that #254's base branch landed in new-lynx as #251, which this
merge takes directly.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants