Skip to content

feat(lynx): change-size-proportional commit wire cost, with a gated cross-framework benchmark (integration of 3 upstream PRs) - #1

Closed
Huxpro wants to merge 3 commits into
mainfrom
claude/octane-lynx-benchmark-payload-a3zaeu
Closed

Huxpro wants to merge 3 commits into
mainfrom
claude/octane-lynx-benchmark-payload-a3zaeu

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 7, 2026 •

Copy link
Copy Markdown
Owner

Structure

This branch is now the integration stack of the three upstream-ready PRs, rebased onto upstream main @ 1c44117b (fork main itself is synced further, to cdb501c9; the three newer upstream commits touch none of these files):

  1. lynx/bench-wire-instrumentation — bench(lynx): gate the dual-thread commit wire cost against a changed-rows floor. The __OCTANE_LYNX_PROFILE__-gated wire profiler in @octanejs/lynx, benchmarks/lynx-table (deterministic wire-cost gates + Lynx-for-Web wall-clock harness with vendored ReactLynx / Vue vdom / Vue vapor reference bundles), and 12 ratios.json guards pinned at the measured KNOWN GAP waterline.
  2. lynx/bench-website-viz — docs(website): chart the Lynx suites in their own benchmarks section. New "Octane on Lynx" section on /benchmarks: cross-framework wall clock + commit wire cost vs the changed-rows floor (new 'count' card format).
  3. lynx/wire-payload-change-size — perf(lynx): make commit wire cost proportional to change size, not tree size. Value-semantic sameUniversalHostPropValue prop diff, event re-announce only on observable change, compiler lowering of static class arrays / literal children into identity-stable slot values, explicit tested backpressure-coalescing contract, and all 12 guards tightened from 31×–15,000× ceilings to 1.0×–1.5× floors with re-recorded baselines.

Two defect fixes from the previous revision of this branch were dropped because upstream already landed them: cross-realm plain-object acceptance (upstream octanejs#459) and target.id: null normalization (upstream octanejs#578). One cut was narrowed against an upstream contract: host callbacks (attach) keep closure-identity re-announcement, because an attach callback observably re-runs (detach + attach) when its handler closure is replaced (universal-event-scope.test.ts); only event listeners stop re-announcing.

Summary

  • benchmarks/lynx-table: deterministic wire-cost harness (command counts + serialized commit bytes, CI-gated in ratios.json) plus a Lynx-for-Web Chromium harness measuring octane against vendored ReactLynx / Vue vdom / Vue vapor reference bundles with one shared, byte-identical page driver.
  • Fixes the P0 it measures: transported commit payloads were proportional to tree size, not change size. A one-row select over 10,000 rows shipped ~30,000 commands / 2.4MB; it now ships 2 commands / 225 bytes.
  • Makes the transport's backpressure coalescing ("renders scheduled while a commit awaits acknowledgement fold into one commit carrying the latest state; intermediate states never cross") an explicit, tested contract.
  • Charts both suites on the website's /benchmarks page in their own section.

Measured

Deterministic wire cost (in-process, real dual-thread path, real tap tokens):

op before after floor
select@10k 30,000 cmds / 2,406,468 B 2 cmds / 225 B 2 cmds / ≤2048 B
update10th@10k 31,000 cmds 1,000 cmds 1,000
updateStorm@10k 50 commits / 1,550,000 cmds 50 / 50,000 50 / 50,000
selectStorm@10k 30 / 900,000 30 / 60 30 / 60
create@10k 160,000 160,000 (unchanged) —

The "before" bytes reproduce the captured production payload byte-for-byte (2,406,468).

Lynx for Web wall clock (4-core CI-class host, same instrument for every cell, medians of n=3; ratios vs vue-vdom are the portable claim), 10,000 rows, before → after:

op octane before octane after vue-vdom vue-vapor react
create 4416 (2.06×) 4444 (2.08×) 2133 2336 1717
update10th 1493 (7.55×) 1044 (5.41×) 193 152 273
select 1374 (9.21×) 857 (5.24×) 164 160 170
updateStorm 3054 (0.98×) 3962 (1.25×) 3175 1447 5986
selectStorm 2579 (1.75×) 1543 (1.00×) 1546 155 2585
  • select and update10th drop to the background-replay-bound region; the remaining gap vs Vue is replay breadth/memo (the separate P1, not attempted here, not regressed).
  • selectStorm reaches parity with Vue vdom (was 1.75×).
  • The storm trap fired as predicted: updateStorm's old win rode on accidental backpressure coalescing (a busy main thread folded 50 ticks into ~19 commits). With 30× smaller commits every tick gets its own commit and layout, so updateStorm@10k moves 3054→3962ms. The coalescing contract is now explicit and tested and the deterministic storm gates pin commands-per-tick at the floor; recovering the old wall-clock number needs deliberate frame-aligned commit throttling — a protocol change flagged as follow-up.

Validation

  • pnpm format:check
  • targeted: universal-transport / universal-renderer / universal-composition / universal-event-scope / universal-host-sdk / lynx runtime-compatibility / octane-mcp-server / website smoke — green on this stack; new regression tests red-checked against reverted implementations (comparator → Object.is and event handler-identity term each make the new tests fail)
  • node benchmarks/bench.mjs --quick --ratios --only lynx-table → PASS at the tightened floors
  • baselines re-recorded post-fix (--record --only lynx-table / --only lynx-table-web)

Risk / follow-ups

  • A value-identical re-render still crosses an empty commit envelope (~100B, version keeps advancing); elision would shift acknowledged-version sequences and is left as follow-up.
  • The remaining select@10k wall-clock gap vs Vue (~700ms BG replay breadth/memo) is the separate P1; not attempted here.
  • updateStorm wall-clock trade above (frame-aligned commit throttling as follow-up).

🤖 Generated with Claude Code

https://claude.ai/code/session_01SW6xKsEpmsN7rFu4K9mFM9

Huxpro and others added 3 commits August 8, 2026 22:36
…rows floor

A point update's commit currently ships the whole tree: selecting one row in
the 10,000-row cross-framework table serializes ~30,000 commands / 2.4MB —
identical in size to a commit where every tenth row actually changed —
because every row's re-encoded class array and both bindtap closures cross
the wire on every commit. This adds the instrument that makes that cost a
tracked, gateable number before any fix lands:

- @octanejs/lynx gains a permanent __OCTANE_LYNX_PROFILE__-gated wire
  profiler (globalThis.__OCTANE_LYNX_PROF): per-thread commits, commands,
  serialized bytes, and pipeline-stage milliseconds. Compiled away when the
  define is absent.
- benchmarks/lynx-table drives the krausest-style table app (mirrored
  operation-for-operation from the Vue Lynx unified benchmark matrix)
  through the real background root, transport, main-thread receiver, and
  host driver via real tap tokens, and reports deterministic per-operation
  command counts and commit bytes against the changed-rows semantic floor.
- benchmarks/lynx-table/web is the Lynx-for-Web wall-clock harness: the
  same app for Octane and vendored ReactLynx / Vue Lynx vdom / Vue Lynx
  vapor reference bundles under one byte-identical Chromium page driver.
- ratios.json gains 12 lynx-table guards pinned at today's measured
  waterline (select = 1500x the floor, update10th = 31x, storms likewise),
  each marked KNOWN GAP with the instruction that fixes must tighten them.
  CI now fails on any further regression and visibly tracks the gap itself.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SW6xKsEpmsN7rFu4K9mFM9
/benchmarks gains an "Octane on Lynx" section between the head-to-head
targets and the authoring cliff, charting the two lynx-table baselines:

- the Lynx-for-Web wall clock — Octane, ReactLynx, and both Vue Lynx
  renderers on the same table app under one byte-identical page driver
  (host-bound medians; the cross-framework ratios are the portable
  reading). Vue's two renderers wear an ordinal ramp of the Vue orchid,
  following the octane-variant precedent.
- the deterministic commit wire cost against the changed-rows floor, with
  a new 'count' card format for unitless exact counters. The gap between
  the two bars is the KNOWN GAP the lynx-table ratio guards pin; fixes
  tighten the guards and visibly close the bars.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SW6xKsEpmsN7rFu4K9mFM9
…ee size

On a transported root every object-valued host prop is re-encoded through
the wire clone per render, so the identity-based prop diff could never
certify sameness: a one-row select over 10,000 rows shipped ~30,000
commands / 2.4MB. Three cuts:

- Value-semantic prop diff: exported sameUniversalHostPropValue (Object.is
  fast path, depth-2 structural equality over arrays and plain records from
  any realm via a universal-side hasCrossRealmPlainPrototype, the twin of
  packages/lynx/src/core/plain-object.ts). Used by shallowPropsEqual, and
  cloneSerializableValue accepts cross-realm plain objects through the same
  predicate.
- Events re-announce only what the host can observe: a re-created
  equivalent handler keeps its stable listener ID and the background
  dispatch table always rebinds to the newest closure, so only a new
  listener, priority change, or owner change emits a command. Host
  callbacks (attach) keep closure-identity announcement — their re-run on
  handler replacement is an observable contract.
- Compiler lowers statically string-or-falsy class arrays to their
  clsx-composed string (all-literal arrays fold to a static plan prop) and
  folds string-literal children and literal attribute values into the
  frozen plan, so hot per-row slot values are primitives.

The transport's backpressure coalescing (renders scheduled while a commit
awaits acknowledgement fold into one commit carrying the latest state) is
now an explicit, tested contract.

select@10k: 30,000 cmds / 2,406,468 B -> 2 cmds / 225 B. All 12 lynx-table
ratio guards tighten from KNOWN GAP ceilings (31x-15,000x) to 1.0x-1.5x
floors; baselines re-recorded.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SW6xKsEpmsN7rFu4K9mFM9
@Huxpro
Huxpro force-pushed the claude/octane-lynx-benchmark-payload-a3zaeu branch from 98ba1e2 to e14d600 Compare August 8, 2026 23:11
@Huxpro Huxpro changed the title feat(lynx): make commit wire cost proportional to change size, with a gated cross-framework benchmark feat(lynx): change-size-proportional commit wire cost, with a gated cross-framework benchmark (integration of 3 upstream PRs) Aug 8, 2026
@github-actions github-actions Bot added the feat label Aug 8, 2026

Huxpro commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

Heads-up from validating stacked PR #10 on this branch's tip (e14d6001): website/tests/ssr-smoke.test.ts > server-renders /benchmarks with complete bar charts and table data fails on this branch as-is — classCount(html, 'bench-card') renders 28 cards while cards.length expects 26 (website/tests/ssr-smoke.test.ts:166). Reproduced twice on the clean tip with no other changes, so it looks like the new Lynx cards from the website-viz commit render two more cards than the test's expectation source counts. Every other suite failure in this container is browser/e2e environment-bound (missing pinned Chromium headless shell / macOS Lynx Explorer).


Generated by Claude Code

@Huxpro

Huxpro commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

Conclusion: close this historical integration PR. Its useful runtime work landed upstream through octanejs/octane PRs 660, 661, and 662; replaying this branch would duplicate or regress current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant