Skip to content

bench(lynx-table): add reusable attribution harness - #34

Closed
Huxpro wants to merge 1 commit into
mainfrom
perf/lynx-upstream-attribution
Closed

Huxpro wants to merge 1 commit into
mainfrom
perf/lynx-upstream-attribution

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add the benchmark-only P0 foundation for the Lynx performance stack.

Why

Every later performance layer needs repeatable evidence against its immediate
parent. The historical harness was coupled to the old Huxpro stack names and
SHAs, so it could not remain the durable instrument for reorganized or rebased
PRs.

Changes

The new harness can build arbitrary ordered id=revision targets, capture
heap/CPU/cold and deterministic storm evidence, compare explicit
baseline/candidate cells, and generate reports without embedding historical
branch names or SHAs. It also adds gated LYNX_BENCH_DEBUG diagnostics to the
shared web runner.

Stack

This is P0 / 8 in the proposed performance stack. It intentionally changes
no runtime, compiler, renderer, or published package source. The next layer is
#35 (perf/lynx-upstream-pacing),
based on this PR. P0 and P1 are linked in GitHub Stack octanejs#36.

Simplification

The final diff was simplified before publication:

  • removed the old fixed main, pr-10 … pr-22 matrix and issue-specific
    verdicts;
  • removed committed raw captures/reports and ignore all machine-local outputs;
  • removed the unused attribution autorows path;
  • made the plan-wire and main-thread expansion probes capability-aware so the
    harness works both before and after later stack layers;
  • made temporary source instrumentation restore every byte on success and
    failure;
  • made reportable attribution runs require n >= 5, with a separate explicit
    smoke mode.

Derived from the reusable benchmark work in #14, #22, #25, and #33.
Supports the investigation in #23.

Performance audit

Exact revisions:

  • parent: 1fbf224c36608067694d32c23d227291fec52d60
  • candidate: fefdc2751ffc9d62d6b292bed038ef8f379683a0

Production bundle equivalence

Command:

node benchmarks/lynx-table/attribution/build-matrix.mjs \
  --targets parent=HEAD^,candidate=HEAD

Instrumentation was disabled. Both production main.web.bundle files were
byte-identical:

target SHA-256
parent 1ee81ad138a510707349dc9a4451e882bb395af96e2c865f59e9015a6caee6e6
candidate 1ee81ad138a510707349dc9a4451e882bb395af96e2c865f59e9015a6caee6e6

This is the primary no-product-change gate for P0.

Observer effect and stage coverage

Command:

node benchmarks/lynx-table/stages/run.mjs --reps 5 --rows 10000

Protocol: fresh page per sample; control/profile order alternated AB/BA; one
same-host Vue VDOM create followed every pair. Host: 32× Intel Xeon Platinum
8336C, Linux 5.15.120.bsk.3-amd64, Node 22.22.2, Chromium 149.0.7827.55. Load
(1/5/15m): 1.60/1.11/0.76 at start, 2.03/1.38/0.90 at end.

10k operation control median (min–max; spread) profile median (min–max; spread) profile / control
view-attach FCP 2437.6 ms (2368.3–2589.4; 221.1) 2503.8 ms (2445.6–2568.4; 122.8) 1.027×
create 2875.6 ms (2784.4–2952.4; 168.0) 2908.0 ms (2861.2–2987.9; 126.7) 1.011×

The profiled samples also produced non-overlapping named segments:

path segment median ms min–max ms share
FCP main-slice evaluation 16.2 15.9–16.7 0.7%
FCP plan interpretation 123.3 119.6–127.7 5.0%
FCP PAPI element creation 518.8 471.6–568.6 20.9%
FCP named residual 1816.1 1768.3–1878.2 73.2%
create BTS replay 511.8 499.6–556.9 17.6%
create wire clone/transfer 83.9 80.9–98.8 2.9%
create pre-plan expansion 0 0–0 0.0%
create PAPI element creation 553.5 504.5–580.2 19.0%
create named residual 1758.2 1752.0–1764.0 60.5%

Trade-offs and cost shifts:

  • control builds contain no temporary stage/attribution marker and are
    byte-identical across parent/candidate;
  • enabling the profiler costs about 2.7% on FCP and 1.1% on create in this run;
  • raw captures, heap snapshots, bundles, and generated reports remain ignored;
    the PR body is the durable evidence record;
  • this is Lynx-for-Web CPU/browser evidence, not a native paint/layout claim.

Validation

  • pnpm format:check (repo-wide check not run)
  • pnpm typecheck (no TS or published API change)
  • pnpm test (repo-wide suite not run)
  • targeted tests:
    • pnpm --dir benchmarks/lynx-table test:stages — 7/7 passed
    • pnpm bench:lynx-attribution:test — 8/8 passed
    • reportable 10k stage benchmark above completed
    • 1k end-to-end stage and attribution smoke runs completed
    • pnpm sync completed with no tracked diff
    • git diff HEAD^ --check passed

Risk / follow-ups

The benchmark adds substantial informational tooling but no product code. Later
stack layers must benchmark their final SHA against their immediate parent and
publish the relevant tables, commands, hashes, spread, counters, and cost-shift
checks in each PR body. Native Android/iOS gates remain separate.

Provenance

  • An agent produced this diff (agent-authored)

@Huxpro

Huxpro commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

Conclusion: close this obsolete stack wrapper. The attribution tools have been rebased locally onto current upstream main, and new live-main hypotheses are now tracked independently in issues 43, 44, and 45.

@Huxpro Huxpro closed this Aug 11, 2026
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.

1 participant