Repository navigation
fix(bench): make Lynx startup measurable on Native - #886
Conversation
|
Readiness-stack device update (D2 code remains unchanged): I built and loaded the exact disposable stack What this Sandbox image proves:
What it cannot prove:
The environment conflict and the decision not to broaden either PR were recorded first in Huxpro/octane#232. #909 remains the independent readiness transport fix based on the compatible-device semantics already verified in Huxpro#233. This PR's three-file patch and scope are unchanged. |
|
#909 is now Ready and its complete upstream CI gate is green: run 33311512894 passed every Node 24 test shard, React parity shard/aggregate, heavy package/Astro and Chromium lane, website/examples, package validation, compatibility, lint, typecheck, and provenance job. This does not change the device conclusion in the previous comment: the available Explorer SDK lacks Lynx's documented timer global, so this PR stays Draft and ACK/two-frame acceptance is not claimed. The D2 branch/commit and three-file patch remain unchanged. |
|
State correction: this PR is currently Ready, not Draft. The timeline shows maintainer The technical caveat remains exactly as written: the currently available Explorer image cannot claim ACK/two-frame acceptance, and this PR's SHA/files are unchanged. |
Reproduction
The Native acceptance run in Huxpro#199 loaded a clean Octane table bundle in LynxExplorer with
enable_perf_metrics=true. Lynx emitted exactly one standardloadBundlepipeline entry, includingopenTime,lynxFcp,totalFcp, andpipelineEnd, but both Octane runtimes then failed during module evaluation:The required
lynx-native-startup-v1producer receipt never appeared, so the benchmark correctly kept the cell as DNF rather than publishing the platform entry as a successful first screen.The unconditional constructor is in the benchmark fixture, not the renderer scheduler:
benchmarks/lynx-table/app/src/App.lynx.tsrxcreated its stormMessageChannelat module scope. Currentpackages/octane/src/runtime.tsalready has its ownsetTimeoutfallback.Accident history
The benchmark methodology previously recorded that Octane's custom renderer did not expose the common pipeline boundary, and its checked-in adapter consequently suppresses
Performance.getAllPerformanceEntriesfor the current Octane entry. The #199 device run corrected that premise: the engine already stamps the standard entry once perloadBundle, even when the application subsequently fails.That makes a renderer-side timing hook the wrong fix. It would risk a duplicate entry and would still allow a failed application to look successful. Acceptance has to remain the conjunction of the engine entry and a versioned producer receipt proving transport acknowledgement, two Native frames, and semantic row state.
The conflict with the original D2 plan is recorded before this change in Huxpro#232: Huxpro#232 (comment)
Remove the failure class
MessageChannelwhen the runtime provides it and the timer task queue otherwise;lynx-native-startup-v1only from the background root's thenableroot.render()result, after its real transport acknowledgement and two Native animation frames;MessageChannelbefore running the real 1k table workload, including both storms, and pins the receipt ordering/shape.No timing marker is added to
packages/lynx. The engine owns theloadBundleentry. The direct first-screen path, decline to background command path, and adoption continue to use their existing renderer behavior; this patch does not import or alter that program/adoption machinery. The receipt source has a single publication site on the live background root, and the existing first-screen suite continues to cover direct paint/adoption and the documented native-list decline path.This branch is based directly on
octanejs/octane@main; the transport codec commit from #885 is not an ancestor and no codec, validation-mode, program, or adoption implementation is included.Validation
5f7646aca90fab3a6be72ec756018676f59b13bcf1d7649bb6d782f167b1a015;globalThis.MessageChanneldeleted: 1k and 10k passed, including 50 update-storm and 30 select-storm commits;pnpm typecheck;pnpm format:check;pnpm syncwith no tracked drift;pnpm changeset:check.Exact-device acceptance: blocked
The branch's exact 492,871-byte bundle was fetched and opened on leased Sandbox device
aic-i18n-bd-fullport.byteintl.net:55864, but acceptance failed rather than remained pending:Performance.getAllPerformanceEntriesreturned zero entries for this bundle, an archived Octane control, and a known-goodvue-vdomcontrol. That Explorer install (versionName=1.0,versionCode=1, installed 2026-08-20) does not expose the engine pipeline entry that Add Cloudflare Workers adapter #199's earlier image did.root.render(), and then waited indefinitely for its transport acknowledgement. D1+D2 without any readiness change reproduced the timeout.Follow-up isolation on a second device corrected the initial attribution:
0fc84da0bundle (SHA-2561f3b252d…) ACKed, but its preserved benchmark patch includes both a production string wire and a repeating correlated ready-request; it is not a fixture-only/current-main commit-range control;0fc84da0checkout with this exact D2 patch still returned a thenable and never ACKed;MessageChannel, confirming this PR's fallback is necessary; retaining the fallback while deleting the semantic snapshot block still hung, so the snapshot is not the cause;1a337ac9…);3decf55d…) and emitted a validlynx-native-startup-v1receipt: module1787924596401, ACK1787924596456, frames1787924596463/1787924596480, and the exact rows-0 semantic state.The successful overlay proves two independent transport prerequisites: D1's encoded string wire and a separate listener-installation/readiness retry. Neither is the requested standard pipeline entry, and
Performance.getAllPerformanceEntriesremained empty. This PR contains neither prerequisite and does not import program/adoption work.The conflicts, dependency-isolation correction, and orthogonal controls are recorded chronologically in Huxpro#232, including the fixture-control correction and the final readiness result. This PR remains Draft: it does not satisfy the required engine-entry + transport-ACK + two-frame acceptance, and no private ACK metric or synthetic pipeline marker is substituted.
Related: Huxpro#199, Huxpro#232.
Note
Low Risk
Changes are confined to the Lynx table benchmark fixture and its tests; no production renderer or auth/data paths are modified.
Overview
Fixes Lynx Native benchmark acceptance by removing the module-load
MessageChannelcrash and emitting thelynx-native-startup-v1producer receipt the harness expects.Storm scheduling in
App.lynx.tsrxnow createsMessageChannelonly when it exists;nextMacrotaskfalls back tosetTimeout(0)so update/select storms still run one commit per tick on Native.Startup measurement moves into
index.ts: after the backgroundroot.render()promise resolves, the app waits twolynx.requestAnimationFramecallbacks, reads__LYNX_BENCH_SNAPSHOT__(new refs + snapshot hook onApp), and sets__LYNX_BENCH_STARTUP__/ logs__NATIVE_BENCH_STARTUP__with transport ack timing and semantic row fields. Render failures set__LYNX_BENCH_ERROR__.native-fixture.test.mjsregresses the no-MessageChannel1k table run (including storms) and pins receipt ordering/shape against the entry and snapshot source.Reviewed by Cursor Bugbot for commit 7378d00. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.