You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Independent; small, targets per-interaction tail latency and main-thread.ts complexity. Also absorbs #1's named follow-up: a value-identical re-render still crosses an empty commit envelope (~100B, version advances).
The measured problem
Every commit completes as commit → ack (eagerly built per-changed-node public handle deltas + snapshots; ~15ms per select commit @10k pre-#1) → complete. Effects/refs publish after acceptance by design — the round trip stays — but the ack's eager handle payload and the third message are not required. acknowledgementHandles and its bookkeeping are a significant share of main-thread.ts (~2.4k lines).
Change
Ack carries only {version, adoption flag, fault info}. Per-node public handles become pull-based via the existing main-call channel (refs are already async by contract — invoke/measure/fields — so laziness is semantically invisible), with optional piggyback for handles the background has outstanding ref-attach callbacks on.
Merge complete into ack when MT has no post-ack work (adoption drain, attachments); keep the separate message only where needed.
Ref semantics unchanged (acknowledgement-gated cloned handles, never live nodes).
First-screen adoption flow unchanged (its ack carries the adoption verdict).
Bump the protocol constant so both slices assert agreement.
Acceptance (rig)
Select tail latency −10ms or better; ackHandles stage → ~0 in the profiling hook; messages per interaction 3 → 2 in the common case; value-identical re-render crosses 0 bytes.
Ref/attachment/worklet-lifetime suites green; main-thread.ts line count and bundle bytes down (note the delta in the PR).
Measured outcome — PR #14 (stacked on #13, protocol version 2: derived ack handles, merged completion, empty-commit elision).
Acceptance line by line:
Messages 3 → 2 common case: met. Every non-adopting, no-attachment commit now settles on the acknowledgement (complete: true merged in); pinned deterministically in main-thread-events/background-root.
Value-identical re-render crosses 0 bytes: met. A zero-command batch settles on the background without touching the wire (after the first accepted batch). The paced 50-tick storm's crossing commits drop 50 → 3 (the 47 empty fold-tail envelopes are elided); update_storm_paced_commits_1k guard tightened 1.0× → 0.1× to pin it.
ackHandles stage → ~0: structurally met, wall-clock wash. The payload build is LYNX_DEVELOPMENT-folded out of production main entirely (dev keeps it as a delta-for-delta cross-check against the background's derivation, fail-stop on divergence). The in-process rig's ackMs (which also charges background acceptance) stays flat: 2,119 → 2,293 ms whole-run @10k, within rep spread.
Select tail −10 ms: not demonstrated. Real-thread-boundary numbers (Lynx-for-Web Chromium, real postMessage structured clone, medians of n=3, baseline = perf(lynx): validation diet — dev-deep, prod-fast commit validation ([lynx-perf 5]) #13 head from a clean worktree): select 30 → 29 ms @1k, 134 → 134 ms @10k. Every op's baseline→after delta is within spread. The single-select ack payload was ~237 B — there never was 10 ms of structured clone in that tail on this host. The realized wins are the message count and the bytes, not select latency. Select @1k sits at 0.98× vue-vdom (parity); @10k at 1.87× (that gap is render/diff breadth, not the ack tail).
Ref/attachment/worklet suites green: met. Full lynx project 27 files / 301 tests, including a new engine-tap regression test.
main-thread.ts lines + bundle bytes: modest. −14/+34 lines (the dev cross-check is retained by design; prod builds fold out acknowledgementHandles, publicHandleUpsert, and the ack-time getLynxHostPublicState walks). Web bundle 408.8 kB, unchanged.
Bonus finding (the web harness earning its keep): the first cut of this PR had a real interaction-freeze regression that only the real browser could show — octane went all-DNF while the in-process rig and both two-realm unit suites stayed green. Root cause: the engine tap path synthesized its event envelope with the root's accepted watermark, but handleEvent validates main-originated events against mainAccepted; once an elided batch put the watermarks apart, every subsequent tap was dropped as stale (the select storm froze right after the update storm's elided fold tail). Fixed in 5851cfc0 (stamp mainAccepted, restamp to accepted on delivery, exactly the pre-protocol-2 behavior) and pinned by a test on the engine's own publishEvent path: no-op state update settles locally → next tap must still fire. Red-checked. The lesson is recorded in the PR's risk notes: anything locally synthesized but validated against main's watermark must stamp mainAccepted.
Full battery in the PR: format/typecheck green, full root pnpm test (only the pre-existing environmental failures, identical set to the #13 baseline, plus one unrelated flake that passes in isolation), deterministic ratio gates PASS, web harness end-to-end zero DNFs at 1k/10k on baseline and after.
Live-main audit (2026-08-11): derived-handle protocol superseded by octanejs#693 compact ACK. The still-interesting pieces—merged completion and zero-command local settlement—are split into live-main research issue #45. The old protocol-v2 topology mirror must not be replayed.
Activity
Huxpro commentedon Aug 9, 2026
Measured outcome — PR #14 (stacked on #13, protocol version 2: derived ack handles, merged completion, empty-commit elision).
Acceptance line by line:
complete: truemerged in); pinned deterministically inmain-thread-events/background-root.update_storm_paced_commits_1kguard tightened 1.0× → 0.1× to pin it.ackHandlesstage → ~0: structurally met, wall-clock wash. The payload build isLYNX_DEVELOPMENT-folded out of production main entirely (dev keeps it as a delta-for-delta cross-check against the background's derivation, fail-stop on divergence). The in-process rig'sackMs(which also charges background acceptance) stays flat: 2,119 → 2,293 ms whole-run @10k, within rep spread.postMessagestructured clone, medians of n=3, baseline = perf(lynx): validation diet — dev-deep, prod-fast commit validation ([lynx-perf 5]) #13 head from a clean worktree): select 30 → 29 ms @1k, 134 → 134 ms @10k. Every op's baseline→after delta is within spread. The single-select ack payload was ~237 B — there never was 10 ms of structured clone in that tail on this host. The realized wins are the message count and the bytes, not select latency. Select @1k sits at 0.98× vue-vdom (parity); @10k at 1.87× (that gap is render/diff breadth, not the ack tail).main-thread.tslines + bundle bytes: modest. −14/+34 lines (the dev cross-check is retained by design; prod builds fold outacknowledgementHandles,publicHandleUpsert, and the ack-timegetLynxHostPublicStatewalks). Web bundle 408.8 kB, unchanged.Bonus finding (the web harness earning its keep): the first cut of this PR had a real interaction-freeze regression that only the real browser could show — octane went all-DNF while the in-process rig and both two-realm unit suites stayed green. Root cause: the engine tap path synthesized its event envelope with the root's
acceptedwatermark, buthandleEventvalidates main-originated events againstmainAccepted; once an elided batch put the watermarks apart, every subsequent tap was dropped as stale (the select storm froze right after the update storm's elided fold tail). Fixed in5851cfc0(stampmainAccepted, restamp toacceptedon delivery, exactly the pre-protocol-2 behavior) and pinned by a test on the engine's ownpublishEventpath: no-op state update settles locally → next tap must still fire. Red-checked. The lesson is recorded in the PR's risk notes: anything locally synthesized but validated against main's watermark must stampmainAccepted.Full battery in the PR: format/typecheck green, full root
pnpm test(only the pre-existing environmental failures, identical set to the #13 baseline, plus one unrelated flake that passes in isolation), deterministic ratio gates PASS, web harness end-to-end zero DNFs at 1k/10k on baseline and after.Generated by Claude Code
Huxpro commentedon Aug 11, 2026
Live-main audit (2026-08-11): derived-handle protocol superseded by octanejs#693 compact ACK. The still-interesting pieces—merged completion and zero-command local settlement—are split into live-main research issue #45. The old protocol-v2 topology mirror must not be replayed.