Skip to content

perf(runtime): enter each Block's signal owner in place during render - #1857

Merged
trueadm merged 10 commits into
mainfrom
perf/hydration-block-entry
Oct 7, 2026
Merged

trueadm merged 10 commits into
mainfrom
perf/hydration-block-entry

Conversation

@trueadm

@trueadm trueadm commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A production app-frame hydration audit found frame hydration was the page's only long task. The audit counted 1,930 renderBlockInner calls and 3,839 renderBlock calls. With signals enabled, every Block gets its own owner from scopeSignalOwner, so renderBlock nearly always re-entered itself through runWithSignalOwner(owner, () => renderBlock(block)). Each re-entry allocated a closure and resolved the same owner again.

This PR adds a benchmark that reproduces that shape and removes the double entry.

  • benchmarks/app-frame-hydration (new suite, registered in bench.mjs):
    • Every module of the frame imports octane/signals, so it compiles with native reads and runtime style bindings, under the document signal owner.
    • It is SSR'd in Node and hydrated in headless Chromium on a fresh browser context per sample, at 4× CPU throttle. Warm samples repeat in one page.
    • A jitless browser counts deterministic calls and heap bytes.
    • --base=<checkout> interleaves another checkout per round and reports the paired ratio with a bootstrap 95% CI.
    • Every sample checks that all server elements are adopted, no recoverable error occurs, a delegated click reaches a native-read arm, and unmount is clean.
    • On 7e6bda5 the default frame created 1,938 Blocks: 1,146 component, 717 control-flow (about 272 of them style={undefined} bindings) and 74 @for rows. That ran 1,997 renderBlockInner and 3,994 renderBlock calls, against the audit's 1,930 and 3,839.
    • Since perf(octane): write unset and string native styles without a Block #1854, unset styles write without a Block, so on current main the frame hydrates 1,653 Blocks: 1,146 component, 432 @if arms and 74 rows. That is 1,703 renderBlockInner and 3,406 renderBlock calls.
  • renderBlock enters the Block's owner in place, using the synchronous owner swap the server renderer already uses. It restores the caller's owner in its existing finally, so a return, throw or suspension all restore it.
    • The enter/restore pair is published by enableSignalDocument as signalOwnerFrame, so apps that never enable signals do not retain it.
    • A host carrier from installSignalOwnerEnvironment keeps the callback frame, as does a root given signalOwner without the signal document.
    • A Block that hydration rebuilds on the client enters its owner inside the nested build, as before.
  • A scope's resolved owner moves from the SCOPE_SIGNAL_OWNERS WeakMap to a pre-declared Scope.signalOwner field (BlockImpl and ScopeImpl), so each lookup is a field read.

Results

The app-frame-hydration run interleaves head and origin/main 188d60b (with #1854 and #1855) round by round in the same Chromium, over 50 pairs at 4× throttle. Server HTML is byte-identical between the two.

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]

Deterministic counters for one cold frame hydration, measured in jitless Chromium:

counter base head
renderBlock entries 3,406 1,703 (1 per render)
scopeSignalOwner calls 4,007 2,304
runWithSignalOwner calls 1,798 95
production calls 299,831 287,910 (−4.0%)
JS heap allocated by hydration 4,179,024 B 4,017,888 B (−161 KB)

Before #1854/#1855 landed, two 30-pair runs against 7e6bda5 measured frame cold 0.975 and 0.983, and warm 0.963 and 0.962.

Reproduce with node benchmarks/app-frame-hydration/run.mjs 50 --base=<checkout of origin/main>.

Size

This PR changes no budget file. Its bytes are re-landed by the budget-only #1865, which must merge immediately before this PR. #1858 first raised them, and main ratcheted them back in 96c4096 while this PR was open. #1865 carries the full measured set for this branch merged with main 96c4096: 61 raises and 5 brotli lowerings, so the budget step here then passes exactly. Signal-free apps grow by about +155–168 raw / +37–58 gzip (rows framework: +155 / +37). Bundles that can reach the signal capability grow by about +255–312 raw / +70–115 gzip.

I shrank the first cut (+334 raw / +64 gzip on rows) three ways:

  • Moved the rebuild decision before owner entry, so the owner restores in the existing finally with no extra try.
  • Gated the in-place frame behind enableSignalDocument.
  • Dropped an in-place entry for lightweight component slots, which measured as noise.

The field change is +94 raw and 0 gzip of the signal-free raise. Removing the rest from signal-free apps needs the #1801 "signal flag modules" reachability work.

Candidates evaluated and not taken

  • Hoisting the rarely-true work in renderBlockInner behind flags: urgent-transition driver, warm-episode bookkeeping, $$ctxReads/$$ctxDirect clears, and the NATIVE_BLOCK_RETRIES lookup.
    • In the cold line profile each is at most 1–3% of renderBlockInner self time, which is under 0.1 ms of a ~105 ms profiled hydration.
    • About 77% of renderBlockInner cold self time lands on the block.body(...) call line itself.
    • That drops from 306 to 33 samples when warm, and it survives --no-lazy, --no-lazy-feedback-allocation, --no-sparkplug and --no-maglev.
    • It is first-execution cost of cold component bodies, not wrapper logic.
  • Block hidden classes. BlockImpl pre-declares its expandos, so its shape is stable.
    • --trace-deopt over one cold hydration shows Maglev optimizing renderBlockInner mid-hydration, then deoptimizing once ("wrong map").
    • Field-type and constness generalizations of BlockImpl fields invalidate dependent code once per field (createBlock, ifBlock, journalRootSlot, scopeSignalOwner). That is one-time warmup, 16 deopts per cold hydration.
  • Skipping JOURNAL_RENDER for fresh Blocks. Rejected: hydration keeps every journal entry by design (ROOT_DISCARD_STAMP is −1 while hydrating), because rollback keeps adopted hosts.

Validation

  • packages/octane/tests/signal-render-owner-frame.test.tsrx, new, in the octane and octane-prod projects (6/6 each). It covers:
    • per-Block owners;
    • restoring the caller's owner after a render, a caught throw, a suspension and retry, and a held transition;
    • Suspense retry replaying in the first attempt's owner;
    • a lightweight component scope;
    • entry through an installed host carrier.
    • It passes on origin/main's runtime too. I confirmed it fails when the restore is removed (5/6), when owners are not entered (6/6), when the carrier is bypassed (1/6), and when the owner is not cached (4/6).
  • Related owner suites in octane: event-signal-owner, event-signal-owner-retirement, stable-event-authority, hydration/signal-instance-identity, hydration/signal-declaration-owner, hydration/document-signal-owner and hydration/direct-signal-bindings (757/757).
  • pnpm typecheck:files for the changed sources and test; octane-tsc -p benchmarks/app-frame-hydration/tsconfig.json.
  • pnpm format:files:check for the changed files; pnpm sync leaves the tree clean.
  • With ci(bundle-size): re-land budgets for in-place Block signal owners #1865's budget files applied and BUDGET_BASE set to main, both of CI's budget commands pass (run-minimal.mjs --budgets --ratchet and run.mjs --budgets --ratchet octane-tsrx octane-jsx). The budgets are this branch's own --write-budgets output. pnpm format:check passes repo-wide under fix: update the TSRX toolchain to @tsrx/core 0.5 and the new formatter #1399's formatter.
  • Full pnpm test / pnpm typecheck / pnpm format:check: left to CI per the local-load rule.

Risk / follow-ups

  • Adoption-release re-render cascade. After a hydration commit, releaseNativeAdoptions notifies every Block that read a signal while hydrating, even when the live value equals the server value. Those Blocks re-render in the same task, which is deliberate today. With section-level reads (frame-live-sections) that takes 1,703 renders to 3,078 for the same 1,653 Blocks, about +8 ms cold at 4×. Skipping the notify when nothing changed would remove it. That belongs to the native-read adoption code, as a separate PR.
  • structuralSignalInstanceKey always allocates a visited Set and a token array, even when the parent key is already resolved. That is about 100 KB per hydration and an easy follow-up.

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

Medium Risk
Changes core render and signal-owner threading for every signal-enabled Block; behavior is heavily tested but touches hydration, Suspense retry, and owner retirement paths.

Overview
Signal-enabled rendering no longer re-enters renderBlock through runWithSignalOwner on almost every Block. renderBlock now swaps into each Block's signal owner in place via signalOwnerFrame (wired when enableSignalDocument runs), and restores the caller's owner in finally on return, throw, or suspend. Host carriers from installSignalOwnerEnvironment and roots without the signal document still use the callback path.

Resolved per-scope owners move from SCOPE_SIGNAL_OWNERS to a scope.signalOwner field on Scope / BlockImpl, so lookups are plain field reads.

A new app-frame-hydration headless-Chromium benchmark (~1,650 Blocks, signals on every module) SSR-renders an app-frame-shaped fixture, measures cold/warm hydration at 4× CPU throttle, and optionally pairs against another checkout. It is registered in bench.mjs, the benchmarks README, and the MCP server list. signal-render-owner-frame.test.tsrx locks owner enter/restore behavior across nested Blocks, errors, Suspense, and host carriers.

Reported impact on that benchmark: one renderBlock entry per render (was ~2), fewer production calls and ~161 KB less hydration allocation, with modest cold/warm speedups vs the prior runtime.

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

trueadm and others added 2 commits October 7, 2026 20:43
Production SSR and cold Chromium hydration of a ~1,940-Block
signal-enabled app frame, shaped after a production app-frame hydration
audit: small wrapper components, @if arms, @for rows, and forwarded
style props, compiled with native reads and the document signal owner.
Fresh browser contexts at 4x CPU throttle, warm repeats, jitless call and
heap counters, and an optional paired --base=<checkout> comparison.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
renderBlock entered a Block's signal owner through a callback frame that
re-entered renderBlock, resolving the same owner twice and allocating a
closure per render. Enter it in place with the synchronous owner swap the
server already uses, installed with the signal document so signal-free
apps do not retain it, and restore it when the render returns, throws,
or suspends. Host carriers keep the callback frame. Scopes keep their
resolved owner in a field instead of a WeakMap.

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 perf PR: performance work 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 8cde271 Commit Preview URL

Branch Preview URL
Oct 07 2026, 07:54 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 8cde271 Commit Preview URL

Branch Preview URL
Oct 07 2026, 07:53 PM

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 41 value(s) increased within budget
  • 🔴 bundle-reachability: 71 value(s) increased within budget

Compares 21f911d51, the merge commit's first parent (main has moved 1 commit(s) past the pull request's recorded base d8906f887) with f641f3919 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 4.533 6.175 +3.0% −3.9% … +17.1% ⚪ within noise
octane-tsrx replace 10.033 10.558 −0.8% −13.5% … +9.7% ⚪ within noise
octane-tsrx add 6.275 4.783 −2.6% −27.0% … +6.0% ⚪ within noise
octane-tsrx update 0.153 0.158 +1.7% −11.6% … +25.6% ⚪ within noise
octane-tsrx select 0.012 0.011 +2.1% −3.9% … +19.9% ⚪ within noise
octane-tsrx swap 0.057 0.056 +0.7% −5.6% … +13.3% ⚪ within noise
octane-tsrx remove 0.030 0.030 −4.5% −7.1% … +11.0% ⚪ within noise
octane-tsrx runlots 41.042 42.450 −1.9% −6.2% … +1.8% ⚪ within noise
octane-tsrx select_lots 0.011 0.008 +4.3% −3.6% … +7.8% ⚪ within noise
octane-tsrx clear 49.033 51.008 +0.7% −2.3% … +5.1% ⚪ within noise
octane-jsx run 5.367 5.792 −0.8% −6.4% … +2.4% ⚪ within noise
octane-jsx replace 10.542 11.175 +4.9% +0.6% … +14.1% ⚪ within noise
octane-jsx add 5.408 5.075 +1.1% −4.6% … +5.6% ⚪ within noise
octane-jsx update 0.309 0.326 −0.4% −6.7% … +3.2% ⚪ within noise
octane-jsx select 0.172 0.171 −3.2% −5.9% … +0.8% ⚪ within noise
octane-jsx swap 0.336 0.340 +0.2% −3.2% … +4.3% ⚪ within noise
octane-jsx remove 0.292 0.274 +2.1% −19.8% … +8.5% ⚪ within noise
octane-jsx runlots 48.667 40.292 −1.4% −11.2% … +2.1% ⚪ within noise
octane-jsx select_lots 2.136 2.594 +1.6% −4.0% … +9.5% ⚪ within noise
octane-jsx clear 45.833 47.317 +3.4% −0.2% … +4.9% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 112,740 112,895 +155 (+0.1%) 🔴
octane-tsrx js_gzip 36,731 36,769 +38 (+0.1%) 🔴
octane-tsrx js_brotli 32,492 32,544 +52 (+0.2%) 🔴
octane-tsrx app_gzip 2,335 2,336 +1 (+0.0%) 🔴
octane-tsrx app_brotli 2,040 2,034 −6 (−0.3%) 🟢
octane-tsrx fw_raw 105,794 105,949 +155 (+0.1%) 🔴
octane-tsrx fw_gzip 34,396 34,433 +37 (+0.1%) 🔴
octane-tsrx fw_brotli 30,452 30,510 +58 (+0.2%) 🔴
octane-tsrx todo_js_raw 121,147 121,303 +156 (+0.1%) 🔴
octane-tsrx todo_js_gzip 39,532 39,557 +25 (+0.1%) 🔴
octane-tsrx todo_js_brotli 34,788 34,779 −9 (−0.0%) 🟢
octane-tsrx todo_app_brotli 1,892 1,886 −6 (−0.3%) 🟢
octane-tsrx todo_fw_raw 116,529 116,685 +156 (+0.1%) 🔴
octane-tsrx todo_fw_gzip 37,312 37,337 +25 (+0.1%) 🔴
octane-tsrx todo_fw_brotli 32,896 32,893 −3 (−0.0%) 🟢
octane-tsrx chat_js_raw 119,896 120,052 +156 (+0.1%) 🔴
octane-tsrx chat_js_gzip 39,372 39,401 +29 (+0.1%) 🔴
octane-tsrx chat_js_brotli 34,710 34,765 +55 (+0.2%) 🔴
octane-tsrx chat_app_gzip 2,716 2,714 −2 (−0.1%) 🟢
octane-tsrx chat_app_brotli 2,384 2,388 +4 (+0.2%) 🔴
octane-tsrx chat_fw_raw 114,131 114,287 +156 (+0.1%) 🔴
octane-tsrx chat_fw_gzip 36,656 36,687 +31 (+0.1%) 🔴
octane-tsrx chat_fw_brotli 32,326 32,377 +51 (+0.2%) 🔴
octane-tsrx weather_js_raw 156,452 156,607 +155 (+0.1%) 🔴
octane-tsrx weather_js_gzip 50,749 50,769 +20 (+0.0%) 🔴
octane-tsrx weather_js_brotli 44,210 44,305 +95 (+0.2%) 🔴
octane-tsrx weather_app_gzip 7,872 7,871 −1 (−0.0%) 🟢
octane-tsrx weather_app_brotli 6,647 6,671 +24 (+0.4%) 🔴
octane-tsrx weather_fw_raw 134,298 134,453 +155 (+0.1%) 🔴
octane-tsrx weather_fw_gzip 42,877 42,898 +21 (+0.0%) 🔴
octane-tsrx weather_fw_brotli 37,563 37,634 +71 (+0.2%) 🔴
octane-tsrx bindings_js_raw 686,090 686,350 +260 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 224,083 224,189 +106 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 190,568 190,565 −3 (−0.0%) 🟢
octane-tsrx bindings_app_gzip 115,665 115,667 +2 (+0.0%) 🔴
octane-tsrx bindings_app_brotli 96,259 96,236 −23 (−0.0%) 🟢
octane-tsrx bindings_fw_raw 338,452 338,712 +260 (+0.1%) 🔴
octane-tsrx bindings_fw_gzip 108,418 108,522 +104 (+0.1%) 🔴
octane-tsrx bindings_fw_brotli 94,309 94,329 +20 (+0.0%) 🔴
octane-tsrx full_fw_raw 564,583 564,859 +276 (+0.0%) 🔴
octane-tsrx full_fw_gzip 169,804 169,855 +51 (+0.0%) 🔴
octane-tsrx full_fw_brotli 142,981 142,961 −20 (−0.0%) 🟢
octane-jsx js_raw 187,238 187,494 +256 (+0.1%) 🔴
octane-jsx js_gzip 59,295 59,400 +105 (+0.2%) 🔴
octane-jsx js_brotli 51,652 51,679 +27 (+0.1%) 🔴
octane-jsx app_brotli 2,414 2,404 −10 (−0.4%) 🟢
octane-jsx fw_raw 178,973 179,229 +256 (+0.1%) 🔴
octane-jsx fw_gzip 56,438 56,543 +105 (+0.2%) 🔴
octane-jsx fw_brotli 49,238 49,275 +37 (+0.1%) 🔴
octane-jsx full_fw_raw 564,583 564,859 +276 (+0.0%) 🔴
octane-jsx full_fw_gzip 169,804 169,855 +51 (+0.0%) 🔴
octane-jsx full_fw_brotli 142,981 142,961 −20 (−0.0%) 🟢

8 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 101,793 101,944 +151 (+0.1%) 🔴
cli-spa-starter gzip 33,851 33,866 +15 (+0.0%) 🔴
cli-spa-starter brotli 29,732 29,761 +29 (+0.1%) 🔴
root-static-specialized raw 72,303 72,459 +156 (+0.2%) 🔴
root-static-specialized gzip 23,669 23,722 +53 (+0.2%) 🔴
root-static-specialized brotli 21,152 21,181 +29 (+0.1%) 🔴
root-chained-jsx raw 74,181 74,337 +156 (+0.2%) 🔴
root-chained-jsx gzip 24,192 24,216 +24 (+0.1%) 🔴
root-chained-jsx brotli 21,653 21,630 −23 (−0.1%) 🟢
root-static raw 165,054 165,310 +256 (+0.2%) 🔴
root-static gzip 52,090 52,176 +86 (+0.2%) 🔴
root-static brotli 45,323 45,436 +113 (+0.2%) 🔴
root-static-local raw 72,302 72,458 +156 (+0.2%) 🔴
root-static-local gzip 23,648 23,704 +56 (+0.2%) 🔴
root-static-local brotli 21,156 21,188 +32 (+0.2%) 🔴
root-callback-local raw 74,207 74,363 +156 (+0.2%) 🔴
root-callback-local gzip 24,195 24,232 +37 (+0.2%) 🔴
root-callback-local brotli 21,694 21,660 −34 (−0.2%) 🟢
hooks-state raw 84,021 84,180 +159 (+0.2%) 🔴
hooks-state gzip 27,645 27,687 +42 (+0.2%) 🔴
hooks-state brotli 24,599 24,655 +56 (+0.2%) 🔴
prop-attributes raw 84,275 84,434 +159 (+0.2%) 🔴
prop-attributes gzip 27,643 27,688 +45 (+0.2%) 🔴
prop-attributes brotli 24,643 24,659 +16 (+0.1%) 🔴
context raw 96,228 96,387 +159 (+0.2%) 🔴
context gzip 31,340 31,386 +46 (+0.1%) 🔴
context brotli 27,799 27,877 +78 (+0.3%) 🔴
hydrate-root raw 137,671 137,827 +156 (+0.1%) 🔴
hydrate-root gzip 44,037 44,097 +60 (+0.1%) 🔴
hydrate-root brotli 38,491 38,588 +97 (+0.3%) 🔴
deferred-hydration raw 220,956 221,123 +167 (+0.1%) 🔴
deferred-hydration gzip 69,581 69,603 +22 (+0.0%) 🔴
deferred-hydration brotli 59,987 60,043 +56 (+0.1%) 🔴
hydrate-frame raw 364,886 365,162 +276 (+0.1%) 🔴
hydrate-frame gzip 112,823 112,917 +94 (+0.1%) 🔴
hydrate-frame brotli 96,548 96,574 +26 (+0.0%) 🔴
suspense-transition raw 138,918 139,083 +165 (+0.1%) 🔴
suspense-transition gzip 43,838 43,880 +42 (+0.1%) 🔴
suspense-transition brotli 38,571 38,593 +22 (+0.1%) 🔴
component-owned-effects raw 76,663 76,822 +159 (+0.2%) 🔴
component-owned-effects gzip 25,026 25,045 +19 (+0.1%) 🔴
component-owned-effects brotli 22,344 22,381 +37 (+0.2%) 🔴
binding-hooks raw 82,520 82,680 +160 (+0.2%) 🔴
binding-hooks gzip 27,300 27,330 +30 (+0.1%) 🔴
binding-hooks brotli 24,343 24,394 +51 (+0.2%) 🔴
binding-base-ui-vite raw 197,019 197,275 +256 (+0.1%) 🔴
binding-base-ui-vite gzip 61,891 61,976 +85 (+0.1%) 🔴
binding-base-ui-vite brotli 53,777 53,904 +127 (+0.2%) 🔴
binding-base-ui-esbuild raw 212,517 212,781 +264 (+0.1%) 🔴
binding-base-ui-esbuild gzip 68,836 68,906 +70 (+0.1%) 🔴
binding-base-ui-esbuild brotli 59,705 59,696 −9 (−0.0%) 🟢
binding-radix-vite raw 199,049 199,305 +256 (+0.1%) 🔴
binding-radix-vite gzip 62,486 62,568 +82 (+0.1%) 🔴
binding-radix-vite brotli 54,367 54,371 +4 (+0.0%) 🔴
binding-radix-esbuild raw 214,342 214,606 +264 (+0.1%) 🔴
binding-radix-esbuild gzip 69,408 69,484 +76 (+0.1%) 🔴
binding-radix-esbuild brotli 60,213 60,274 +61 (+0.1%) 🔴
binding-mantine-hooks-vite raw 86,078 86,237 +159 (+0.2%) 🔴
binding-mantine-hooks-vite gzip 28,266 28,284 +18 (+0.1%) 🔴
binding-mantine-hooks-vite brotli 25,210 25,235 +25 (+0.1%) 🔴
binding-mantine-hooks-esbuild raw 90,440 90,602 +162 (+0.2%) 🔴
binding-mantine-hooks-esbuild gzip 30,351 30,403 +52 (+0.2%) 🔴
binding-mantine-hooks-esbuild brotli 27,030 27,098 +68 (+0.3%) 🔴
binding-apollo-client-vite raw 339,463 339,718 +255 (+0.1%) 🔴
binding-apollo-client-vite gzip 104,205 104,291 +86 (+0.1%) 🔴
binding-apollo-client-vite brotli 91,019 91,009 −10 (−0.0%) 🟢
binding-apollo-client-esbuild raw 362,655 362,919 +264 (+0.1%) 🔴
binding-apollo-client-esbuild gzip 115,184 115,265 +81 (+0.1%) 🔴
binding-apollo-client-esbuild brotli 100,451 100,606 +155 (+0.2%) 🔴
binding-usehooks-ts-vite raw 86,844 87,003 +159 (+0.2%) 🔴
binding-usehooks-ts-vite gzip 28,492 28,510 +18 (+0.1%) 🔴
binding-usehooks-ts-vite brotli 25,415 25,430 +15 (+0.1%) 🔴
binding-usehooks-ts-esbuild raw 91,206 91,368 +162 (+0.2%) 🔴
binding-usehooks-ts-esbuild gzip 30,574 30,612 +38 (+0.1%) 🔴
binding-usehooks-ts-esbuild brotli 27,283 27,306 +23 (+0.1%) 🔴

36 other measured values are unchanged.

…creating Blocks

With unset native styles written without a Block, the frame hydrates about
1,650 Blocks. Refresh the suite's description and the changeset figures,
re-measured against main with 50 paired samples.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 7, 2026
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]>
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]>
Brotli shrank by 2-34 bytes in todo, root-chained-jsx, root-callback-local
and binding-base-ui-esbuild, so their committed budgets now sit more than
256 bytes above the measurement. Record the new floors; no budget rises.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The MCP server's benchmark tool mirrors the unified runner's suite list,
and its sync test failed once bench.mjs gained app-frame-hydration.

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
Takes 96c4096, which ratchets the bundle budgets back to main's
measurements until #1857 lands. Shard 1 failed "Verify every bundle
budget" here (cli-spa-starter raw 101976 against 101793 measured) for
the same reason. Measured locally on this branch, every minimal, app and
JSX row equals main's new budgets, so nothing else changes.

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

Main 96c4096 lowered hydrate-frame back to 364,918 / 112,855 / 96,725.
Recompute the raise from what CI measured for #1862's head (366,032 /
113,311 / 96,797) plus the standard headroom: 366,064 raw, 113,343 gzip
and 97,053 brotli.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm and others added 2 commits October 7, 2026 21:56
…hain update

The new TSRX formatter wraps the app-frame fixture's JSX holes and the owner
test's act call; server HTML for both scenarios is byte-identical. The new
compiler shrinks five measured values, so their budgets move to the new
floors. No budget rises.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ydration-block-entry

# Conflicts:
#	benchmarks/bundle-size/app-budgets.json
#	benchmarks/bundle-size/minimal-budgets.json
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
trueadm merged commit b6c040c into main Oct 7, 2026
4 of 24 checks passed
@trueadm
trueadm deleted the perf/hydration-block-entry branch October 7, 2026 21:03
trueadm added a commit that referenced this pull request Oct 7, 2026
Takes #1857 (in-place Block signal owners). No conflicts, and no lockfile
or budget changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 7, 2026
With #1857 (in-place Block signal owners) and #1862 (unchanged adoption reads)
on main, this branch's hydrate-frame measures 364,278 raw, 112,866 gzip and
96,483 brotli. The budget is that measurement plus headroom: 364,310 /
112,898 / 96,616. That is below main's 366,064 / 113,343 / 97,053, so it lowers
rather than raises.

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]>
trueadm added a commit that referenced this pull request Oct 7, 2026
Takes 31724a3, which re-lands the in-place Block signal owner budgets
now that #1857 is on main. Shard 1 failed with cli-spa-starter at 101,944
raw bytes against the walked-back 101,825; the re-landed budget is
101,976. No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
domgan-oai pushed a commit that referenced this pull request Oct 7, 2026
…1869)

Budget-only raise, landing ahead of #1861 per CONTRIBUTING "Size budgets".

main 43b60d9 measures deferred-hydration at exactly its 69,610 gzip budget
(#1857 and #1859 filled the headroom). #1861 stops development hydration
reporting an empty style attribute that an early binding left behind, and
measures 69,612 gzip there (-14 raw, +2 gzip). 69,642 is main's measured + 32,
the highest value the ratchet accepts against main, so no other pull request
fails the ratchet while #1861 is open.

Co-authored-by: Claude Opus 5.5 <[email protected]>
domgan-oai pushed a commit that referenced this pull request Oct 7, 2026
…#1851)

* perf(signals): install the public Scope surface only from createScope

Owner scopes that the runtime creates for compiled signal declarations never
reach application code, yet every signal application shipped the whole public
Scope implementation: serialization, inspection, trace recording and the
imperative derived$/get/set/isPending/batch/action methods.

ScopeImpl keeps one class shape. createScope installs the public-only methods
on its prototype the first time it runs, and only a debug scope installs trace
recording. The server's native-read driver installs the read serializer, so
clients never ship it. beginAdoption stays a method: hydration resolves it
through the owner, and importing the engine from the hydration path would pull
the engine into applications without signals.

An internal OwnerScope type omits the installed members, so internal code that
reaches for one fails to typecheck.

Signal applications are 871 to 1,118 B smaller gzipped; applications without
signals are byte-identical.

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

* fix(signals): keep native-read serialization off the server's import path

The server's native-read driver imported the engine to install the read
serializer. That loaded the engine, and its top-level batch-hook registration,
on every server render, including applications without signals, and Node's
strip-only TypeScript loader rejects the engine's parameter property
(register-hook direct server scripts failed).

serializeRead is a ScopeImpl method again, reached through the owner as on
main, so the server path and graph.ts match main. The server-render budget
returns to main's value. Signal applications are now 489 to 652 B smaller
gzipped; applications without signals stay byte-identical.

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

* test(hydration): read local scope state without the public inspect()

native-deferred-local-hook-diagnostics reached through a useSignal$ handle's
internal owner and called inspect(). Runtime-created scopes no longer carry the
public Scope surface unless the program calls createScope, and these cases
never do. Read the adoption leases and node count that inspect() reported
from the scope directly.

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

* fix(signals): hand out whole Scopes from the public owner routes

Runtime-created owner scopes reach application code: derived$ and query$ run
authored callbacks under them, so the public currentSignalOwner() returns one,
and a host SignalOwnerEnvironment carries them. Both are typed SignalOwner,
which narrows to Scope, but without an earlier createScope the scope lacked
inspect(), get() and the other installed methods.

currentSignalOwner and installSignalOwnerEnvironment exported from
octane/signals now install the public Scope methods before an owner can
escape; the runtime keeps owner-context's engine-free versions.
octane/server's carrier must stay engine-free, so SignalOwnerEnvironment now
carries owners as SignalOwnerIdentity values: a carrier stores and returns
them but cannot narrow them to Scope. Carriers that store SignalOwner values
compile unchanged.

bundle-boundaries builds each route in its own program without createScope
(the review's currentSignalOwner probe and a carrier that calls the owner it
carries); both fail with "inspect is not a function" without this change. A
type test pins the identity-typed carrier.

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

* perf(bundle-size): lower the hydrate-frame budget for the lighter signal scope

hydrate-frame (added on main by #1855) hydrates signal reads, so it ships
the signal engine. Against 188d60b's sources it is 2,030 B raw, 488 B gzip
and 437 B brotli smaller with this branch's engine, and no other minimal
scenario moves. The new budget is main's budget minus that delta, because
this machine measures main's own hydrate-frame 4 B over its budget.

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

* perf(bundle-size): re-measure hydrate-frame with #1857 and #1862 merged

With #1857 (in-place Block signal owners) and #1862 (unchanged adoption reads)
on main, this branch's hydrate-frame measures 364,278 raw, 112,866 gzip and
96,483 brotli. The budget is that measurement plus headroom: 364,310 /
112,898 / 96,616. That is below main's 366,064 / 113,343 / 97,053, so it lowers
rather than raises.

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 perf PR: performance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant