Skip to content

test(bench): re-run the #103 U0 ceiling against the real block core - #107

Merged
Huxpro merged 3 commits into
new-lynxfrom
test/lynx-u0-block-counts
Aug 20, 2026
Merged

Huxpro merged 3 commits into
new-lynxfrom
test/lynx-u0-block-counts

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Issue #103's §5 closes U2 with "re-run the U0 harness to verify the real slice".
This is that run.

U0 measured the update path's architectural ceiling with a hand-written op
emitter that kept its rows in an array, and reported beside it a second column —
"keyed block lookups", what a keyed core would touch — derived by hand, because
at the time there was no keyed core to ask. U2 (#105, #106) built one. This asks
it, and replaces the prediction with the counter the core keeps itself.

benchmarks/lynx-table/block-workload.ts drives the real LynxBlockCore over
the same operation ladder run.mjs uses, on the same chassis: the same
cross-wired ContextProxy pair, the same fake Element PAPI, the same real
main-thread receiver, the same __OCTANE_LYNX_PROF accounting. Only the
background core differs. That is what makes a count here comparable to the
octane-lynx column rather than merely adjacent to it.

Why

Two columns, because one of them would over-claim alone. Both run the real
core over the real transport, and differ only in which entry point a state change
reaches:

  • scoped — what a compiled block program with per-row reactive slots would
    do: write the changed rows' slots by key.
  • reconcile — what the app's own setRows(next) does today: hand the whole
    next list to the keyed reconciler.

At 10,000 rows (blockLookups, the core's own counter):

op commits commands wire bytes scoped reconcile floor
create 1 1 338,059 0 0 0
update10th 1 1,000 70,273 1,000 10,000 1,000
select 1 2 225 2 10,000 2
swap 1 2 218 10,000 10,000 —
updateStorm 50 50,000 2,789,294 50,000 500,000 50,000
selectStorm 30 60 6,954 60 300,000 60

U0's exit gate was select@10k's reconcile-equivalent count returning to the
semantic lower bound, ~43 against the standing 10,042. The scoped column reports
2 — under the stated bound because the bound included the app's 41 chrome
blueprints and the block core never revisits chrome. Every other op with a floor
lands on it exactly. GO.

And the finding that stops that from being the wrong claim: the reconcile
column reports 10,000 for select@10k, against the universal core's 10,042
blueprint visits. Those are the same number. The Block model, driven the way the
app drives it today, reproduces the cost the universal core already pays. The win
is the scoped write; the Block model is what makes the scoped write addressable
(Map<key, Block> plus a dense host-id run, so "row 7's class" resolves in one
lookup). Port the model without moving the state change off the whole-list path
and #103 buys nothing measurable.

Changes

  • benchmarks/lynx-table/block-workload.ts — new. The block program mirroring
    app/src/App.lynx.tsrx host-for-host (41 chrome nodes, 7 per row), the ladder,
    and the two drive modes.
  • benchmarks/lynx-table/block-counts.mjs — new. Builds it through the same vite
    pipeline run.mjs uses and reports per-op counts. Fails if the two columns send
    different wire, if a cell's counts differ between repetitions, or if the ladder
    did not paint the tree it should.
  • benchmarks/lynx-table/workload.ts — createHarness split into
    createWireChassis plus the universal root, so both workloads share the chassis
    instead of duplicating it. No behavior change; see Validation.
  • benchmarks/lynx-table/prototype/results/u0-block-core-counts.{json,md} — the
    committed record, beside web-u0-update-ceiling.*: the two halves of one gate.
  • READMEs and a bench:block script.

Validation

  • pnpm format:check — via pnpm format:files:check over every changed path
  • pnpm typecheck — benchmarks are outside every TS project (typecheck:files
    reports "No TypeScript project includes"), which is why run.mjs type-checks
    nothing and builds through vite. block-workload.ts was checked separately
    under strict with tsrx-tsc and reports no error of its own.
  • pnpm test — running against this diff; result in a follow-up comment
  • targeted: the standing gate reproduces exactly after the chassis split —
    LYNX_TABLE_SCALES=1000 node run.mjs 1 gives create=1 (1000r) update10th=100 (100r) select=2 (225B, 2r) swap=2 (368B, 0r) updateStorm=50c/5000 (5000r) selectStorm=30c/60 (60r), failed: none,
    matching the committed ratio guards.
  • targeted: the new record reproduced identically across three independent
    runs, with the runner's own zero-drift check at --reps 2 inside each.

Two incidental cross-checks that the block program really is the app's program,
rather than something merely similar: at 1,000 rows both cores materialize
7,042 host elements, and a select frame is 225 bytes from either. Those
are read as evidence for the comparison's premise, not claimed as results.

Risk / follow-ups

  • No changeset. Benchmarks-only; no published package changes.
  • Both columns are ceilings, in the same sense U0's floor was a floor: the
    block program is hand-written — no hooks, no compiler, no component bodies.
    This is "what does the architecture cost", never "what does Octane on Lynx cost
    today". The octane-lynx column in run.mjs remains the second number.
  • No milliseconds moved. U0's two open wall-clock gates stand where U0 left
    them. This bounds the recoverable share of select@10k — traversal was 48.3% of
    that frame and the count falls 10,042 → 2 — but bounding is not measuring, and
    the browser cell is what would measure it.
  • swap is the gap this names rather than scores. 10,000 in both columns:
    this slice has no scoped move, so a structural reorder goes through the keyed
    reconciler regardless. That is honest LIS behavior, and it is where a
    MOVE {firstInstance, count} primitive would earn its keep.
  • Not registered in bench.mjs. It is an on-demand runner like
    stages/run.mjs, not a CI gate; adding two more full ladders per scale to
    bench:all is a separate decision.

Provenance

  • An agent produced this diff (agent-authored)

Generated by Claude Code

U0 measured the update path's architectural ceiling with a hand-written op
emitter that kept its rows in an array, and reported beside it a second
column — what a keyed core *would* touch — derived by hand because no keyed
core existed. U2 built one. This asks it.

`block-workload.ts` drives the real `LynxBlockCore` over the same operation
ladder `run.mjs` uses, on the same chassis: the same ContextProxy pair, the
same fake Element PAPI, the same real main-thread receiver, the same
`__OCTANE_LYNX_PROF` accounting. Only the background core differs, which is
what makes a count here comparable to the `octane-lynx` column rather than
merely adjacent to it. `createHarness` is split so both workloads share that
chassis instead of duplicating it; the standing gate's counts are unchanged.

Two columns run the same core and differ only in which entry point a state
change reaches. `scoped` writes the changed rows' slots by key, as a compiled
block program with per-row reactive slots would. `reconcile` hands the whole
next list to the keyed reconciler, as the app's own `setRows(next)` does
today. Reporting only the first would credit the Block model with a win that
belongs to the scoped write: at 10k, `select` is 2 lookups scoped and 10,000
reconciled, against the universal core's 10,042 blueprint visits. The Block
model is what makes the scoped write addressable; it is not itself the win.

The runner fails if the two columns send different wire, if a cell's counts
differ between repetitions, or if the ladder did not paint the tree it should.
`swap` is reported without a floor because this slice has no scoped move, so a
structural reorder goes through the keyed reconciler either way — the gap is
named rather than scored.

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

Huxpro commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

pnpm test — full run, complete. This is the result promised by the unticked pnpm test box in the body.

Result: Test Files 12 failed | 2184 passed (2196), Tests 6 failed | 20954 passed | 75 skipped (21035), 1 unhandled error. Start 06:09:53, duration 3888 s. Ran on a clean tree at 781e4fca3 — this PR's head exactly.

No lynx project failure — the project this stack changes.

All 12 failures were re-run individually on an idle host and A/B'd against the stack's merge-base 5d6172478 (unmodified new-lynx). Two are pre-existing at the merge-base (octane-events-browser suspense-hydration selection restore; rspeedy-plugin native-demo, already documented in #66 §2.3); the rest are container-speed timeouts or an outbound-network fetch. Nothing is attributable to this stack, which touches only packages/lynx/** plus the lynx compiler target.

Full per-failure table and method: #105 (comment)


Generated by Claude Code

Huxpro commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

pnpm test — the run this PR's Validation section owed

Run at 935d6e3d, two branches above this one on the stack, so it contains this
diff plus #108 and #109:

Test Files  14 failed | 2182 passed (2196)
     Tests   8 failed | 20954 passed | 75 skipped (21037)
  Duration  3782.40s

Nothing in packages/lynx or packages/octane failed. All 14 failures are
timeouts or browser/process flakes on a loaded host (several Playwright suites
concurrently on 4 CPUs, load average 4–6): SSR/bundling beforeAll hook
timeouts in aria ×2, alien-signals, and octane react-hosted/web3-island;
Test timed out in adapter-vercel, dropzone, syntax-highlighter,
docusaurus; five real-browser suites; and rspeedy-plugin native-demo,
which #66 §2.3 records as pre-existing in this container.

This diff is benchmarks-only, and none of the failing suites run a benchmark.

One caveat worth stating plainly: a run at a descendant head is evidence for
this diff only because the two branches above it are confined to
packages/lynx/src and its tests. It is not the same thing as a run at
781e4fca3 itself.


Generated by Claude Code

Huxpro added a commit that referenced this pull request Aug 20, 2026
`pnpm format:check` fails on the stack for three generated JSON results, which
blocks the gate for every branch above them. All three are formatted correctly
on `new-lynx`; the unformatted copies came in with this stack:

- `stages/results/live-1000.json` and `live-10000.json` were rewritten by
  `888d9034f` and `88e9db5f0`, first carried by `perf/lynx-bg-replay-attribution`
  (#102).
- `prototype/results/u0-block-core-counts.json` is new in `781e4fca3`, on
  `test/lynx-u0-block-counts` (#107).

Fixed forward here rather than at the source, because both of those branches are
published and under review and repairing them in place would rewrite history four
and two branches deep. Nothing but whitespace changes: each file reparses to a
byte-identical JSON value.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
Huxpro and others added 2 commits August 20, 2026 17:28
Review follow-up: the drift break left result non-null with empty
diagnostics, so the post-loop guard recorded the drifted last-rep
numbers into the JSON payload as an apparently valid cell — quoting
exactly the non-invariant the drift check exists to reject.

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-block-root to new-lynx August 20, 2026 17:57
@Huxpro
Huxpro marked this pull request as ready for review August 20, 2026 17:57
@Huxpro
Huxpro merged commit 7d5e6f1 into new-lynx Aug 20, 2026
1 of 2 checks passed
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.

1 participant