Skip to content

[lynx-perf] Roadmap: Octane on Lynx to its theoretical ceiling (≈ ReactLynx tier) #9

Closed

Description

@Huxpro

Umbrella plan for the Octane-on-Lynx performance program. One sub-issue = one PR-sized optimization. Work them in order within each track; check items off here as PRs land. Research provenance: cross-framework analysis in Huxpro/vue-lynx PR #356 (evidence archive: slides/public/compare-data/ — captured commit payloads, stage-timer patch, real compiler outputs for both slices, same-host benchmark JSON).

The analysis in five sentences

  1. Octane's Lynx renderer is architecturally the same model as ReactLynx — owner re-render + retained-tree diff + block-grade compiled templates (universalPlan = structure tree + slot table, compiled into both slices) + one-shot MT first frame with adoption — so its theoretical ceiling is the ReactLynx tier, not vapor's (vapor's point-update tier requires per-binding reactivity, a model octane deliberately didn't choose).
  2. The measured gaps were never "a slow renderer": they are single-threaded-era guard policies running across a priced boundary — identity equality on non-primitive slot values made wire cost O(tree) per commit (2.4MB / ~30k commands for a 2-row select @10k; vue vapor ships 39B for the same click), fixed in feat(lynx): change-size-proportional commit wire cost, with a gated cross-framework benchmark (integration of 3 upstream PRs) #1.
  3. The old updateStorm "win" was accidental backpressure coalescing (50 ticks → ~19 commits while MT chewed 2.4MB batches); feat(lynx): change-size-proportional commit wire cost, with a gated cross-framework benchmark (integration of 3 upstream PRs) #1 made the coalescing contract explicit and the trap fired exactly as predicted (storm wall-clock regressed toward the layout floor) — recovering it deliberately is [lynx-perf 2].
  4. After the wire fix, the dominant point-update cost is replay breadth: owner = the list component, so universalFor rebuilds all N items' props for a 2-row change; the compiler already has everything needed to auto-memo item components ([lynx-perf 3] — React's hand-written memo tier, automated).
  5. The remaining constants live in the transport machinery itself: per-node create commands ignoring the plan's block information ([lynx-perf 4]), always-on per-command validation ([lynx-perf 5]), eager ack handles + third message ([lynx-perf 6]), and a 59KB-gzip MT slice evaluated before first paint ([lynx-perf 7]).

Trajectory (10k rows, rig-host medians; references same host: vue-vdom select 164 / react 170 / react create 1717 / vue-vdom create 2133)

after select update10th create FCP updateStorm@10k bundle gzip
pre-#1 1374 1493 4416 ~1090 3054 (accidental win) ~102.8KB
#1 (landed in-PR, measured) 857 1044 4444 ~1090 3962 (trap fired) —
+ [lynx-perf 2] throttling — — — — ≤3100 → actual 3524 = 1.07× vdom (vdom itself 3308 on that run; ratio parity reached, abs band anchored to a faster host — see #3 comment; PR #10) —
+ [lynx-perf 3] auto-memo 150–250 → actual 274 = 1.95× vdom (vdom 141 same run; @1k parity at 1.15×) 200–350 → actual 473 = 2.60× vdom 4459 (unchanged) — actual 1460 = 0.51× vdom / 0.93× vapor — storm crown reached; selectStorm 487 = 0.35× (PR #11) —
+ [lynx-perf 4] plan wire — — 2400–3000 → actual 4669 ±277 = 2.08× vdom (vdom 2249 same run; deterministic gates met exactly: 160k→10k commands = 1.00× the one-per-row floor, commit bytes −69%; runtime probe proves folding active in the real bundles — create is PAPI-bound, the band needs code-staged MT create, see #5 comment; PR #12) ≥unchanged (first-screen path untouched) — —
+ [lynx-perf 5] validation — — −10~15% more → actual MT prepare 3.8× faster (whole-run rig 11.2s→2.9s, validate ~90×, counters byte-identical; web create wall-clock not re-measured — prepare is not its bottleneck, see #5) −100ms+ → actual ±0, within noise (first screen is MT-rendered, validation never sat on the FCP path — see #6 comment; PR #13) — —
+ [lynx-perf 6] protocol tail −10ms → actual ±0, wash (Lynx-for-Web select 30→29 @1k, 134→134 @10k, all deltas within n=3 spread — the ack tail never carried 10 ms of payload; the realized wins are deterministic: messages 3→2, paced-storm commits 50→3, idle re-renders 0 bytes. The web harness also caught a real tap-freeze regression in the first cut, fixed + pinned — see #7 comment; PR #14) — — — — ≈0 (web bundle 408.8 kB unchanged; the dev cross-check folds out of prod builds)
+ [lynx-perf 7] diet — — — ~800–900 → actual ±0, wash (interleaved A/B same host window, deltas inside ±900ms host noise; the band belongs to the pre-migration 2.8GHz host — see #8 comment; PR #15) — ≤80KB → actual not met: 128.8KB IFR — realized win is the MT slice: −3.6% gzip (70.4→67.8KB), no-worklet bundles shed the whole worklet runtime, BG byte-identical; the −25% projection counted mass usedExports DCE + [lynx-perf 5/6] had already dropped (string diet measures −234B gzip, unification <1KB — both rejected with data); 4 frozen per-slice budget gates added, see #8 comment
ceiling (RL reference) ~170 ~273 1717 (long-term) 459 (structural) octane keeps the storm crown 31.9KB (not reachable)

Numbers are host-bound; the portable claims are the ratios and the deterministic gates (command counts, commit bytes, item-render counts, gzip-per-slice) enforced by benchmarks/lynx-table + ratios.json.

Checklist (one PR each)

Working agreements

  • Every PR is measured with the same rig (benchmarks/lynx-table) against the vendored ReactLynx / vue-vdom / vue-vapor reference bundles; no octane-only bespoke workloads; a cell that can't be driven reports "not measured", never a degraded number.
  • Deterministic counters gate; wall-clock informs. Ratio changes in baselines/ratios.json carry a one-line justification each.
  • Equality and validation predicates must be realm-safe (no Object.prototype identity, no instanceof across the boundary) — the fix(lynx): validate cross-realm messages and accept a null event target id on Lynx for Web octanejs/octane#459 lesson; the vm two-realm rig runs in CI with validation ON.
  • No architecture changes anywhere in this program: Blueprint/LogicalRecord/commands/versioned protocol/adoption all stay. These are guard-policy and transport-shape fixes.
  • Beyond this list (create → react's 1717, FCP → 459) requires code-staged MT plans and a structurally lighter runtime — a separate architecture decision, re-measure first, don't pre-commit.

Activity

  1. Huxpro commented on Aug 9, 2026

    @Huxpro
    OwnerAuthor

    Roadmap closing summary — what the predictions got wrong, and what held

    All seven items are now resolved: six shipped as the stacked PRs #10 → #11 → #12 → #13 → #14 → #15, and [lynx-perf 1] (landing PR #1 itself) is the remaining gate, owned by the split/rebase track. Since the working agreement was "report honestly", here is the audit of every prediction against its measurement.

    The wrong predictions, one per item

    • [lynx-perf 2] pacing: predicted storm ≤3100 ms absolute; measured 3524. The miss was the band, not the mechanism — vdom measured 3308 on the same run (1.07×, parity reached). The absolute band had been anchored to a faster host and silently expired when the rig moved. Lesson: absolute ms bands don't survive host migration; only ratios and counters travel.
    • [lynx-perf 3] auto-memo: the mechanism prediction was wrong — the roadmap called for "compiler-backed" item memoization, but the shipped fix needed zero compiler machinery: the runtime's existing retained-subtree adoption extended to transported roots. Select landed at 274 (predicted 150–250, vdom-ratio 1.95×) and the storm crown (0.51× vdom, 0.93× vapor) exceeded the plan.
    • [lynx-perf 4] plan wire: the biggest wall-clock miss. Predicted create 2400–3000 ms; measured 4669 ±277 — while every deterministic gate hit exactly (160k→10k commands = the one-per-row floor, bytes −69%). The prediction attributed create's cost to the wire; it's PAPI-bound. Cutting 94% of commands bought ~nothing because element creation, not transport, is the floor. The band needs code-staged MT creates — an architecture decision the program explicitly excluded.
    • [lynx-perf 5] validation diet: predicted FCP −100 ms+; measured ±0. Validation was never on the FCP path — the first screen is MT-rendered and the receiver validates background-originated batches, which arrive after paint. The real win was elsewhere: MT prepare 3.8× (whole-run rig 11.2 s → 2.9 s).
    • [lynx-perf 6] protocol slimming: predicted a −10 ms interaction tail; measured a wash on both instruments — the ack tail never carried 10 ms of payload. The realized wins were the deterministic ones (messages 3→2, paced-storm commits 50→3, idle re-renders 0 bytes). Bonus finding: the first cut shipped a real engine-tap watermark freeze that only the real-browser harness caught — the in-process rig structurally could not see it.
    • [lynx-perf 7] receiver diet: predicted MT slice −25% gzip (→ ≤45 KB); measured −3.6% (70.4 → 67.8 KB). The projection was computed on unminified module shares and double-counted mass that production usedExports DCE plus [lynx-perf 5/6] had already removed. Its two secondary levers evaporated under measurement: 10,153 raw bytes of diagnostic strings compress to a −234 B gzip delta, and the plan-materialization unification shares < 1 KB of genuinely common code. The durable result is structural: no-worklet apps no longer pay for the worklet runtime at all, and four frozen per-slice gzip budgets now gate regressions.

    The patterns behind the misses

    1. Wall-clock predictions repeatedly blamed the wrong layer (wire for create, validation for FCP, ack payload for the tail). Every time the prediction was about something the diff directly controls — command counts, bytes, messages, item renders, slice gzip — the gates were met essentially exactly. The program's own working agreement ("counters gate, wall-clock informs") turned out to be the accurate epistemology.
    2. Static composition analysis over-predicts bundle wins. Module shares on unminified source ignore what DCE already removed and what gzip makes free. Only the minified+gzipped artifact is evidence.
    3. Absolute time bands are host-artifacts. Three separate targets (~3100 storm, ~800–900 FCP, 102.8 KB anchor context) expired silently across host/toolchain migrations. Ratios against same-run references and frozen byte budgets did not.
    4. The in-process rig has a blind spot for engine-boundary regressions — [lynx-perf 6]'s tap-freeze proved a real-browser lane is load-bearing, not optional.

    What actually moved Octane-on-Lynx

    The wire fix (#1: select 1374→857), auto-memo (#11: select 274, update10th 473, storm crown 1460 = 0.51× vdom), explicit pacing (#10), and prod prepare 3.8× (#13) — with the protocol/wire/bundle shape now pinned by ~24 deterministic guards in ratios.json so none of it can silently regress. Select/update sit ~1.9–2.6× vdom against a ~1.0× ceiling; create and FCP are PAPI/architecture-bound beyond this program's charter, exactly as the final "Beyond this list" clause anticipated.

    Remaining: [lynx-perf 1] — land PR #1 and the stack above it (#10–#15, one rebase cascade once #1's split settles).


    Generated by Claude Code

  2. Huxpro commented on Aug 9, 2026

    @Huxpro
    OwnerAuthor

    Season 2 is now planned: #21 — [lynx-perf-s2] code-staged Octane (sub-issues #16–#20, dependency-ordered, one PR each).

    Continuity from this roadmap: the S2 chain builds directly on what S1 banked — #12's content-derived planIds are the codegen registry key, #11's auto-memo already put select inside S2's target band, #13's dev-fold and #14's derivation-cross-check are the safety patterns, #15's sideEffects/DCE lesson and slice budgets are the packaging constraints — and S2's central calibration (code-staging only pays bundled with protocol collapse) is the direct product of this roadmap's two "failed" predictions (#12's flat create, #15's −3.6%). The two structural items this roadmap closed as out-of-scope (create → 1717, FCP → 459) are exactly S2's targets, with the honest cap written in: the last ~100–150ms of RL's constants are structural and not chased.

    [lynx-perf 1] (landing PR #1 and the stack) remains this roadmap's only open item.


    Generated by Claude Code

  3. Huxpro commented on Aug 11, 2026

    @Huxpro
    OwnerAuthor

    Live-main audit (2026-08-11): historical S1 roadmap resolved. Wire tooling landed as octanejs#660–octanejs#662; retained adoption landed as octanejs#696; plan/protocol/materialization paths were superseded by octanejs#693/octanejs#700; pacing and worklet residuals failed their current product gates and moved to #45/#44. Closing this umbrella with the measured conclusions preserved in its comments and PRs.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions