Repository navigation
Conversation
This was referenced Aug 10, 2026
Owner
Author
|
Conclusion: close as superseded. Upstream PRs 693 and 700 replace the plan-wire mechanism with compact templates and incremental template runs. |
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
Why
The compiler already hoists stable host structure into universal plans shared by the background and main bundles, but the transport discarded that structure and cloned every host create/event/insert command independently. This layer adds a conservative plan registry and wire representation without changing the compiler, handle acknowledgement, listener ownership, PAPI validation, or apply paths.
This is the independently mergeable P3 replacement for #12, frozen at
b4b0ab92df2f4b4ec0cf3b1a203158f8aa6943ecover source parentadfad409867733a524c5ab200c15b0510535586d. The historical PR remains untouched.Changes
packages/octane/src/universal-core.ts: expose plan-instance provenance only to async transports that opt into plan instantiation; release the provenance and prepared payload after transport settlement.packages/lynx/src/core/plan-wire.ts: canonicalize plans, derive and collision-check wire identities, prove fold footprints, fold eligible instances, and expand instantiate commands without per-commit recursive helper allocation.packages/lynx/src/core/{protocol,transport}.ts: validate instantiate/registry messages, consume only identities announced by main, poison local collisions, and keep the original prepared batch for acknowledgement/worklet bookkeeping.packages/lynx/src/{main-renderer,main-thread}.ts: register eligible plans, announce initial and late identities, and expand before the existing validation/apply pipeline.benchmarks/lynx-tablewith the real main-renderer bundle/registry bridge, strict one-command-per-row create guards, stage instrumentation, and a race-free click-to-presentation arm handshake.octaneand@octanejs/lynx.Stack
71e1b8a88a8c3e37cc005d37a8e6f75cf31088b4)4a444b1b9665d8b4020d774a220bd0e21933cdb2)fd2ea96d5fe7fc4d39d0d24fe5e9aee8f196b111)The fork review stack is GitHub Stack octanejs#36 and is managed with the official
gh stackextension. Upstream delivery remains bottom-to-top.Simplification
Performance audit
Exact comparison:
71e1b8a88a8c3e37cc005d37a8e6f75cf31088b44a444b1b9665d8b4020d774a220bd0e21933cdb265e026f73dd62bb6484c2806979eec1a2d4f0a1c9938ef6108893bd6f765865a, P36d989b92a0f107f5cd7d71ba443f23a912397997f691cb9fa4825b0e51fb585c07c72dbaeae4bfcade074fbebeb33d2570a858eb91bed0f009fe0e2f0f5d579a, P3d7dae63ae1522b79898f6de98787ea75467a40a6df292c3c5d3a80e3ac0f6c74p3-final-candidate-wire.json,p3-final-control-{cpu,heap,cold}.json,p3-final-control-cold-reverse.json, andp3-final-profile-{cpu,heap,cold,storm}.jsonunderbenchmarks/lynx-table/attribution/results/Deterministic wire model
Three drift-checked candidate iterations at 1k/10k; the parent capture uses the same final harness. Every semantic oracle passed.
The final
node benchmarks/bench.mjs --ratios lynx-tablerun passes all 25 applicable guards. Reverting the fold restores 16 commands/row and breaches both strict create floors.Create@10k CPU attribution
Five fresh pages/workers per target. Control captures observer-free totals; profile captures named allocation stages.
The product claim is the deterministic 16x command and 68.7% byte reduction, not a wall-clock speedup: control/profile directions agree that create is not slower, but per-node background staging and main-thread expansion/PAPI apply still exist. In the candidate profile, owner materialization (231.7ms), transaction staging (397.4ms), and folding (51.0ms) explain 86.7% of BTS active time.
Heap and lifecycle
Five repetitions per scale with explicit CDP GC and fresh pages/workers:
The increase is linear and below the 5% decision threshold at every scale. Clear residuals, synchronous view destruction, and worker release all complete in every repetition. Heap snapshots used during simplification exposed retained provenance/payload and per-instance closure costs; after releasing/refactoring those, the remaining registry/instance metadata is classified as bounded resident overhead rather than a lifecycle leak. V8 context names move with bundled source offsets, so snapshot class-name deltas alone were not treated as proof.
Cold/steady and storm controls
In the first control run, create is -1.0%; select +0.7%; update10th +2.6%; swap +2.3%. First replace (+7.5%) and clear (+8.6%) crossed the 5% repeat threshold, so the entire cold matrix was repeated in reverse target order. Replace then measured +0.9%; create moved from -1.0% to +9.3%; clear remained +7.5%. Their steady deltas were -4.0%, -2.3%, and -0.6% respectively in the reverse run. This order-sensitive first-sample spread is classified as realm/JIT/RAF startup noise; steady samples and exact wire/presentation counts do not reproduce a product regression. Clear's repeatable ~6ms first-sample cost is disclosed as a cold-start sensitivity, not hidden.
The click boundary was corrected during the audit: DOM target lookup now finishes before arming, and a synchronous arm-token/result handshake prevents click-before-listener races. Select still quantizes into roughly 20ms and 33ms RAF buckets while every exact profile sample remains one commit, two changed rows, and 237 bytes. It is therefore reported as phase-sensitive rather than a stable gain/regression.
Profile storm medians at 10k are update 154.5 → 158.7ms (+2.7%) and select 43.1 → 41.2ms (-4.4%), with identical presentation and wire counts and all semantic checks passing.
Validation
@octanejs/lynxsource/testing/typetests, Octane core, and benchmark apptsrx-tsc --noEmitpnpm test- root run completed with 1,662 files / 18,033 tests passing; 9 unrelated projects / 26 tests failed under full-workspace contention, plus missing Playwright WebKit and a website server startup. No P3-owned project failed.pnpm sync;git diff --check; final worktree cleanRisk / follow-ups
Provenance
agent-authored)b4b0ab92df2f4b4ec0cf3b1a203158f8aa6943ec(source parentadfad409867733a524c5ab200c15b0510535586d)