Repository navigation
fix(lynx): restore the dense first mount for decoded program runs - #1700
Merged
Merged
Conversation
Since #885 made the transport JSON-encode every message, the main thread receives each program run as fresh, mutable data. prepareLynxHostBatch takes the dense host record store only for a frozen run, so every fresh root's first mount fell back to staging one record per host. The main thread now freezes a fresh root's validated compact runs before it prepares them, as it already did for runs appended after first-screen adoption. The lynx-render reentrant pair also broke with #885: runReentrantCommits still dispatched raw objects, which the receiver rejects, so the pair measured 0 ms. It now encodes the burst through the transport codec before the timer starts. A new fixture contract, benchmarks/lynx-render/workload.test.mjs, runs on every pull request and in the weekly Bench pre-step, so a wire change cannot strand the workload again. The build is shared with run.mjs through build.mjs. Refs #1055 Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
marked this pull request as ready for review
October 4, 2026 15:10
Contributor
Benchmark report
Compares js-framework: 1k/10k row operations
All 20 timed operations (19 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
50 other measured values are unchanged. Public-import reachability bundles (bytes)No changes across 105 measured values. |
3 of 4 tasks
trueadm
added a commit
that referenced
this pull request
Oct 4, 2026
… (#1710) #1700 freezes a fresh root's decoded program runs so a first mount takes the dense host record store again. That costs the main thread 141 raw bytes: preview main gzip 83,657 -> 83,742 and IFR 89,331 -> 89,404, both over their measured + 32 caps. The weekly-only lynx-bundle-size gate never ran on that pull request. Raise both caps to the new measurement + 32. Re-pin the background program at 288,390: it shrank after the 2026-10-03 reset (#1652, #1662), and its exact pin is the next gate in the same block. Budget values and their comment only. Refs #1055 Co-authored-by: Claude Opus 5.5 <[email protected]>
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
Two weekly
lynx-renderfailures trace to #885 (957b91046b), which made the Lynx transport JSON-encode every message. This PR fixes both. #1641 triaged the weekly breaches and left lynx-render unwaived for this owner fix. This fix is also a prerequisite for Phase 1 of #1055, the dedicated Lynx compiler backend, whose numbers depend on a working lynx-render.1. The first mount lost its dense path. This is a product fix in
@octanejs/lynx.prepareLynxHostBatchtakes the dense host record store only whenObject.isFrozen(command.values).installLynxMainThreadnow freezes a fresh root's validated compact runs before preparing them. The post-first-tree path already did this. The decoded run is receiver-local, so freezing it cannot affect the sender.2. The reentrant bench pair was dead. This is a harness fix.
runReentrantCommitsstill dispatched raw objects, which the receiver rejects. The pair received zero acknowledgements and reported 0 ms, andbench.mjsfailed the suite as a harness failure.encodeLynxTransportValuebefore the timer starts, so the interval stays the receiver's drain.Keeping it from recurring.
benchmarks/lynx-render/workload.test.mjstakes about 1 s. It builds the production workload, drains a reentrant burst over the encoded wire, and mounts keyed rows as one compiled program run with one compact acknowledgement.ci:workflow:teston every pull request and in the weekly Bench pre-step.scripts/ci-workflow.test.mjspins both.build.mjsis shared byrun.mjsand the contract, so both exercise the same bundle.Guards. The ceilings are unchanged. The two
create_*guard notes record the post-#885 measurement and the cause of the weekly breach.The README now states that both sides pay serialization.
Refs #1055
Evidence
node benchmarks/bench.mjs --quick lynx-render --ratios, same machine (Apple M5 Max) and session, currentmain76b5b02671against this branch:create_1k_rows_mscreate_10k_rows_msupdate_10k_rows_msdrain_ms20k vs 10k11a9da935a, measuredcreate_1k1.66× → 1.14× andcreate_10k1.59× → 1.13×.Validation
vitest run --project lynx packages/lynx/tests/transport-conformance.test.ts: 5 passed. The new case fails without themain-thread.tschange (expected +0 to be 24dense-path__AppendElementcalls) and passes with it.node --test benchmarks/lynx-render/workload.test.mjs: 2 passed.node --test scripts/ci-workflow.test.mjs: 72 passed.octane-tsc -p packages/lynx/tsconfig.json: clean.pnpm format:files:checkon every changed file.pnpm sync: no generated changes.pnpm format:check,pnpm typecheck, andpnpm testwere not run locally. CI runs them.Risk / follow-ups
lynx-render --quickto PR bench.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches main-thread commit preparation for first compact mounts; scoped to post-validation freezing with existing reject-on-failure behavior, but it is on the hot path for large keyed lists.
Overview
Restores fast first-screen mounts for compiled keyed rows after Lynx transport messages became JSON strings. Decoded
mount-template-runpayloads are mutable, so fresh roots no longer qualified for the dense host record store and fell back to per-host staging (~2× slower at 1k rows).installLynxMainThreadnow freezes validated program runs on the negotiated compact first mount—the same step the post-first-tree path already took—so output and wire semantics stay the same.The lynx-render harness is aligned with production: reentrant drain benchmarks encode commits with
encodeLynxTransportValue(raw objects are rejected), encoding happens before the timer, and a sharedbuild.mjsplusworkload.test.mjscontract runs on every PR and in the weekly Bench workflow. Baseline guard notes and the benchmark README now record that both Octane and ReactLynx pay serialization on the wire.Reviewed by Cursor Bugbot for commit 12015ca. Bugbot is set up for automated code reviews on this repo. Configure here.