Skip to content

perf: bound the Element PAPI floor for per-row main-thread materialization - #53

Draft
Huxpro wants to merge 2 commits into
mainfrom
perf/lynx-papi-floor
Draft

Huxpro wants to merge 2 commits into
mainfrom
perf/lynx-papi-floor

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • add benchmarks/lynx-table/stages/papi-floor.mjs: a speed-of-light Element
    PAPI probe that bounds the platform floor for materializing the exact
    10,000-row table shape (70k host elements) with a bare public-PAPI loop in
    the same main-thread realm where Octane's receiver runs
  • record the measured floor and the same-window Octane stage decomposition in
    stages/results/papi-floor-10000.{json,md}
  • no product code changes

Why

#49 (roadmap item 1 of the #51 umbrella) requires re-confirming a
≥10% owner inside the measured papi_element_creation / mt_apply_other
stages before touching production code. The probe answers the prior question:
how much of those stages is irreducible host cost, and how much is collapsible
Octane-side machinery?

Measured verdict (n=5, quiet host, zero DNF; full data in stages/results/papi-floor-10000.md)

  • papi_element_creation is 99.0% platform floor (bare-loop 556 ms vs
    stage 561.5 ms): collapsible 5.5 ms = 0.5% of the create wall. The factory
    calls themselves are host cost; only fewer calls would change it, and the
    row shape (7 host nodes incl. raw-text children) is fixed by the driver
    contract and native parity.
  • mt_apply_other is 84.7% floor-equivalent (props+events+tree 291.7 ms
    vs stage 344.3 ms): collapsible 52.6 ms = 4.6% of the create wall.
  • Flush batching is not a lever: single-flush 2183.8 ms vs chunked
    (⌈rows/10⌉) 2190.1 ms. Same-window octane create walls: control 1145.5 ms,
    profile 1221.7 ms.
  • All three sub-owner candidates named by the roadmap for per-element MTS
    machinery (create-with-props call fusion, flattened per-host bookkeeping,
    batched insertion) fail the ≥10% owner gate on the web harness: NO-GO
    for that product change; the probe ships as the reusable measurement
    instrument and negative control. The featured create-cell ownership moved to
    cross-cycle state accumulation, which the next stacked PR measures and
    fixes.

Validation

  • pnpm format:files:check on the three added files; pnpm sync clean
  • pnpm typecheck — not run: no TypeScript surface changed (bench .mjs only)
  • pnpm test — not run: no package code changed; probe is measurement-only
  • probe run: n=5 per cell, interleaved AB/BA, quiet-host preflight
    enforced, zero DNF

Risk / follow-ups

  • Probe-only change; no runtime surface touched. Results are host-stamped; the
    floor claim is scoped to Lynx-for-Web. The one-shot foreign-task presentation
    anomaly (1404 ms vs octane's 145.9 ms message-paced residual) is documented
    as renderer scheduling and excluded from the stage-floor comparison.
  • Follow-up (next stacked PR): the create-after-clear re-publication cliff per
    the measured ownership.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


Generated by Claude Code

…ation

Add a speed-of-light probe that materializes the exact 10,000-row table
shape with a bare public Element PAPI loop in the same main-thread realm
as the Lynx receiver, interleaved AB/BA with octane control/profile
create cells, and record the measured floor:

- papi_element_creation is 99.0% platform floor (collapsible 0.5% of
  the create wall)
- mt_apply_other is 84.7% floor-equivalent (collapsible 4.6%)
- chunked vs single flush makes no difference

All three sub-owner candidates from the roadmap fail the >=10% owner
gate for per-element MTS machinery on the web harness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants