Skip to content

ci(bundle-size): raise budgets for in-place Block signal owners - #1858

Merged
trueadm merged 2 commits into
mainfrom
ci/hydration-block-entry-budget
Oct 7, 2026
Merged

trueadm merged 2 commits into
mainfrom
ci/hydration-block-entry-budget

Conversation

@trueadm

@trueadm trueadm commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Budget-only raise for #1857, which makes each Block render in its signal owner without re-entering renderBlock. Per CONTRIBUTING.md ("Size budgets"), the raise lands on its own. This PR changes only the three budget files; every value is max(main, measured on #1857 + 32) (brotli is unchanged), so nothing is lowered.

65 budgets rise against main 188d60b, which includes #1854 and #1855. The pattern:

bundles raw gzip
signal-free apps (rows, todo, chat, weather) and most minimal roots +151 to +168 +37 to +58, or within headroom
bundles that can reach the signal capability (bindings, rows-jsx, root-static, hydrate-frame, Base UI, Radix and Apollo bindings) +255 to +312 +70 to +115
hydrate-root +156 +82

Where the bytes go, measured on rows:

  • The in-place owner frame in renderBlock: about +61 raw and +37 gzip. It ships in every app because renderBlock is reachable everywhere. The enter/restore pair itself is installed by enableSignalDocument, so only bundles that can reach the signal capability pay for those two functions and the frame object (the extra ~+100 raw / ~+60 gzip in the second row).
  • The owner kept in a Scope.signalOwner field instead of a WeakMap: +94 raw and 0 gzip. Property names do not minify, so 17 scope.signalOwner sites are longer than map.get(scope). Dropping this part from perf(runtime): enter each Block's signal owner in place during render #1857 would remove most of the signal-free raw raise, but none of the gzip.

Why the growth is worth it

The change is measured on the new app-frame-hydration benchmark. It hydrates about 1,650 Blocks with signals and native reads enabled, shaped after a production app-frame hydration audit. Samples are interleaved with origin/main 188d60b in the same Chromium, 50 pairs, 4× CPU throttle:

scenario cold hydration, head/base [95% CI] warm hydration, head/base [95% CI]
frame (leaf signal reads) 0.982 [0.969–0.996] 0.961 [0.951–0.975]
frame-live-sections (section-level reads) 0.965 [0.962–0.978] 0.971 [0.966–0.979]

In signal-enabled apps, renderBlock entries per render drop from 2 to 1, and runWithSignalOwner calls drop from 1,798 to 95 per frame hydration. Bundles that never enable signals gain no speed, and pay about +155 raw / +37 gzip.

Gating the whole owner path out of signal-free apps would remove that cost, but needs the larger "signal flag modules" reachability work from #1801.

Validation

  • node benchmarks/bundle-size/run.mjs --write-budgets and node benchmarks/bundle-size/run-minimal.mjs --write-budgets on perf(runtime): enter each Block's signal owner in place during render #1857 merged with origin/main 188d60b, merged raise-only against that main; node benchmarks/bundle-size/budget-raises.mjs --base origin/main reports 65 raises in a budget-only change
  • pnpm format:check (JSON only; formatting unchanged)
  • pnpm typecheck (no source change)
  • pnpm test (left to CI)

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
JSON-only CI threshold updates with no application code; temporary window where bundle checks use higher ceilings until #1857 merges.

Overview
Raises bundle-size CI budgets only (no runtime or framework source changes) so the follow-up in-place Block signal-owner work (#1857) can land without failing the size ratchet.

Updates 58 entries across app-budgets.json, jsx-budgets.json, and minimal-budgets.json: raw and gzip ceilings go up by roughly +150–+260 raw and +37–+110 gzip depending on whether the bundle can reach signal capability; brotli values are unchanged. Each new limit is max(main, measured on #1857 + 32) so nothing is lowered.

Intended to merge before #1857; until that lands, other PRs compare against these higher floors.

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

Raise-only budgets for #1857, measured on its head and merged as
max(main, measured + 32). Signal-free apps grow about +155 raw / +37 gzip
and bundles that can reach the signal capability about +256 raw / +70-111
gzip, for 1.7% faster cold and 3.8% faster warm hydration of a ~1,940-Block
signal-enabled app frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent ci PR: CI or build pipeline labels Oct 7, 2026
@trueadm
trueadm marked this pull request as ready for review October 7, 2026 19:52
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website-mcp e000a69 Commit Preview URL

Branch Preview URL
Oct 07 2026, 07:58 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website e000a69 Commit Preview URL

Branch Preview URL
Oct 07 2026, 07:57 PM

…ration-block-entry-budget

# Conflicts:
#	benchmarks/bundle-size/app-budgets.json
#	benchmarks/bundle-size/minimal-budgets.json
@trueadm
trueadm merged commit d8906f8 into main Oct 7, 2026
15 of 26 checks passed
@trueadm
trueadm deleted the ci/hydration-block-entry-budget branch October 7, 2026 20:12
trueadm added a commit that referenced this pull request Oct 7, 2026
Conflicts: app-budgets.json and minimal-budgets.json. #1858 raised
budgets ahead of #1857 (in-place Block signal owners, still open), so
take its values in every conflicting row; lowering them here would undo
a raise #1857 depends on. That includes hydrate-frame (365,194 raw),
which clears the over-budget failure main had. This branch keeps its
lower bindings app gzip and one app brotli, rows #1858 left alone.

Until #1857 lands, the tight-budget check measures well under the raised
rows, so shard 1's "Verify every bundle budget" step is expected to fail
here, as on any PR in that window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 7, 2026
#1858 raised 65 budgets ahead of #1857 (in-place Block signal owners), which
is still open: it is behind main, fails format:check under #1399's formatter,
and its own ratchet is off by 2 gzip bytes. Until it lands, every push to main
enforces the downward ratchet against those unfilled raises, so main
21f911d (#1399) failed test shard 1/4 at "Verify every bundle budget":
cli-spa-starter raw budget 101,976 must ratchet to 101,825.

Rewrite every budget with run-minimal.mjs and run.mjs --write-budgets on main
21f911d (measured + 32 raw/gzip, + 256 brotli): 65 lowerings, no raises,
the same 65 entries #1858 raised. #1857 re-lands its raise in a budget-only
change immediately before it merges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 7, 2026
…eads (#1863)

Budget-only raise for #1862. That change lets hydration skip
rendering a native signal reader again when its live value is unchanged.
hydrate-frame, the only minimal scenario that hydrates with native signal reads,
grows by +1,146 raw, +488 gzip and +249 brotli. Each value is the current budget
plus that delta, so the raise from #1858 for #1857 is kept.

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 7, 2026
#1857 (b6c040c) merged without the budget-only raise that 96c4096 took
back while it was pending, so main is over its committed byte budgets again.
This restores that raise as measured on main b6c040c with
run-minimal.mjs and run.mjs --write-budgets (measured + 32 raw/gzip, + 256
brotli): 61 raises and 4 brotli lowerings, budget files only.

- cli-spa-starter raw 101,825 -> 101,976 (+151), the same value #1858 set
- signal-free roots and apps about +151 to +168 raw, +37 to +58 gzip
- signal-capable bundles (root-static, bindings, Base UI, Radix, Apollo)
  about +255 to +312 raw, +70 to +115 gzip
- brotli lowered 2 to 34 bytes on four rows the owner frame shrank

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 ci PR: CI or build pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant