Skip to content

docs(bench): measure what the L5 main-thread repayment is worth - #125

Merged
Huxpro merged 3 commits into
new-lynxfrom
docs/lynx-l5-ceiling
Aug 21, 2026
Merged

Huxpro merged 3 commits into
new-lynxfrom
docs/lynx-l5-ceiling

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

#103 §5's last item is the L5 bundle repayment, and #58 states it as deleting
"the plan interpreter, batch pipeline, and recursive validator from the
main-thread bundle". #114 established that the ≤1.5× gate is missed and that none
of the three is deletable yet. Nobody has said what the deletion is worth —
which is the one number the cutover decision #115 handed to the owner is missing,
and the only part of L5 that can be produced without the native evidence #66 §6
says this container cannot produce.

This measures it. It deletes nothing and flips no default.

arm preview main gzip ratio vs median rows-0 main gzip ratio
baseline 81,068 1.582× 60,683 1.185×
recursive validator 73,000 1.425× 53,376 1.042×
plan interpreter + batch pipeline 55,139 1.076× 40,657 0.794×
both 46,411 0.906× 33,178 0.648×

The repayment is worth 34,657 B gzip — 42.7% of the Lynx main-thread program —
and the gate's gap is 4,226 B, 12.2% of it.
A repayment that collects an eighth
of what is on the table still closes the preview arm. Either half clears it
alone; the IFR arm needs the batch pipeline, where the validator alone falls
976 B short.

Two things it deliberately does not say. It does not close the
complete-artifact ratio #58's motivation quotes — 3.214× at baseline, 2.361×
with both gone — because L5 is a main-thread gate and the artifact gate is a
larger, separate question. And the halves may not be added: compressed deltas are
non-additive, and here they are slightly super-additive (8,068 + 25,929 against
34,657 measured together), because each half opens removals in the other.

Why a ceiling is the honest form

Each arm removes its target by exported entry and lets production
tree-shaking compute the closure. That is what keeps it from over-claiming: a
helper the direct first-screen path still calls stays in the bundle and is not
counted against the repayment.

It is still an upper bound, because each arm deletes outright where the shipping
change replaces. #66 §3's exit gate keeps header checks on delta traffic; this
keeps none. prepareLynxHostBatch stays reachable while the staged path is the
direct applier's native-<list> fallback and while the universal path is the
transition core per #103 §4; this removes it unconditionally. The repayment
collects less than the number above — which is exactly why the relevant
comparison is against a 4,226 B gap rather than against the ceiling itself.

The control

An ablation may delete machinery, never application.

  • Every arm reproduces the baseline's IFR main-thread visible-tree checksum and
    background-program semantic checksum exactly. The tool fails the run if one
    moves.
  • The batch arm leaves the background program byte-identical on both
    fixtures — independent evidence that prepareLynxHostBatch is main-thread-only
    code, and a live check that the ablation reaches only what it names.
  • The baseline reproduces byte-for-byte across runs, so every delta is signal.
    These are deterministic bytes, not wall clock; no host-quiet claim is involved.

Changes

  • benchmarks/lynx-bundle-size/l5-ceiling.mjs — new. An operator tool, not a CI
    gate: it rewrites packages/lynx/src/core so a production build can be taken
    with a target absent, refuses to start unless those sources are clean so the
    restore can never lose work, and restores in a finally so an aborted run
    leaves the tree as it found it. Arms are selectable (--arms, --harness).
  • benchmarks/lynx-bundle-size/results/l5-ceiling.md — the execution report.
  • benchmarks/lynx-bundle-size/README.md — documents the tool beside the two
    suites it drives.
  • docs/lynx-specialized-target-l0.md §8 — the numbers, against §6's existing
    list of what the specialized path deletes.

Validation

  • pnpm format:check (repo-wide, clean)
  • pnpm typecheck (repo-wide, clean)
  • pnpm test — 8 failed / 21,058 passed / 8 skipped across 2,197 files,
    3,755 s wall. This diff adds a benchmark script, a report, a README
    section, and a docs section; it changes no package source and no test. The
    first run's console capture was truncated, so a second full run is in
    flight to attribute every failing file individually; this section will be
    updated with that list. The three visible in the first capture were
    rspeedy-plugin native-demo (pre-existing per Execution plan (#58): complete L2, then drive L4→L6 — full context handoff #66 §2.3), docusaurus
    hydration, and syntax-highlighter negative-controls.
  • node benchmarks/lynx-bundle-size/l5-ceiling.mjs — full four-arm run,
    reproducing every number in the report, with the semantic-checksum control
    passing and the working tree clean afterwards
  • node benchmarks/lynx-bundle-size/inventory.mjs — baseline reproduces
    byte-for-byte across repeated runs

No package source changes, so no changeset: this adds a benchmark tool and
documentation.

Risk / follow-ups

Provenance

  • An agent produced this diff (agent-authored)

Generated by Claude Code

#58's L5 bullet states the repayment as deleting "the plan interpreter, batch
pipeline, and recursive validator from the main-thread bundle", and #66 §6 makes
it a cutover gate against 1.5x the reference median. The re-audit established
that the gate is missed and that none of the three is deletable yet. Nobody has
said what the deletion is worth — which is the number the cutover decision is
missing, and the only part of L5 that can be produced without native evidence.

Four arms, deterministic bytes, both fixtures. On the gated fixture's preview
main program: baseline 81,068 B gzip (1.582x), recursive validator gone 73,000
(1.425x), plan interpreter and batch pipeline gone 55,139 (1.076x), both gone
46,411 (0.906x). On the rows-0 app: 60,683 -> 53,376 -> 40,657 -> 33,178, or
1.185x -> 0.648x. The two fixtures disagreed about the gate in the re-audit and
do not disagree about this.

The repayment is worth 34,657 B gzip, 42.7% of the Lynx main-thread program, and
the gate's gap is 4,226 B — 12.2% of it. A repayment collecting an eighth of what
is on the table still closes the preview arm. Either half clears it alone; the
IFR arm needs the batch pipeline, where the validator alone falls 976 B short.

Two things this does not say. It does not close the complete-artifact ratio #58's
motivation quotes, which walks 3.214x -> 2.361x across the arms: L5 is a
main-thread gate and the artifact gate is a larger, separate question. And the
halves may not be added — compressed deltas are non-additive, here slightly
super-additive, because each half opens removals in the other.

Each arm removes its target by exported entry and lets production tree-shaking
compute the closure, so a helper the direct first-screen path still calls stays
and is not counted. It remains an upper bound: the exit gate keeps header checks
where this arm keeps none, and prepareLynxHostBatch stays reachable while the
staged path is the direct applier's native-list fallback. What the repayment
collects is less, which is why the comparison that matters is against the gap.

The control is that an ablation may delete machinery, never application. Every
arm reproduces the baseline's visible-tree and background semantic checksums or
the tool fails the run, the batch arm leaves the background program
byte-identical on both fixtures, and the baseline reproduces byte-for-byte.

The tool is an operator tool, not a CI gate: it rewrites packages/lynx/src/core
so a production build can be taken with a target absent, refuses to start unless
those sources are clean, and restores them in a finally.

The two halves are also blocked differently. The send side is already
development-only; the receive side is not, and its failure path is load-bearing —
it recovers the sender's identity and settles a pending call rather than only
reporting. So the validator half is a scoped replacement rather than a deletion,
and its 8,068 B is the loosest of the three bounds. The batch half's blocker is
coverage, not posture.

Refs #103, #66.

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

Huxpro commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

Validation note, correcting the body's Validation section rather than rewriting it.

The second full run this PR promised — the one that would attribute every failing
file individually — did not finish. The owner has paused this direction in favour
of the B0 wiring slice, so I stopped it rather than hold the machine for another
40 minutes on a diff that changes no package source and no test.

What stands is the first run: 8 failed / 21,058 passed / 8 skipped across 2,197
files, 3,755 s
. Of the failures, only the last three survived that run's console
capture — rspeedy-plugin native-demo (pre-existing in this container per #66
§2.3), docusaurus hydration, and syntax-highlighter negative-controls. The
other five are unattributed, and I am not going to characterise them from a
truncated log. The per-file attribution is outstanding work on this PR, not a
claim it has already passed.

Everything else in the Validation section holds as written: pnpm format:check
and pnpm typecheck clean repo-wide, the four-arm ablation reproducing every
number in the report with its semantic-checksum control passing and the tree
clean afterwards, and the inventory baseline reproducing byte-for-byte.


Generated by Claude Code

Huxpro commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

The per-file attribution this PR owed

The earlier note said the second full run did not finish and that five of the eight failures were unattributed — outstanding work, not a passing claim. That run has now been done, on a quiet host, and it discharges the promise.

pnpm test -- --silent=passed-only        # docs/lynx-l5-ceiling @ ae2f10db4

4 files failed / 2193 passed (2197); 4 tests failed / 21,070 passed (21,074); 2,512 s. Host load 0.16 at start, 4.34 at end (1-minute, 4 CPUs).

Because this branch is the tip of the stack, its tree contains #121 + #122 + #124 as well as this PR, so the run is validation evidence for all four.

Every failure, attributed

failing file failure attribution
octane-events-browser suspense-hydration.test.ts — "restores focused input and its selected text after a keyed DOM reorder" expected [0, 0] to deeply equal [2, 9] Real-browser selection assertion in packages/octane. Untouched by this stack.
drei-adapted-browser upstream-e2e.browser.test.ts — "should match previous one" page.waitForFunction: Timeout 30000ms exceeded Root cause is in the same log: Could not load potsdamer_platz_1k.hdr: Failed to fetch. An external asset fetch this container cannot make, in packages/drei.
dropzone probes/hydration.test.ts Test timed out in 5000ms packages/dropzone. Untouched by this stack.
rspeedy-plugin native-demo.test.ts — "escalates cleanup for a detached descendant after its leader exits" stopProcessTree resolves false Pre-existing per #66 §2.3. Process-tree reaping in a Linux container.

Why these are the container's and not the stack's

Not an argument from the diff — an argument from a second branch. The B0 branch (claude/octane-issue-66-phase-a-7wz97z, based on new-lynx, sharing nothing with this stack) ran the full suite in the same container and failed five files: these same four, plus alien-signals hydration.test.ts. Four files failing identically on two unrelated branches is the evidence; the fifth is what separates the two classes.

The other four from the first run were load, not defects

The first run reported 8 failures in 3,755 s and named docusaurus hydration and syntax-highlighter negative-controls among them. Both passed here, on the same tree, in a run 1,243 s shorter. So does alien-signals hydration.test.ts, which failed on the B0 branch. That is the load-sensitive class: fixed-deadline hooks and 5-second test timeouts that only miss when 2,197 files are contending for 4 CPUs. It is worth naming rather than burying — a run long enough for the container to fall behind manufactures failures, and reporting "8 failed" without separating them would have overstated the problem by a factor of two.

None of the four persistent failures is in a package this stack changes: #121/#122/#124 touch packages/lynx and packages/octane's universal core, and this PR touches only docs/ and benchmarks/.


Generated by Claude Code

With --harness inventory no checksums exist, so the semantic-checksum
control silently skipped and an ablation that changed the authored
application would have printed its byte deltas as if validated. The tool
now warns loudly in that mode instead of implying the control passed.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YHfFsy9CLaRovTFH8pTGyY
@Huxpro
Huxpro changed the base branch from feat/lynx-universal-prop-equality to new-lynx August 21, 2026 21:04
@Huxpro
Huxpro marked this pull request as ready for review August 21, 2026 21:04
# Conflicts:
#	docs/lynx-specialized-target-l0.md
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