Skip to content

feat(lynx): publish loadBundle first-screen timing - #280

Merged
Huxpro merged 2 commits into
new-lynxfrom
perf/lynx-loadbundle-timing-276
Sep 4, 2026
Merged

Huxpro merged 2 commits into
new-lynxfrom
perf/lynx-loadbundle-timing-276

Conversation

@Huxpro

@Huxpro Huxpro commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Closes #276.

Outcome

Native Octane first screens now finish the exact loadBundle pipeline Lynx started for the page. Performance.getAllPerformanceEntries consequently publishes a real name: "loadBundle" entry with totalFcp and lynxFcp at 0, 1k, and 10k startup rows.

Mechanism

  • verified: native places its already-started load pipeline identity in __RenderPage renderOptions.pipelineOptions (pipelineID, pipelineOrigin, needTimestamps). Octane previously validated and discarded all render options.
  • The receiver now validates and retains those three scalar fields, then passes them only to the one first-screen __FlushElementTree call. Both the direct PAPI path and its staged fallback carry the same option.
  • verified: this changes timing observability: yes. It associates the existing first-screen flush with native's load pipeline so native can close paintEnd and publish FCP. It does not delay or reorder render, publish, capture, or announce.
  • verified: it does not change the background/main transport payload. The regression test rejects the pipeline ID appearing in any inbound protocol message, and the table wire harness remains unchanged.
  • No framework-created replacement pipeline and no ACK/frame proxy are used.

Device acceptance

Device: Lynx Sandbox aries_10, Android 10, Lynx Explorer, LepusNG. Instrument: Lynx DevTool CDP Performance.getAllPerformanceEntries; boundary: loadBundle.openTime -> totalFcp and loadBundleStart -> lynxFcp. These are one-shot acceptance observations, not a performance comparison.

startup rows qualifying entry totalFcp lynxFcp bundle SHA-256
0 loadBundle 70.151 ms 19.352 ms 71142dd5ced96ec435dbab6c7ad272428374b751a6623e729d61163990959269
1,000 loadBundle 1416.646 ms 1373.625 ms 343005a3eea7ee8bfaa311ca62c8380975dca06860a5f1dcb81ffd4c0a49d566
10,000 loadBundle 15672.465 ms 15628.521 ms 64e4d8686ab6c732148b1f2f4137fe370d30a57dd495514b83763c4da7e78c92

The 1k screen visibly painted the seeded table and the DevTool error console was empty. Before this change the standing device report is DNF 6/6 at completed Octane cells because no qualifying entry was emitted.

Build provenance: base new-lynx@8a30448d2; change eb53f7451; production BENCH_MTS_PROGRAM=1, BENCH_DEVICE_MESSAGECHANNEL_FALLBACK=1, and BENCH_AUTOROWS={0,1000,10000}.

Verification

  • Red test: removing the first-screen forwarding makes the new test fail with flush option undefined.
  • pnpm exec vitest run packages/lynx/tests/first-screen.test.ts packages/lynx/tests/first-screen-direct.test.ts packages/lynx/tests/main-thread-events.test.ts packages/lynx/tests/transport-conformance.test.ts — 129 passed.
  • pnpm --filter @octanejs/lynx test — 50 files / 824 tests passed.
  • pnpm exec tsgo --noEmit -p packages/lynx/tsconfig.json — passed.
  • node benchmarks/lynx-table/run.mjs 1 — passed at 1k/10k; create remains one command and the existing update/select/clear wire gates are unchanged.
  • Prettier and git diff --check — passed.
  • pnpm sync — passed and left the worktree clean before push.

The legacy pnpm --filter @octanejs/lynx typecheck still hits the existing main-thread.ts ACK adoption string-widening error. The same error reproduces on the separate #275 worktree and tsgo is green here, so it is recorded rather than attributed to this change.

Risk

The new data originates from the engine lifecycle, is normalized before reflection, is validated as an exact scalar pipeline identity, and is consumed once. Hosts that omit pipelineOptions keep the previous flush behavior. Malformed options report through the existing lifecycle diagnostic path rather than reaching Element PAPI.

Two gate findings on the loadBundle timing change:

- The strict pipelineOptions parse ran inside the same try as the
  __RenderPage page-data dispatch, so a host shipping a malformed
  pipeline identity lost its initial page data along with its FCP
  entry. The parse now settles in its own try: the diagnostic reports,
  the pipeline stays null, and the page-data message this event has
  always delivered still goes out. Red-verified by a test that feeds a
  pipelineOptions missing needTimestamps alongside real page data and
  asserts the data reaches the background.

- Only the direct-applier flush had coverage; the widened
  prepared.apply(flushOptions) forwarding had none. A host-driver test
  now pins that whatever an apply is handed reaches the page flush
  verbatim, and that a bare apply keeps the bare flush. Red-verified by
  deliberately dropping the forwarding.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YHfFsy9CLaRovTFH8pTGyY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants