Skip to content

ci(bench): raise byte budgets for the nested-block signal owner fix - #1760

Closed
trueadm wants to merge 6 commits into
mainfrom
ci/nested-block-signal-owner-budget
Closed

trueadm wants to merge 6 commits into
mainfrom
ci/nested-block-signal-owner-budget

Conversation

@trueadm

@trueadm trueadm commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR only raises byte budgets: 75 values across minimal-budgets.json, app-budgets.json and jsx-budgets.json. They make room for #1761, the nested-block signal owner fix. That fix makes a component's signal$/derived$/query$ handles resolve to the component's own cells when a nested @{ … } block reads them.

Merge this PR first, then merge main into #1761. CONTRIBUTING "Size budgets" keeps a raise out of the change that needs it, and budget-raises.mjs enforces that.

Why

Why the bytes are worth it. On main, a nested block that reads its component's query starts a second request, in the browser and on the server, and it computes from a second copy of the component's signals. For example:

export function App({ load }) @{
	const count$ = signal$(1);
	const source$ = query$(() => 'source', load);
	const label$ = derived$(() => count$.get() + source$.get());
	<section>
		<button onClick={() => count$.set(count$.get() + 1)}>…</button>
		@{
			const [tick, setTick] = useState(0);
			<output>{label$.get()}</output>
		}
	</section>
}

On main, load runs twice, and after a click the block still shows 1value while the component's count is 2. Hydration also refetches instead of resuming the server's result. docs/signals.md already promises this for directive arms and keyed rows. The fix applies the same rule to nested blocks.

Why it cannot be smaller.

  • Placement: owner identity is decided in scopeSignalOwner when an owner is first created. renderBlock calls that function for every block once a document signal owner exists, so it sits in the core graph. The block is marked where childSlot stamps signal identity, inside its existing SIGNAL_BINDINGS_ENABLED || signalDocumentEnabled branch.
  • Why it isn't gated on enableSignalBindings: gating these links on that call would miss instance declarations from plain hook modules, which enable signals through octane/signals instead.
  • What remains (client, about 160 minified bytes):
    • a 't:' invocation site for render functions rendered as children;
    • one condition that links a nested block's owner to the scope that rendered it;
    • one condition that links a fragment renderer's owner to its parent, checked first, so that a renderer inside a nested block links to that block (a Bugbot finding on fix(octane): resolve a component's signal handles from its nested @{ … } blocks #1761, +14 raw);
    • resolving a hookless component's scope from its DOM stand-in, so a renderer it renders, and an arm inside it, links to it (a second Bugbot finding, +75 raw). The stand-in records the parent the component is registered on, so this is a cold scan of that parent's children at owner creation, with no per-mount state.
  • What remains (server, +159 raw): the same site on the two bare-function render paths, and an enclosing owner passed into serverSignalOwner.
  • Each piece is tested: removing any one of them fails a case in fix(octane): resolve a component's signal handles from its nested @{ … } blocks #1761's regression tests in hydration/signal-declaration-owner.test.ts.
  • Already trimmed: an earlier version took the structural parent plus a lightweight-component fallback, at +99 raw per client bundle. It now uses the recorded parent scope.
  • Headroom: main has 32 bytes of raw and gzip headroom, and no correct version fits in it.

Changes

Measured with node benchmarks/bundle-size/run-minimal.mjs and node benchmarks/bundle-size/run.mjs octane-tsrx octane-jsx on main e233e4a (after #1762 lowered budgets), with and without #1761 (head 17fa234, which includes that main). The new values come from --write-budgets with the fix applied: measured + 32 raw/gzip, or + 256 brotli. Only raised values are kept; no budget is lowered. This branch merges main e233e4a, so every raise builds on #1762's lowered values. #1762 does not move this code out of signal-free bundles.

Scenario Raw Gzip
Client scenarios (cli-spa-starter, root-*, hooks-state, context, hydrate-root, …) +158 to +162 +48 to +68
Larger client bundles (root-static, binding-base-ui-*, binding-radix-*, binding-apollo-client-*) +176 to +180 +42 to +87
server-render +159 +72
Apps, framework chunk (rows, todo, chat, weather, bindings) budget +166 to +167 (bindings +185) budget +64 to +83
JSX app, framework chunk budget +185 budget +71

Brotli moves by at most +163 bytes (binding-base-ui-esbuild), inside its 256-byte margin except where main's brotli headroom was already smaller. Only those breached brotli values are raised.

One value comes from CI rather than a local run. The bindings app's total brotli measures 204,213 bytes on the CI runner but fits locally, because brotli output differs slightly between environments (raw and gzip match exactly). It is set to CI's measurement + 256 = 204,469.

Validation

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
Touches only benchmark budget JSON used by CI; no application or framework runtime behavior changes in this PR.

Overview
Raises bundle-size CI budgets only so the nested-block signal owner fix (octane#1761) can merge without failing size checks. This PR does not change runtime code.

75 budget values go up across minimal-budgets.json, app-budgets.json, and jsx-budgets.json, using measured sizes from the fix branch plus the repo’s raw/gzip (+32) and brotli (+256) margins. Client scenarios gain roughly +158–180 raw / +42–87 gzip; server-render gains +159 raw / +72 gzip; app and JSX framework chunks move by similar amounts (bindings brotli uses a CI-measured value where local brotli differed). Only limits are raised; none are lowered.

Merge this before #1761 so budget-raises.mjs keeps the byte increase in a dedicated budget PR per CONTRIBUTING.

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

Make room for resolving a component's signal handles from its nested
`@{ … }` blocks: about 70 minified bytes in client owner creation and 159 on
the server render path. Only raised values; no budget is lowered.

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

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
octane-website Skipped Skipped Oct 5, 2026 6:33pm UTC
octane-website-mcp Skipped Skipped Oct 5, 2026 6:33pm UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp October 5, 2026 11:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website October 5, 2026 11:58 Inactive
@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 5, 2026
@trueadm
trueadm marked this pull request as ready for review October 5, 2026 11:59
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No budget breaches, no added work, and no timing changes beyond ±3%.

Compares e233e4a11, the merge commit's first parent with 4b6be40e3 on the same runner. A byte value over its committed budget or any increase in a js-framework work counter fails this check. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 3.558 3.492 +2.3% −8.8% … +4.7% ⚪ within noise
octane-tsrx replace 8.808 9.342 +2.5% −10.1% … +7.9% ⚪ within noise
octane-tsrx add 3.175 3.267 +1.5% −4.8% … +7.1% ⚪ within noise
octane-tsrx update 0.159 0.163 +4.5% −4.9% … +14.7% ⚪ within noise
octane-tsrx select 0.007 0.007 −0.4% −7.4% … +2.0% ⚪ within noise
octane-tsrx swap 0.052 0.053 −2.4% −19.3% … +18.0% ⚪ within noise
octane-tsrx remove 0.030 0.030 +4.7% −2.7% … +9.4% ⚪ within noise
octane-tsrx runlots 33.067 32.225 −2.7% −11.6% … +2.3% ⚪ within noise
octane-tsrx select_lots 0.007 0.007 +0.5% −1.1% … +2.1% ⚪ within noise
octane-tsrx clear 59.500 59.875 +1.9% −0.2% … +4.6% ⚪ within noise
octane-jsx run 4.808 4.708 +6.7% −0.4% … +29.5% ⚪ within noise
octane-jsx replace 10.408 10.842 +1.9% −7.3% … +10.7% ⚪ within noise
octane-jsx add 4.942 4.517 −5.9% −13.1% … +5.5% ⚪ within noise
octane-jsx update 0.333 0.318 −1.3% −5.2% … +3.7% ⚪ within noise
octane-jsx select 0.151 0.152 −1.4% −5.7% … +5.2% ⚪ within noise
octane-jsx swap 0.291 0.286 +0.7% −13.5% … +10.8% ⚪ within noise
octane-jsx remove 0.235 0.216 −0.3% −4.1% … +5.0% ⚪ within noise
octane-jsx runlots 34.283 34.842 +0.1% −4.0% … +2.5% ⚪ within noise
octane-jsx select_lots 1.663 1.628 +0.6% −1.3% … +2.4% ⚪ within noise
octane-jsx clear 57.925 65.692 +7.8% −0.0% … +10.6% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx bindings_js_gzip 239,481 239,468 −13 (−0.0%) 🟢
octane-tsrx bindings_js_brotli 204,088 203,984 −104 (−0.1%) 🟢
octane-tsrx bindings_app_gzip 121,381 121,368 −13 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 101,572 101,468 −104 (−0.1%) 🟢

56 other measured values are unchanged.

Public-import reachability bundles (bytes)

No changes across 105 measured values.

…l-owner-budget

# Conflicts:
#	benchmarks/bundle-size/minimal-budgets.json
#1761 now resolves a hookless component's scope from its DOM stand-in, so a
renderer the component renders links to it: 75 more raw bytes in client
owner creation. Only raised values; no budget is lowered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm and others added 2 commits October 5, 2026 19:12
…l-owner-budget

# Conflicts:
#	benchmarks/bundle-size/app-budgets.json
#	benchmarks/bundle-size/minimal-budgets.json
…rement

The CI runner measures #1761's bindings app at 204,213 total brotli bytes,
6 over the committed budget. The local measurement fits, because brotli
output differs slightly between environments; raw and gzip match exactly.
Set it to CI's measurement + 256.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp October 5, 2026 18:26 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website October 5, 2026 18:26 Inactive
trueadm added a commit that referenced this pull request Oct 5, 2026
* ci(bench): raise byte budgets for the nested-block signal owner fix

Make room for resolving a component's signal handles from its nested
`@{ … }` blocks: about 70 minified bytes in client owner creation and 159 on
the server render path. Only raised values; no budget is lowered.

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

* ci(bench): raise byte budgets for the children signal owner fix

Compiled children now record the owner of the template that authored them,
and scopeSignalOwner links their owner, or a context provider's, to it. That
adds about 112-151 raw bytes to every client bundle and 171 to server-render.
Values are measured on the fix branch plus 32 raw/gzip and 256 brotli, and
only raise #1760's values.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…l-owner-budget

# Conflicts:
#	benchmarks/bundle-size/app-budgets.json
#	benchmarks/bundle-size/jsx-budgets.json
#	benchmarks/bundle-size/minimal-budgets.json
@vercel
vercel Bot temporarily deployed to Preview – octane-website October 5, 2026 18:33 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp October 5, 2026 18:33 Inactive
@trueadm

trueadm commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: this diff is empty. Its budget raises landed in #1773, which covers #1761 and #1774.

@trueadm trueadm closed this Oct 5, 2026
trueadm added a commit that referenced this pull request Oct 5, 2026
#1761 (#1793)

#1782 measured the #1764 fix on its own, and #1760 measured #1761 on its
own. With #1761 now on main, adding the fix overruns 47 budgets by up to
about 135 raw bytes. Each value is measured on main 9c84293 with the fix
applied, plus the standard headroom.

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

2 inactive deployments
Preview – octane-website-mcp — f20aba21 Deployed Oct 5, 2026 by vercel[bot]
Preview – octane-website — f20aba21 Deployed Oct 5, 2026 by vercel[bot]
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