Skip to content

test(bench): Phase 0 update-path attribution — delta candidate is NO-GO - #100

Merged
Huxpro merged 4 commits into
new-lynxfrom
test/lynx-stage-decompose-mutations
Aug 20, 2026
Merged

Huxpro merged 4 commits into
new-lynxfrom
test/lynx-stage-decompose-mutations

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

Issue #66's revised Phase 0 asks for update-path attribution before betting on the A4/A5 wire cutover, with an explicit decision gate. This is that measurement and its verdict.

The stage harness decomposed only create, replace, and append. update10th, updateStorm, and select — the operations A4/A5 targets — existed only as wall-clock totals from web/run-web.mjs, so the gap to the architecture floor had no owner. This adds all three cells and records the result.

The gate fails by an order of magnitude. Measured on the real dual-thread web-core path (n=5, same window, AB/BA, fresh page per sample, quiet host):

cell mt_prepare + wire_clone_transfer bg_replay presentation_residual
update10th@10k 3.4% 49.5% 33.1%
updateStorm@10k 2.3% 12.3% 74.9%
select@10k 0.1% 62.0% 35.7%

A typed delta plus main-thread slot dispatch can only remove host prop-patch planning and wire cost. Against a 10% owner gate those are 3.4% / 2.3% / 0.1%.

The sharpest form of the finding: select flips one row's class in a 10,000-row table, sends 289 B, and spends 126.7 ms on the background thread producing them. bg_replay is instrumented from the native event batch arriving on the background thread until the commit message is ready, so it covers event dispatch, render, reconcile, and batch construction. The wire output is already proportional to the change; the time to produce it is proportional to the tree. No wire representation reaches that.

The conclusion survives the instrumentation caveat. Profile/control is 1.40× on update10th and 1.47× on select — the largest of any cell. Charging that entire delta to bg_replay still leaves it at 29.4% and 44.4%, an order of magnitude above the delta candidate. updateStorm sits at the flush/layout floor (74.9%) exactly as the revision predicted, bounding what any upstream change can win there.

Per the gate's own terms ("the gate's output outranks the original plan"), Phase 2 needs re-aiming at background render/reconcile. delta-protocol.ts remains worth completing for correctness and the header-only validation simplification (§3.4), but must not be justified by update-path milliseconds.

Changes

  • benchmarks/lynx-table/stages/operations.mjs (new): the measured operation table as plain data. run.mjs launches Chromium at import time and could not be tested, so the table lives here. Adds update10th (button, predicate derived from the pre-click label), updateStorm (fifty rounds, its own long deadline), and select (row-cell click) alongside the existing cells.
  • benchmarks/lynx-table/stages/operations.test.mjs (new): pins create/replace/append against their pre-change click targets and predicates so the published attribution stays comparable across sessions, plus the new cells, the derived-predicate rules, and the deadline split.
  • benchmarks/lynx-table/stages/run.mjs: click plumbing generalized to button and cell targets with per-operation deadlines; sampling, reporting, and markdown driven off the table. The reported mutation list is derived from the table rather than listed beside it, so an added operation cannot be measured and then silently omitted from the report.
  • benchmarks/lynx-table/stages/results/live-10000.{json,md}: re-measured with all six cells.
  • docs/lynx-specialized-target-l0.md §8: the Phase 0 entry, the gate verdict, and the consequence for the roadmap.

Validation

  • pnpm format:check
  • pnpm typecheck
  • pnpm test — started against this diff; result reported in a follow-up comment. The diff touches only benchmark harness files and docs, no published package source, and no vitest project covers stages/.
  • targeted tests: node --test benchmarks/lynx-table/stages/*.test.mjs → 17/17, run from the repo root.

Red-green verified, per the issue's §1 discipline — ten deliberate breaks, each confirmed to fail and then restored:

break caught by
append predicate 2000 → 2001 established-cells equivalence
select row 1 → 0 pure-mutation cells
update10th set up at 1k instead of the create scale pure-mutation cells
mutation list hardcoded, dropping select report-completeness
missing-label guard removed from derivedPredicate derived-predicate
replace setup predicate follows the create scale scale test
storm loses its long deadline deadline split
storm deadline applied to every cell deadline split
storm predicate bench 50 → bench 49 pure-mutation cells
storm measured at 1k pure-mutation cells

Measurement conditions (per benchmarks/lynx-table/README.md): 4-CPU container, load 0.32/4 at start; n=5 per A/B cell; control/profile alternating AB/BA; one vue-vdom pass per pair; fresh page per operation sample, each mutation cell re-creating its own table first; no other benchmark process in the window. Absolute milliseconds are host-bound and are not comparable with the 32-core sessions recorded elsewhere in spec §8 — only the within-window shares and ratios are.

Risk / follow-ups

  • No published package source changes; this is harness, results, and spec only.
  • The 4-CPU host makes this a shares-only result. If the owner wants absolute numbers comparable to the earlier sessions, it needs a re-run on the 32-core host — the shares are what the gate turns on, and they are unambiguous.
  • stages/analyze.test.mjs resolves packages/lynx/... via path.resolve against the cwd, so it only passes when run from the repo root; pnpm test:stages runs from the package directory and fails on that test. Pre-existing and untouched here, but worth a follow-up.
  • The harness writes JSON.stringify(report, null, 2), which is not Prettier-clean, so every run leaves results/*.json needing a format pass before commit. Pre-existing.
  • Phase 1 (delta protocol v2, per L2 (#58): Lynx background core + typed slot-delta protocol (kernel-extraction spike first) #61's closure analysis) is unaffected by this verdict and proceeds on correctness grounds. Phase 2's aim is what changes.

Provenance

  • An agent produced this diff (agent-authored)

Generated by Claude Code

Huxpro and others added 3 commits August 19, 2026 18:23
The stage harness attributed create, replace, and append, so the two
operations issue #66 A5 actually targets had a wall-clock total from the
web harness and no owner. Deciding whether a typed delta plus main-thread
slot dispatch is worth a wire ABI change needs the share `mt_prepare` and
`wire_clone_transfer` hold on a pure prop mutation, and that number did
not exist.

Add both cells. Each sets up its own table at the create scale and then
mutates it without creating or destroying rows, so whatever it costs is
replanning, wire, and host apply. `select` clicks a row cell rather than a
button, and `update10th` stamps a suffix onto a label the setup click
chose, so its predicate is only knowable once the table exists; both go
through the shared driver primitives the other cells already use.

The operation table moves to `stages/operations.mjs` because `run.mjs`
launches Chromium at import time and could not be tested. The equivalence
test pins the create, replace, and append cells against the pre-change
behaviour, so the published attribution stays comparable across sessions.
The reported mutation list is derived from the table rather than listed
beside it, so an added operation cannot be measured and then silently
left out of the report.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Issue #66's revised Phase 0 requires update10th, select, and updateStorm
decomposed on the real dual-thread path. The storm runs fifty rounds back
to back and cannot finish inside the per-operation deadline the other
cells share, so the operation table now carries an explicit timeout and
only the storm gets the long one.

The storm is expected to sit at the flush/layout floor rather than in any
segment a wire or replanning change could reach, which is what makes it
the bound on the other two cells rather than a target of its own.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
The revised Phase 0 asks whether wire plus main-thread prop-bag replanning
explains the update path's gap to the architecture floor. Measured on the
real dual-thread web-core path, n=5, same window: those two segments are
3.4% of update10th, 2.3% of updateStorm, and 0.1% of select, against a 10%
owner gate. The gate fails by an order of magnitude.

What owns the update path instead is background render and reconcile:
49.5% of update10th and 62.0% of select. The sharpest form of it is that
select flips one row's class in a 10,000-row table, sends 289 bytes, and
spends 126.7 ms on the background thread producing them — the output is
already proportional to the change while the time is proportional to the
tree. No wire representation can reach that.

The conclusion survives the instrumentation caveat: profile/control is
1.40x on update10th and 1.47x on select, and charging that entire delta to
background replay still leaves it at 29.4% and 44.4%. updateStorm sits at
the flush/layout floor at 74.9%, bounding what any upstream change wins.

Per the gate's own terms its output outranks the original plan, so the
delta protocol should be completed for correctness and validation
simplification but must not be justified by update-path milliseconds.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Picks up #98's wire-safe prop journalling in the direct first-screen applier,
which the stack branched before. Without it `web-host.test.ts` fails: a
`main-thread:` event prop stays a tagged callable in the snapshot that crosses
the ContextProxy wire.

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