Repository navigation
perf(lynx): drain reentrant commits linearly - #860
Merged
Merged
Conversation
jonkwheeler
marked this pull request as ready for review
August 26, 2026 13:47
trueadm
approved these changes
Aug 26, 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
Why
Changes
lynx-renderValidation
pnpm format:checkpnpm typecheckpnpm testpnpm format:files:checkpnpm --filter @octanejs/lynx test(25 files, 362 tests)tsgo --noEmitfor Lynx source, testing, and typetests projectsnode benchmarks/bench.mjs --quick --ratios lynx-renderpnpm syncRisk / follow-ups
tscscript still reports the pre-existing acknowledgement literal error atsrc/main-thread.ts:2257; root/CI usestsgo, and all three relevanttsgoprojects pass.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches Lynx main-thread commit ordering and reentrant queue draining on the hot transport path; behavior is guarded by targeted tests and new benchmark correctness checks.
Overview
Fixes superlinear drain cost when many Lynx commits are queued synchronously during Element PAPI work (e.g. reentrant
__SetID). The main-thread commit loop no longershift()s the pending queue; it walks with an index, tombstones consumed entries, then clears the array so large bursts stay O(n) instead of copying the tail on every dequeue.Adds an Octane-only
lynx-renderworkload (runReentrantCommits) that fires a 10k/20k commit burst from inside one host update, checks ordered acks/completions and the final native id/version, and recordsdrain_ms.ratios.jsoncaps 20k vs same-run 10k at 3.5x to catch regressions back toward the old ~4.4x scaling.Reviewed by Cursor Bugbot for commit 9154091. Bugbot is set up for automated code reviews on this repo. Configure here.