Repository navigation
Conversation
This was referenced Aug 11, 2026
Owner
Author
|
Conclusion: close as superseded. Compact ACK and template-run settlement from upstream PRs 693 and 700 replace this protocol-v2 branch; remaining scheduling research belongs in issue 45. |
This was referenced Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
acceptedfor the root,mainAcceptedfor work main has actually applied).Why
The background sent the commands that determine handle creation, generation, parent placement, attachment seeds, and list ancestry, but protocol v1 asked main to rebuild that state and structured-clone it back. Create@10k made the redundant payload visible: the exact P4 profile sends 17,184,627 bytes from main for the acknowledgement/completion/frame tail. Protocol v2 sends a 156-byte bare acknowledgement plus frame pulse instead.
This is the independently mergeable P5 replacement for #14, refetched immediately before publication at frozen head
e627ca5979ed77fbaf8ef5eafbea86c482f64cf5over source parentdcb334afa415fda63e94c09a77a31d107dea6128. The old PR remains untouched. Its env-gated web debug capture is already superseded by P0's reusable cell-aware debug path and is deliberately not duplicated here.Changes
packages/octane/src/universal-core.ts,packages/lynx/src/core/protocol.ts: protocol 1 → 2; production-shape bare acknowledgements; optional development handle cross-check;complete: truevalidation.packages/lynx/src/core/client-driver.ts: derive handle transitions/generations/snapshots/attachment/list ancestry on background. Parent placement lives as one scalar on the existing monomorphic handle rather than a second retained per-node topology graph; child indexes are transient and only built for actual list-ancestry flips. Same-parent reorders stage no topology work.packages/lynx/src/main-thread.ts: compile acknowledgement-handle construction out of production, remove unchanged-update republishing, and merge completion when adoption/attachment work does not require a separate tail.packages/lynx/src/core/transport.ts: maintainacceptedandmainAccepted, elide zero-command batches only after activation, preserve main-watermark stamping for engine events/calls/dispose, and settle merged completion through the existing commit lifecycle.packages/lynx/src/core/profiling.tsandbenchmarks/lynx-table: count every outbound wire message/byte in both realms, including acknowledgements, completion, and frame pulses; inject the same observation boundary into the exact P4 export for comparison.update_storm_paced_commits_1kto0.1x; add protocol, generation, attachment, list/portal, merged-tail, elision, pacing, and after-elision engine-tap coverage; add patch changesets for@octanejs/lynxandoctane.Stack
fd2ea96d5fe7fc4d39d0d24fe5e9aee8f196b111)b41944e6effd65d3d967af9233e8cf6569ed8301)68b2b0546b28d54b7cd8d44665f95d36b58e48b3)The fork review stack is GitHub Stack octanejs#36 and is managed with the official
gh stackextension. Upstream delivery remains bottom-to-top.Simplification
LYNX_BENCH_DEBUGpatch.Map<number, { parent, type, children: Set }>after exact heap showed +7–8%. The final representation adds onlyparentto the already-required handle, builds descendants transiently for rare list-ancestry flips, skips ancestry entirely when no list/list-item is live, and treats same-parent reorder as the topology no-op it is.__OCTANE_LYNX_PROFILE__fold every counter branch out.Performance audit
Exact comparison:
fd2ea96d5fe7fc4d39d0d24fe5e9aee8f196b111b41944e6effd65d3d967af9233e8cf6569ed8301a6cd897fc81277782bbf06c27f4d82a47b4b7fdfaa74a665dff5ddeb475ac916, P552060a5e6b439cad2011fbb71dae8b9f45f109e4810cf3cff9099cebd7f50d5f8a91af68a6be0d633d7abf3a5a3c50eab5e71f5504f87bd2e9cd33e1c230d7f2, P53437f85738ed6b25d2801578e6092185ebe0e81dc4475ddcb2d1554ccfa2d17fp5-final-control.json,p5-final-profile-forward.json,p5-final-profile-storm-reverse.json, and generated summary/report underbenchmarks/lynx-table/attribution/results/; deterministic output underbenchmarks/results/p5-final/All cited captures pass quiet-host preflight and use five fresh pages/workers per target. CPU wraps create@10k; cold uses five fresh realms with one cold plus four steady samples; heap uses explicit CDP GC at 1k/10k/30k and validates clear/view destroy/page-close worker release; storms use fixed retained 1k state and the real Lynx-for-Web engine event path.
Deterministic behavior and pacing
The final ratio run passes all 25 applicable guards. Normal work is unchanged: create 1 command/row; update10th 100/1,000 commands and Row renders; select 2 commands / 237 commit bytes / 2 Row renders; swap 997 commands / 0 Row renders; update storm 50 commits and 5,000/50,000 commands; select storm 30 commits / 60 commands.
Paced 1k update storm preserves 300 commands and three frame-consuming commits over three frames, while crossing 3 commits instead of 50. Commit bytes fall 22,533 → 16,666 (-26.0%) because 47 empty fold-tail envelopes settle locally. The final P5 capture observes 9 total messages for the three real commits.
Owner signal: main-to-background acknowledgement traffic
Profile medians for create@10k:
The old PR's in-process
ackMswash mixed main payload construction with background acceptance. The durable two-realm profile measures both directions and isolates the actual owner: main no longer builds/clones the production handle payload. The remaining two main messages are the merged acknowledgement and pacing pulse.The same structural reduction appears on retained-state storms with exact work held constant:
The real engine tap succeeds after the update storm in every repetition, proving the
mainAcceptedwatermark path remains live after local elision; all storm semantic/oracle samples pass.Observer-free control, cold paths, heap, and bundle
The observer-free result is the guard against shifting main-thread savings onto background work: BTS has no stable adverse >5% signal. Profile BTS points the other direction (-6.1%), so no BTS speedup is claimed either.
Control cold-first medians are non-adverse across all six cells: swap 82.2 → 82.5ms (+0.4%), replace 398.3 → 371.6ms (-6.7%), create 336.8 → 324.7ms (-3.6%), clear 76.0 → 74.1ms (-2.5%), select 33.3 → 32.2ms (-3.3%), update10th 33.7 → 33.4ms (-0.9%). Exact semantics and presentation counts pass in every realm.
Explicit-GC retained medians are 14,286,564 → 14,518,084 B at 1k, 142,708,372 → 144,961,832 B at 10k, and 416,582,516 → 423,298,824 B at 30k: +1.6% at every scale, below the 5% budget. Every worker releases. The first-cut second topology graph measured +7–8%; it was not published. Control bundle size is 403,331 / 108,686 gzip → 406,362 / 109,847 gzip (+0.75% / +1.07%).
Order sensitivity
Forward profiled update-storm wall was 157.9 → 171.9ms (+8.9%), but the P5→P4 repeat was 159.7 → 171.6ms (-6.9% for the candidate). Select similarly changes direction (+/- a few ms). Since bundle hashes, commits, commands, changed rows, message counts, and final state are identical and the order reverses the wall result, storm wall is classified as frame/host noise and is not claimed as either a win or regression. The stable claim is the wire reduction above.
Validation
pnpm typecheck— repo-wide package, typetest, example, website, and benchmark typecheck matrixnode benchmarks/bench.mjs --only lynx-table --ratios --results-dir=benchmarks/results/p5-final— 25/25 applicable guards pass on final HEADpnpm sync;git diff --check; final worktree cleanRisk / follow-ups
mainAccepted. The engine-tap regression from the historical first cut is fixed and pinned after an elided update.Provenance
agent-authored)e627ca5979ed77fbaf8ef5eafbea86c482f64cf5(source parentdcb334afa415fda63e94c09a77a31d107dea6128)