Skip to content

chore(bench): rebaseline the codegen-size gzip ratio - #1645

Merged
trueadm merged 1 commit into
mainfrom
chore/codegen-size-ratio-rebaseline
Oct 3, 2026
Merged

trueadm merged 1 commit into
mainfrom
chore/codegen-size-ratio-rebaseline

Conversation

@trueadm

@trueadm trueadm commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The weekly codegen-size guard gzip (target compiled, reference source, maxRatio 1.06) breaches on main: 35,039 / 27,077 = 1.294×. Its record, 26,132 / 24,713 = 1.057×, dates from 136b0e3 (#638, 2026-08-07). The suite wrote no numbers from 2026-09-16 until its Rspack chunk assertion was fixed, so nothing checked the growth in between. The brief asked to separate corpus drift from compiler-output growth. Both turn out to be intended, so this PR rebaselines the guard and records the split in its note.

How the growth splits

I measured with a script that reproduces run.mjs's corpus measurement exactly: it gives 26,132 / 24,713 at 136b0e3 and 35,065 / 27,077 at 11a9da9, matching the harness.

compiled gzip source gzip ratio
136b0e3 compiler, 136b0e3 corpus (the record) 26,132 24,713 1.057
136b0e3 compiler, the 14 old corpus files the current compiler still accepts 22,338 21,695 1.030
main compiler, those same 14 old files 25,107 21,695 1.157
main compiler, main corpus 35,039 27,077 1.294

Compiler growth on a fixed corpus: +2,769 B (1.124×).

  • I ran a 22-point sampled timeline, then bisected (git bisect run) over the fixed 14 files, each checkout with its own installed dependencies. The largest step is 5ead1ff (feat: add async signals and streaming SSR #1069, async signals and streaming SSR), at +2,065 B (23,364 → 25,429). Every opaque text and attribute binding became signal-capable: an inline typeof dispatch, a bindSignalText/bindSignalAttribute call with an 8-hex site key, and an extra bag field. perf: drop the signal tax from ordinary attribute, text and style bindings #1270 removed the runtime side of that tax but kept the per-binding codegen by design.
  • The rest is gradual: +1,026 B from 2026-08-07 to 2026-09-14, then −311 B of later trims.

Corpus drift: +6,138 B compiled, +2,364 B source. The "fixed" corpus includes test fixtures that later tests extended:

fixture compiled gzip, 08-07 → main
context.tsrx 2,161 → 5,296
boundary.tsrx 1,373 → 2,774
control.tsrx 1,293 → 2,503
controlled-forms-diff.tsrx 1,039 → 1,677
components.tsrx 1,633 → 2,048

The current compiler rejects the old context and components sources, so compiler and corpus growth can't be separated for those two.

Changes

  • benchmarks/baselines/ratios.json: the guard's ceiling moves 1.06 → 1.30, which leaves 161 B. The note records the measurements and the split above.

Validation

  • The corpus measurement above, at 4212874 (current main) on Node 24.18.
  • node benchmarks/codegen-size/run.mjs with the weekly triage's Rspack harness fix applied locally reports 35,065 / 27,077 at 11a9da9. The fix is uncommitted and not part of this PR.
  • pnpm format:files:check benchmarks/baselines/ratios.json.

Risk / follow-ups

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
Benchmark baseline and documentation only; no runtime, compiler, or application behavior changes in this diff.

Overview
Raises the codegen-size CI guard ceiling for compiled vs source gzip from 1.06× to 1.30× in benchmarks/baselines/ratios.json, matching current main (35,039 / 27,077 ≈ 1.294×).

The updated note documents why the old 1.06× record was stale (suite gap until a Rspack chunk fix), splits growth into compiler output (~1.124× on a fixed subset of corpus files, largely #1069 signal-capable bindings) versus corpus drift (fixture extensions in context, boundary, control, etc.), and notes 161 B headroom under the new cap.

Reviewed by Cursor Bugbot for commit 7197307. Bugbot is set up for automated code reviews on this repo. Configure here.

The compiled/source gzip guard (maxRatio 1.06) records 26132 / 24713 from
136b0e3 (#638). The suite wrote no numbers from 2026-09-16 until its Rspack
chunk assertion was fixed, so nothing checked it. Main now measures
35039 / 27077 = 1.294x.

Splitting the growth:
- Compiler: the 136b0e3 corpus files the current compiler still accepts
  (14 of 16) compile to 22338 -> 25107 gzip. A sampled timeline plus git
  bisect over that fixed set names 5ead1ff (#1069): +2065 B in one step,
  because every opaque text and attribute binding became signal-capable.
  #1270 kept that design while removing its runtime tax. The rest is gradual.
- Corpus: tests extended the context, boundary, control,
  controlled-forms-diff and components fixtures. Source gzip rose
  24713 -> 27077 and those fixtures add the remaining +6138 compiled bytes.

Both are intended, so the ceiling moves to 1.30, leaving 161 B.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@trueadm
trueadm marked this pull request as ready for review October 3, 2026 08:05
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent chore PR: tooling, dependencies, repo maintenance labels Oct 3, 2026
trueadm added a commit that referenced this pull request Oct 3, 2026
The waived guards now have owner PRs: ssr-final-replay try_closures (#1644),
root-transactions equal_reads (#1643) and codegen-size gzip compiled/source
(#1645). #1645 rebaselines the same codegen-size entry, so this branch no
longer edits it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No size increases and no timing regressions outside noise.

Compares 421287457 with f634b7841 on the same runner. Timing verdicts require a change beyond the combined margin of error (at least 5%) and one 0.1ms timer tick, with the fastest sample also moving beyond that margin. Workflow run

js-framework: 1k/10k row operations (ms, lower is better)

All 20 timed operations (20 within noise)
target operation base head Δ noise
octane-tsrx run 3.60 3.43 −4.7% ±21% ⚪ within noise
octane-tsrx replace 8.45 6.97 −17.5% ±26% ⚪ within noise
octane-tsrx add 3.51 3.38 −3.7% ±14% ⚪ within noise
octane-tsrx update 0.48 0.49 +2.1% ±52% ⚪ within noise
octane-tsrx select 0.22 0.19 −13.6% ±64% ⚪ within noise
octane-tsrx swap 0.42 0.41 −2.4% ±31% ⚪ within noise
octane-tsrx remove 0.43 0.39 −9.3% ±62% ⚪ within noise
octane-tsrx runlots 29.54 30.12 +2.0% ±33% ⚪ within noise
octane-tsrx select_lots 0.24 0.24 −0.0% ±52% ⚪ within noise
octane-tsrx clear 44.58 44.78 +0.4% ±8% ⚪ within noise
octane-jsx run 3.51 3.40 −3.1% ±7% ⚪ within noise
octane-jsx replace 7.00 7.49 +7.0% ±18% ⚪ within noise
octane-jsx add 3.19 3.19 −0.0% ±9% ⚪ within noise
octane-jsx update 0.54 0.55 +1.9% ±32% ⚪ within noise
octane-jsx select 0.38 0.38 −0.0% ±31% ⚪ within noise
octane-jsx swap 0.66 0.63 −4.5% ±43% ⚪ within noise
octane-jsx remove 0.68 0.57 −16.2% ±25% ⚪ within noise
octane-jsx runlots 29.30 28.90 −1.4% ±11% ⚪ within noise
octane-jsx select_lots 2.57 2.92 +13.6% ±33% ⚪ within noise
octane-jsx clear 46.24 46.66 +0.9% ±9% ⚪ within noise

Application bundle size (bytes)

No changes across 45 measured values.

Public-import reachability bundles (bytes)

No changes across 105 measured values.

@trueadm
trueadm merged commit f12cc7f into main Oct 3, 2026
51 of 54 checks passed
@trueadm
trueadm deleted the chore/codegen-size-ratio-rebaseline branch October 3, 2026 08:28
trueadm added a commit that referenced this pull request Oct 3, 2026
…nd re-judge them (#1646)

* ci(bench): triage the weekly ratio-guard breaches so new ones show

The weekly Bench job (`bench.mjs --quick --ratios`) was red with 81 ratio
breaches, 4 suites that wrote no numbers and 4 harness gate failures, so a new
breach was invisible. Every item is now a fix or a rebaseline.

- Harness drift, fixed. Each harness had stopped producing numbers when runtime
  source it anchors on changed:
  - ssr-final-replay: a second suspended loop since 2026-09-29.
  - root-transactions/contracts: staged-DOM text and attribute journaling since
    2026-09-15.
  - signal-dom-bindings: a second native style Block allocation site since
    2026-09-23.
  - codegen-size: the server runtime's lazy streamed-signals chunk since
    2026-09-16.
  - recursive-context: counted a pure-call annotation and trailing newlines as
    output growth.
- Rebaselined, with numbers in each note: five cross-framework bundle-size
  ratios and the workerd script-size ratio. The absolute app and server-render
  budgets are now the ratchet. Lynx's no-worklet byte caps from 2026-08-17 are
  reset to measured + 32, with the background program pinned exactly.
- Fix pending, with dated waivers that expire 2026-10-24, each with an owner
  task:
  - three exact counters the revived harnesses exposed (one extra closure per
    ssrTry, 128 live text reads per 128 unchanged compiled updates, compiled
    output at 1.295x its source);
  - Lynx create ratios and the re-entrant transport gate;
  - superlinear hydrate boundary preparation;
  - Octane Three versus R3F size and frame dispatch;
  - two timing regressions near the timer floor;
  - ten quick-mode timing guards whose samples are noise-bound;
  - the scoped descriptor shape change.
- bench.mjs supports a guard `waiver` ({ reason, expires }). A waived breach
  prints and does not fail, and fails again once the date passes.
  HARNESS_FAILURE_ALLOWLIST now also covers a suite whose harness writes no
  numbers.

The budget breaches (57) clear when the budget reset lands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): pair and lengthen the timing samples behind waived ratio guards

Twelve timing guards breached in weekly quick runs without a verdict. Their
samples sat near Chromium's 100 µs clock or under two-sample noise, and each
target ran its whole block minutes after the other side of its guard.

- benchmarks/lib/paired.mjs: rotating per-round visit order and a ~20 ms
  sample calibration shared by the harnesses below.
- js-framework-reorder, memo-wall, svg-dashboard, spa-navigation: every
  target's page stays open in one browser and each sample round visits all
  targets; short ops repeat until a sample takes about 20 ms (clicks,
  hook invocations, op batches, and summed navigation legs).
- activity caught-reveal: a sample reveals several independent hidden roots
  in one window, with the small case revealing eight times as many roots so
  both cases do equal work; the cases alternate per round.
- ssr-workerd: an untimed priming spawn per target, then paired cold-spawn
  rounds; quick mode runs six rounds instead of two.
- bench.yml: a `suites` dispatch input to run selected suites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): collect garbage before every timed spa-navigation leg

The untimed return leg mounts a whole route, and its collection landed
inside the next timed teardown: nav_teardown samples ran at 17-45% rme.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): re-judge the twelve waived timing guards with paired samples

Two quick CI runs of the paired, ~20 ms harness and same-runner A/B runs
against the commits that set each guard decided every waiver:

- Passing, waiver removed: activity reports, ssr-workerd
  cold_spawn_to_first_byte, svg-dashboard pan_zoom, memo-wall
  parent_rerender_equal_A and octane-jsx mount, spa-navigation
  nav_teardown and nav_mount (no Octane change since #674 on one runner).
- Rebaselined: svg-dashboard icon_swap 1.2 -> 1.6, because #983's esbuild
  minification made React 15% faster while Octane stayed flat.
- Confirmed Octane regressions, waiver kept and pointed at the fix:
  js-framework-reorder rotateb (1.41x per click since #639), memo-wall
  one_change_B (1.5x) and ctx_through_wall_B (1.44x), and svg-dashboard
  tooltip_swarm (1.31x since #635).
- The rotateb note claimed React moves every survivor; it moves one. A new
  rotatef guard covers the LIS-vs-lastPlacedIndex differentiator (0.043x).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): rebaseline spa-navigation nav_mount to its CI baseline

The 1.2 ceiling came from a local 0.94x reading. On CI runners #674 itself
measures 1.15x and head 1.09-1.16x, so the ceiling left 3% of quick-mode
headroom; 1.35 keeps a margin while still catching per-node mount growth.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): drop the three weekly waivers that now have fix PRs

The waived guards now have owner PRs: ssr-final-replay try_closures (#1644),
root-transactions equal_reads (#1643) and codegen-size gzip compiled/source
(#1645). #1645 rebaselines the same codegen-size entry, so this branch no
longer edits it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): leave lynx-render to its owner fix

The lynx-render transport gate failure and the create_1k/create_10k ratio
breaches both trace to #885's JSON-encoded transport and now have an owner
fix. Its branch re-notes those two guards, so this branch drops their waivers
and the suite's allowlist entry instead of editing the same entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): keep harness failures unwaivable and leave descriptor shapes to their owner

Waiving a suite that throws before it writes numbers would hide any crash in
that suite, not only the known shape change, and skip all of its guards. The
scoped-descriptor-shapes defect has an owner fix in progress. That fix re-pins
the harness's expected keys, so narrowing the waiver here would edit the same
assertion. HARNESS_FAILURE_ALLOWLIST is empty again, and a thrown suite failure
always fails the job. Dated waivers remain only on individual ratio guards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): leave the Three guards to their owner fixes

three-renderer frame_1k_subscribers and the two three-bundle-size ratios have
owner PRs (#1651, #1652) that re-note and ratchet those entries, so this branch
drops their waivers instead of editing the same entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): point the four kept timing waivers at their attributed fixes

rotateb and ctx_through_wall_B clear with #1655 and #1656; one_change_B's
per-row remainder and tooltip_swarm's scoped-descriptor accessor reads each
have their own fix task.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(benchmarks): point parent_rerender_equal_A's note at its per-commit journal fix

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
…1641)

* ci(bench): triage the weekly ratio-guard breaches so new ones show

The weekly Bench job (`bench.mjs --quick --ratios`) was red with 81 ratio
breaches, 4 suites that wrote no numbers and 4 harness gate failures, so a new
breach was invisible. Every item is now a fix or a rebaseline.

- Harness drift, fixed. Each harness had stopped producing numbers when runtime
  source it anchors on changed:
  - ssr-final-replay: a second suspended loop since 2026-09-29.
  - root-transactions/contracts: staged-DOM text and attribute journaling since
    2026-09-15.
  - signal-dom-bindings: a second native style Block allocation site since
    2026-09-23.
  - codegen-size: the server runtime's lazy streamed-signals chunk since
    2026-09-16.
  - recursive-context: counted a pure-call annotation and trailing newlines as
    output growth.
- Rebaselined, with numbers in each note: five cross-framework bundle-size
  ratios and the workerd script-size ratio. The absolute app and server-render
  budgets are now the ratchet. Lynx's no-worklet byte caps from 2026-08-17 are
  reset to measured + 32, with the background program pinned exactly.
- Fix pending, with dated waivers that expire 2026-10-24, each with an owner
  task:
  - three exact counters the revived harnesses exposed (one extra closure per
    ssrTry, 128 live text reads per 128 unchanged compiled updates, compiled
    output at 1.295x its source);
  - Lynx create ratios and the re-entrant transport gate;
  - superlinear hydrate boundary preparation;
  - Octane Three versus R3F size and frame dispatch;
  - two timing regressions near the timer floor;
  - ten quick-mode timing guards whose samples are noise-bound;
  - the scoped descriptor shape change.
- bench.mjs supports a guard `waiver` ({ reason, expires }). A waived breach
  prints and does not fail, and fails again once the date passes.
  HARNESS_FAILURE_ALLOWLIST now also covers a suite whose harness writes no
  numbers.

The budget breaches (57) clear when the budget reset lands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): drop the three weekly waivers that now have fix PRs

The waived guards now have owner PRs: ssr-final-replay try_closures (#1644),
root-transactions equal_reads (#1643) and codegen-size gzip compiled/source
(#1645). #1645 rebaselines the same codegen-size entry, so this branch no
longer edits it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): leave lynx-render to its owner fix

The lynx-render transport gate failure and the create_1k/create_10k ratio
breaches both trace to #885's JSON-encoded transport and now have an owner
fix. Its branch re-notes those two guards, so this branch drops their waivers
and the suite's allowlist entry instead of editing the same entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): keep harness failures unwaivable and leave descriptor shapes to their owner

Waiving a suite that throws before it writes numbers would hide any crash in
that suite, not only the known shape change, and skip all of its guards. The
scoped-descriptor-shapes defect has an owner fix in progress. That fix re-pins
the harness's expected keys, so narrowing the waiver here would edit the same
assertion. HARNESS_FAILURE_ALLOWLIST is empty again, and a thrown suite failure
always fails the job. Dated waivers remain only on individual ratio guards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): leave the Three guards to their owner fixes

three-renderer frame_1k_subscribers and the two three-bundle-size ratios have
owner PRs (#1651, #1652) that re-note and ratchet those entries, so this branch
drops their waivers instead of editing the same entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent chore PR: tooling, dependencies, repo maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant