Repository navigation
perf(lynx): keep optional worklet runtime cold - #707
Merged
Merged
Conversation
1 task done
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 1321184. Configure here.
Huxpro
marked this pull request as ready for review
August 11, 2026 18:52
This was referenced Aug 11, 2026
This was referenced Aug 12, 2026
1 task done
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
threadFunctionsModuleroute so the compiler imports thread helpers only when compiled output needs them@octanejs/lynx/main-worklets, connected to the ordinary receiver through a late-install capability seamThis follows the residual investigation in Huxpro/octane#44. It does not revive the receiver-level lazy bridge rejected there: the compiler selects the cold feature module and the ordinary receiver keeps its existing call shape.
Validation
Exact upstream base:
9b147781c9b4ec4df053a059633978ddc0ed922a.No-worklet production artifacts:
The background program remains exactly 271,737 raw bytes with identical semantic markers. Its encoded checksum changes and gzip is 73,182 → 73,185 B because optimizing the independent main graph changes Rspack's debug-metadata hash and minifier-local symbol allocation; decoding both artifacts found only that hash plus one-character local renames, with no background source, command, or semantic change. This is the itemized exception allowed by #44's acceptance gate.
Final same-host Lynx-for-Web n=9, base → candidate at 10k rows:
An earlier candidate→base n=9 order measured selectStorm 164 → 171 ms; both orders remain inside the 5% decision boundary. A separate n=20 dual-thread render run measured candidate/base create@10k 135.4/134.4 ms and update@10k 22.5/22.8 ms, with identical command/program/ack/selector counters. Lynx list teardown retained 0 cells.
pnpm format:checkpnpm typecheckpnpm testpnpm exec vitest run --project lynx --silent=passed-only(338 tests)pnpm syncnode benchmarks/bench.mjs --only lynx-bundle-sizenode benchmarks/bench.mjs --only lynx-list --ratiosRisk / follow-ups
The new renderer descriptor field participates in the normalized cache signature. Renderers that omit it retain byte-for-byte compiler import behavior; the compiler test suite covers that fallback. The feature provider supports both evaluation orders and late chunks, and rejects competing providers.
Provenance
agent-authored)Note
Medium Risk
Changes compiler import routing and Lynx main-thread cross-thread/worklet lifecycle; behavior is heavily tested but regressions could affect worklet-enabled apps or bundle graphs.
Overview
Introduces an optional
threadFunctionsModuleon universal renderer descriptors so the compiler emits thread-function helper imports only when compiled output needs them, instead of always pulling them through the main renderer module.For Lynx, worklet registries and cross-thread APIs move to
@octanejs/lynx/main-worklets, wired into the ordinary main-thread receiver via a small subscribe/provide capability layer. Bundles with no worklets keep a lightweight stub registry and monomorphic publication paths; when a static or late chunk loads the feature, existing host containers upgrade through a replaceable registry identity without changing receiver call shapes.lynx-bundle-sizegains frozen gzip/raw budgets for no-worklet preview/IFR main slices and asserts the main-thread graph excludesmain-worklets/workletsunless the app retains worklet helpers.Reviewed by Cursor Bugbot for commit 71b758e. Bugbot is set up for automated code reviews on this repo. Configure here.