Repository navigation
perf(lynx): streamline dense clear teardown - #762
Merged
Merged
Conversation
1 task done
trueadm
marked this pull request as ready for review
August 15, 2026 20:49
This was referenced Aug 23, 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
destroy-runwithout materializing per-host teardown commandsRefs Huxpro#57.
Why
The 10,000-row Lynx clear path synthesized 100,000 commands, explicitly detached 20,000 events, and revalidated the full dense store before performing the unavoidable 10,000 native root removals. This kept Octane materially behind the React/Vue tier even though the accepted dense state already proved the exact teardown shape.
Changes
@octanejs/lynxpatch changeset, structured evidence with all bundle SHA-256 values, and nine deterministic raw-run archives underbenchmarks/lynx-table/stages/results/issue57-clear-teardown*.Performance
Same machine, pinned Chromium, production bundles, seven repetitions, zero DNF:
Adjacent AB/BA comparison against upstream improved clear by 23.8% and 19.3%. The 38-cell challenge matrix had zero DNF and no latency/FCP cell regressed by more than 5% in both orders. Production bundle deltas were +463 B gzip web and +688 B gzip Lynx; measured 10k heap decreased on both threads.
Full raw samples, attribution counters, rejected candidates, secondary costs, and the disclosed earlier noisy reverse cohort are in the committed evidence report. The original featured, profile, performance AB/BA, and challenge AB/BA runner files are committed as
.json.gzarchives with verified hashes.Validation
pnpm format:check— not run repo-wide; all changed text files passed targeted Prettier checkspnpm typecheck— not run repo-wide; changed Lynx production files passed scoped typecheck andpackages/lynx/tsconfig.testing.jsonpassedpnpm test— 2,190/2,193 files and 21,588/21,603 tests passed in the full concurrent run; the 15 failures were fixed timeouts/one Vite504 Outdated Optimize Deppnpm syncgit diff --checkRisk / follow-ups
Provenance
agent-authored)Note
Medium Risk
Changes certified teardown and native-event lifetime in core host-driver paths; eligibility is narrow and heavily tested, but incorrect certification could leak events or skip cleanup on edge states.
Overview
Adds a fast path for a sole, pristine dense
destroy-run: the host certifies eligibility on an untouched dense store (tracked via a newmutatedflag) and tears down without expanding into per-host commands or running thousands of explicit native event unbinds.Direct apply removes certified run roots in stride, clears the native-event journal structurally only after all PAPI removals succeed (so partial faults still get full terminal cleanup), and keeps the existing expansion/validation path for partial, reordered, mutated, portal/list/ref, faulted, and reused states.
Profiling and benchmarks gain stage timers and counters (
destroyRunExpandMs,denseValidateMs,eventDetachMs,papiRemoveMs,synthesizedCommands, etc.) wired through the Lynx table harness; committed issue-57 evidence documents large clear wins with no dual-order regressions above 5%.Tests extend the fake PAPI and host-driver coverage for direct teardown, foreign siblings, mutation/reorder fallbacks, stale batches, and fault timing around event cleanup.
papi.tsexposes the receiver-boundremovereference unchanged in behavior.Reviewed by Cursor Bugbot for commit 5c4addb. Bugbot is set up for automated code reviews on this repo. Configure here.