Repository navigation
bench(lynx-table): price the main-thread program cell on both harnesses - #181
Merged
Merged
Conversation
Issue #163 C4b. Adds `octane-mts-program` — the lynx-table application built with the main-thread program backend — to the web wall-clock harness and the FCP ladder, documents it in the README, and commits the records. The two arms differ in exactly one thing, and it is measured rather than asserted: across the backend switch the background chunk is byte-identical (285,413 bytes, sha256 9b5e9e5df496...) and the main-thread chunk moves 700 bytes. After adoption both cells run the same background code over the same wire, which is what makes everything the cell reports an A/B of the first-screen encoding and nothing else. #148's corollary holds: every update op's band overlaps its `octane` band in the same window, at both scales, n=7. Two are marginal and in the same direction as an earlier session, `create` and `update10th` at 10,000 rows, and the mechanism that would have explained them is ruled out — both cells hold the same 28 selectors after one create. #163's first-screen oracle does not hold. The compiled program lands at 1.24-1.38x the hand-written `octane-direct` ceiling across 1k/10k/30k, closing 42-54% of the interpreted-to-ceiling gap against an oracle that asks for 1.05x. Two measurement fixes were needed before either number could be read: - The ladder's `selector attrs` column is sampled after settle, which for a program-painted cell reads what the adopting commit decided rather than what painted. It now samples the regime at the first painted frame as well, twice per cell; there the program cell is 1000/0, 10000/0 and 30000/0 in every reading. The settled column's 4,028-or-0 alternation at 1,000 rows is therefore a post-first-frame install, not a first-screen path that varies. - `prototype/adoption-probe.mjs` is new: node identity across a hold, so an FCP number can be read as adoption rather than a fast paint followed by a repair. All four cell/scale pairs measured are adopted. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
This was referenced Aug 25, 2026
Huxpro
marked this pull request as ready for review
August 26, 2026 08:26
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 #163 C4b. The
octane-mts-programcell: the lynx-table application builtwith the main-thread program backend, wired into both harnesses that can price
it, plus the README section and the committed records. This is the slice that
produces C4's numbers, and it reports one of #163's two update-band oracles met
and the first-screen oracle not met.
Why
C4a proved a program-painted page takes ordinary updates over the real
transport. It could not say what they cost. #163's oracle asks two separate
questions of C4 and this slice is where both get asked of the real application
rather than a fixture:
octane-directat 1k/10k/30k.improves it.
Neither is answerable without a cell, and a cell is only worth trusting if the
two arms differ in exactly one thing. They do, and it is measured rather than
asserted: across the backend switch on this application the background chunk
is byte-identical (285,413 bytes, sha256
9b5e9e5df496…) and the main-threadchunk moves by 700 bytes (216,547 → 217,247). After adoption both cells run the
same background code over the same wire, which is what makes an update-band
difference between them a finding rather than a build artefact.
Results
Oracle 2 — update bands: met
Same window, n=7, cells interleaved AB/BA, medians in ms (
prototype/results/web-c163-c4b-update-bands.*):octane+programoctane+programAll twelve bands overlap. Two are marginal and in the same direction an earlier
session saw —
create(+1.6%) andupdate10th(+4.8%) at 10,000 rows — andneither is explained; see follow-ups.
Oracle 1 — first screen: not met
Medians of n=7, fresh page per sample, AB/BA, same window per scale
(
prototype/results/fcp-{1000,10000,30000}.*):octane+programoctane-direct+program ÷ directThe oracle asks for 1.05×. The compiled first screen closes between 42% and 54%
of the distance from today's interpreted page to the hand-written L0 prototype,
and no more. That is a real and reproducible improvement — 16.5%, 18.4% and
22.4% off
octane's own FCP at the three scales — and it is not the oracle.octane-directis not a cell Octane ships: it is this one page emitted by codewritten for this one page, with nothing between the entry point and the PAPI. It
is the floor a compiled program aims at. What the residual 1.24–1.38× is made of
is the question C4b cannot answer and the next slice is scoped to: PAPI crossings
versus composition versus the publication floor, decomposed at the host boundary
by
stages/papi-run.mjs.The measurement this slice had to fix first
The FCP ladder's
selector attrscolumn samplesoctane-refafter settle. Foran interpreted page that is the same as sampling at paint, because the
interpreter installs one selector per node on the way to the first frame. For a
program-painted page it is not: a compiled program installs none, and whatever
the adopting commit decides afterwards lands on top of that — so the settled
column can report the interpreted regime for a page the interpreter never
touched. At 1,000 rows it read 4,028 in three of seven otherwise identical
repetitions and 0 in the other four.
Rather than annotate that away, the ladder now samples the regime at the first
painted frame, on its own pages after the timed reps so the timed path stays
byte-identical to every prior run on this ladder. Asked at that moment the
program cell is
1000/0,10000/0and30000/0in every repetition at everyscale, and
octaneis1000/4028,10000/40028,30000/120028. The programpainted; the 4,028 lands after the first frame, cannot move FCP, and never
exceeds what
octanehas already paid before its own.Two further controls back the numbers up:
prototype/adoption-probe.mjstags every row element at the first painted frame and counts survivors four
seconds later, because a repair builds different elements and would keep none.
Both
octaneandoctane-mts-programkeep all of them at both scalesmeasured — 1,000/1,000 and 10,000/10,000. FCP here is an adoption number and
reads against
octane's directly, which is exactly what theoctane-blockcell's does not.
rangesis not a probe for this build. On the small fixture../lynx-bundle-size/core-switch.mjscompiles, searching the decodedmain-thread script for a compiled program's
rangeskey separates thebackends. On this application it does not:
packages/lynx/src/core/main-renderer.tsships its own runtime into botharms' main-thread chunk and carries the identifier with it. The first-frame
selector regime is the probe that works here; the byte comparison is what says
the backend switched at all.
Changes
benchmarks/lynx-table/app/lynx.config.mjs—BENCH_MTS_PROGRAM=1hands thecompiler the main-thread program backend and moves the dist path. Both the
TypeScript-source hook and the backend import are dynamic and behind the flag,
so a default build loads neither.
benchmarks/lynx-table/scripts/build-app.mjs—buildTableApp({ mtsProgram })and the matching dist suffix. Orthogonal to
core, because it moves the otherchunk.
benchmarks/lynx-table/web/run-web.mjs— theoctane-mts-programcell, andthe auto-build branch that produces its bundle.
benchmarks/lynx-table/prototype/run-fcp.mjs— the same cell on the FCPladder, picked up automatically once its bundle exists, plus the first-frame
regime sample described above.
benchmarks/lynx-table/README.md— the cell's section, in the shape theoctane-blockone uses: what it is, what makes the A/B honest, and the fourthings that must travel with any number from it.
benchmarks/lynx-table/prototype/results/fcp-{1000,10000,30000}.*— thecommitted records.
documentation and records.
Validation
Run on
c4e791b6b:pnpm sync— clean, no generated changespnpm typecheck— pass, zeroerror TSvitest run --project octane --project octane-prod --project lynx—893 files, 13,172 tests, all passed (434 s)
node benchmarks/bench.mjs --only lynx-table --ratios— PASS, 26/303guards checked, no ratio guard breached
pnpm format:files:checkon every changed file — cleannode benchmarks/lynx-bundle-size/core-switch.mjs— FAILS, see belowpnpm test(full) — not run; the three projects above are the ones thistrain touches
The
core-switch.mjsgate is red, and it is red at the base commit. Itexits 1 with
universal carries a compiled program without a backend; the probe is not specificfor both the universal and block arms. The cause is exactly therangesfinding above:PROGRAM_PROBE = 'ranges'(core-switch.mjs:86) issearched in the decoded main-thread script, and the Lynx main renderer now ships
its own runtime — containing that identifier — into every main-thread chunk,
so the probe no longer discriminates. This diff touches
benchmarks/lynx-table/**and nothing else (git diff --name-onlyoutside thatdirectory is empty), so it cannot have caused it; a C2 slice did, when the main
renderer gained program-mount code.
#148's corollary requires these invariants to hold on every landed slice, so the
probe is being rewritten as the next slice rather than left. The sha256 column
the script already prints discriminates correctly today —
universalandblockare both24887887acc3,block+programisb478af615c53— which isthe natural basis for a probe that means what its label says. #163's
byte-identity promise itself is intact and independently confirmed on the real
application here.
Risk / follow-ups
core-switch.mjsis red at base and its probe is being rewritten as thenext slice. Details in Validation above.
attribution slice through
stages/papi-run.mjsis what can say whether theremaining distance is reachable at all, and it starts next.
create(+1.6%) andupdate10th(+4.8%) medians are unexplained.Both overlap; the obvious mechanism is ruled out — after one create at 10,000
rows both cells hold the same 28
nodes-refselectors (shell 28,after-create 28, over 20,000 content nodes), so this is not per-node selector
work carried over from adoption.
the same page decides differently at 1,000 and 10,000 rows, is open. The
leading unproven explanation is that an adopting batch loses the lazy path:
acceptedLazyPublicInstances(host-driver.ts:5081) requiresfirstTree === undefined, and the apply-time create athost-driver.ts:~6913falls back to
bindNodesRefSelectorwithout it. It cannot move FCP either way.wire is the background's, and the background chunk is the half that does not
move.
mainThreadProgramBackendstays opt-in(
packages/rspeedy-plugin-octane/src/plugin.jsguards every use on!== undefined), so no product default changes with this slice.Expectation management (restated per #157, as every C-report must)
Of the 11.5 s native create-1k, 10.52 s (91%) is host-driver interpreter
dispatch and bookkeeping on LepusNG, which has no JIT. All 20,001 PAPI
crossings cost ~574 ms, of which the single
__FlushElementTreeis 431 ms —larger than ReactLynx's entire 194 ms pipeline. DevTool adds 885 ms and stays
disabled in any device cell (#161). No C-slice claims ReactLynx parity. What
the C-train claims is the removal of the interpreter bucket; what remains after
it is what gets measured, and the native frontier then moves to #162.
Provenance
agent-authored)Generated by Claude Code