Skip to content

perf: omit unused root error reporting for default roots - #1966

Merged
trueadm merged 14 commits into
octanejs:mainfrom
openai-oss-forks:codex/root-error-owner-bundle
Oct 10, 2026
Merged

trueadm merged 14 commits into
octanejs:mainfrom
openai-oss-forks:codex/root-error-owner-bundle

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Production DOM client roots that provably omit options can remove unused root error callback reporting. The compiler requires exactly one nonspread argument to the lexical createRoot binding. This default-options proof works independently of root lifetime; the stronger existing void-return proof still chooses the void reconciler. Returned values keep the generic reconciler, and the existing inline-memo fast path takes precedence.

Both compiler-only helpers use octane/internal/client and the existing root factory. Callback-capable roots install registration; actual nonempty callback registration enables reporting. Inline caught-error calls now use the existing handlers guard directly. Getter order, recovery argument evaluation, mutable/reentrant options, hydration and hidden-report FIFO behavior are preserved.

Current integration validation

Signed merge 67c7d1f0e incorporates main 4fe0867ca after #1976 landed. The resolution preserves the root-error, capture-restoration, and transition fixtures and assertions, with no changes beyond both parents' implementations. All 134 focused dev/prod executions pass, covering optional-feature bundles, event registration, deferred editor restoration, and capture/scroll behavior. Scoped runtime types, formatting, pnpm sync, and independent source/validation review pass. All 30 checks pass on this exact head, and GitHub reports it mergeable; reviewer approval remains required.

The current CI benchmark reports all 64 work counters unchanged. Complete Oxc rows JavaScript gzip changes from 29,503 → 29,052 B (TSRX, −451 B) and 54,160 → 53,673 B (JSX, −487 B). Retained-feature growth includes +67 B gzip for the full API and +51/+35/+29 B for the three hydration reachability controls. TSRX selection reports +1.4% with a nominal 95% interval of +0.5% to +2.1%; this remains an unresolved performance observation. The earlier swap observation below remains separate. Summary intervals without raw timing pairs or emitted JavaScript/maps do not establish independent causal timing attribution or CPU parity.

Previous integration validation (c3708288f)

Signed merge c3708288f incorporates main 8c09d8152 and resolves the overlapping optional-driver bundle tests while preserving both parents' implementations, complete fixtures, and assertions. The merged source passes 251 focused test executions, the scoped runtime typecheck, formatting, and pnpm sync. Independent source and validation reviews pass. All 30 checks passed on that head, and GitHub reported it mergeable after that integration.

The previous CI benchmark reports all 64 work counters unchanged and complete Oxc rows JavaScript gzip of 29,587 → 29,141 B (TSRX) and 54,147 → 53,671 B (JSX). Retained-feature size increases remain, including +72 B gzip for the full API and +23/+53/+36 B for the three hydration reachability controls. TSRX swap reports +2.5% with a nominal 95% interval of +0.3% to +5.4%; this positive observation remains unresolved. The uploaded artifact contains summary intervals but no raw timing pairs or emitted JavaScript/maps, so it does not support independent timing attribution or a CPU-parity claim.

Earlier measurements and integration results below apply to their named revisions.

Validation of the feedback revision

The local feedback checkpoint precedes the subsequent merges of main. Its matched complete-production-JavaScript gzip measurements against 4cc2a1ed (Node 24.20.0) are:

Fixture Oxc gzip delta esbuild gzip delta
TSRX rows −258 B −257 B
JSX rows −270 B −281 B
Base UI −266 B −290 B
Radix −259 B −270 B
Full API namespace +142 B +55 B
  • 248 distinct selected test executions passed, including compiler exclusions, returned-value roots, hydration/root lifecycle and 14 Rspack cases. The watch cases execute returned values; they do not prove watch invalidation.
  • Wrong returned-value ABI and disabled memo-path controls failed as intended; restored checks passed.
  • Runtime/index typecheck passed. The selected test program has 31 diagnostics matching the exact prior head in message and multiplicity; this scoped test typecheck is not a pass.
  • All 64 ordinary deterministic call/DOM counters match. Nine paired owning scenarios preserve semantics; default construction drops 331→330 calls and the other measured phases are equal.
  • Focused formatting, staged-DOM checks and sync passed. The feedback-only performance scan is empty; the six reporting/default-factory bodies remain unchanged.
  • Independent source, correctness, size and deterministic-work reviews passed. No new latency measurements qualify the feedback revision; the historical timings below apply to the earlier source.

Signed head fae7f2c95 integrates main 64c33de2f. Its final source passes 173 focused executions: 32 optional-feature/event cases across dev/prod, 19 loader cases, 31 compiler cases, 84 public-root cases and seven private-entrypoint cases. Scoped formatting and sync pass; all 255 production and eight selected test/fixture hashes stayed unchanged during validation. Independent source and evidence reviews pass.

The bundle oracle accepts either reusable factory and rejects both void factories; six root/CLI scenarios exercised the corrected gate before the final main integration. The loader regression now executes its actual transformed output against a replacement value-returning component and checks teardown, while retaining the assertion that the loader does not depend on the component's disk source. Its old equality assertion failed in CI and locally; a deliberately wrong void factory fails the new rendered-text assertion. All 19 loader and 14 neighboring proof cases passed before integration, and the 19 loader cases pass again on the final source. No production change was needed for either assertion repair.

CI passed on historical signed fae7f2c95; GitHub reports the PR mergeable with no unresolved review threads. Earlier byte/work/timing results qualify their stated source; no new latency claim is made for the main integrations.

Historical latency evidence and remaining limits

Four CI benchmark runs use unchanged runtime/compiler 18ed and equal 64 work counters. Their paired within-run JSX timing observations are retained separately:

Implementation/oracle head and workflow Selection change [95% interval] 10,000-row clear change [95% interval]
bf1aaa938, run 38021220636 +10.9% [+10.3%, +11.5%] +1.9% [+0.1%, +3.6%]
acfc80d5c, run 38021863350 +0.0% [−0.5%, +0.8%] +5.2% [+2.5%, +6.9%]
3967c5646, run 38023207281 +1.3% [+0.3%, +3.0%] −2.1% [−4.0%, −1.0%]
406449617, run 38025079559 +0.6% [0.0%, +1.9%] −0.6% [−1.7%, +0.7%]

Matched local follow-ups use the original ordinary esbuild/no-split JSX artifacts and operations, 20 independent fresh-browser groups per actual/identical cohort, balanced orders and 30 warmup plus 10 retained pairs per group. The primary statistics resample group arithmetic means:

Fresh operation Candidate/baseline ratio [95% interval] Identical-byte control
Selection 0.99829 [0.97118, 1.00831] 0.98959 [0.95662, 1.01551]
Clear 10,000 rows exactly once 0.99975 [0.99301, 1.00664] 0.99332 [0.98830, 1.00029]

No slowdown was detected in these fresh-operation local cohorts; their intervals still permit +0.83% and +0.66%. All 80 groups and 3,200 paired observations (including warmups), source/config/artifact hashes, paired inputs, original styles/fonts, clocks and semantic checks were retained and independently verified. No deleted row array is held across the clear timer. Selection's retained windows range 15.75–41.24 ms: 40 ms is the calibration target, not a guaranteed minimum. These host-specific tests do not replay the full preceding CI operation history, erase the earlier positive observations, or establish universal/tail latency. Creation/execution-order variation remains in the retained descriptive results.

Historical CI run 38025079559 also reports JSX update at +1.7% [95% interval +0.3%, +4.7%], with unchanged work counters. One prespecified matched local follow-up used the same ordinary esbuild artifacts and canonical update operation, with 16 fresh browser-process groups per actual/identical cohort, 10 warmup and 12 retained pairs per group. Each paired window rebuilds the same 1,000 rows and performs the same canonical calibrated repeat count (66–93); every row identity and cell is checked, including exactly 100 labels gaining the full repeated suffix. The primary ratio uses group arithmetic means of per-click durations.

The update candidate ratio is 0.99988 [0.99103, 1.00198]; the identical-baseline control is 1.00529 [0.99741, 1.01023]. No slowdown was detected in this fresh-operation local cohort; the candidate interval still permits +0.20%. All 32 groups and 704 paired observations (320 warmup, 384 retained), calibration counts, input/source/artifact hashes, styles/fonts/clocks and semantic checks were retained and independently verified, with no errors or exclusions. Retained windows range 12.75–21.88 ms; 20 ms was the calibration target. Creation/execution-order variability remains. This single local follow-up does not erase the CI observation or establish parity for the full CI operation history, other hosts, or tail latency.

The earlier 18ed source’s first CI reachability report records esbuild Base UI/Radix fixture growth of 396/454 gzip bytes (+1,222 raw bytes each), alongside smaller root/hydration/Vite-binding increases. These are additional tradeoffs beyond the full-API control above.

Historical owning timings for the earlier source were:

Operation Candidate/baseline ratio [95% interval] Identical-byte control
Public callback registration and caught/uncaught/inline reporting 0.9993 [0.9384, 1.0064] 1.0004 [0.9992, 1.0043]
Aggregated hidden-report reveal 0.9907 [0.9744, 1.0289] 0.9956 [0.9808, 1.0350]

No slowdown was detected in those historical warmed owning scenarios. Their primary intervals still permit +0.64% and +2.89%, and creation/order variability remains; this is not a universal or tail-latency guarantee. Active retained windows range from 12.2–24.3 ms; 20 ms was a calibration target, not a retained minimum. Reveal aggregation and reduced within-group window replication were agreed before collecting primary data, after the original 32-copy workload missed the 20 ms calibration target. The first failed calibration has no saved durations; it collected no primary groups. Earlier calibration receipts and protocols are preserved, and no outcome samples were excluded.

The earlier source passed CI and the local evidence review recorded above. Those results do not qualify the newer feedback revision or main integrations. This remains an incremental reduction; the complete 20% goal is unmet.

Provenance

  • An agent produced this diff (agent-authored)

Originating Codex task; implementation subtask: root-error ownership; host: com-79386.


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 root factory selection, compiler proofs, and lazy error-reporting wiring in the client runtime; behavior for roots with options is intended to stay the same but the split paths need careful review.

Overview
Production client bundles can drop unused root error-callback reporting when the compiler proves createRoot is called with exactly one argument (no options), while still supporting arbitrary returned values from root.render unless the stronger void-output proof applies.

The compiler adds a call-only default-options proof (findDefaultOptionsRootCalls) separate from void-root lifetime analysis. Proven sites rewrite to internal helpers __createRootDefaultOptions and __createVoidRootDefaultOptions, imported from octane/internal/client; full void-output proofs still win and map to the existing void reconcilers. Slot-hooks and compile passes merge both rewrite maps, with memo lowering taking precedence when it applies.

The runtime lazy-enables root error registration: handlers and report functions start as noops until a root that accepts options registers callbacks; default-options factories never wire that path. Inline caught-error enqueue paths now guard on whether handlers were installed. Callback-capable createRoot, hydrateRoot, and __createVoidRoot still install registration and preserve getter order, recovery, and hydration behavior.

Benchmarks and tests were updated to accept the new specialized root exports and to assert bundles omit root-error machinery when only default-options roots are used.

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

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent perf PR: performance work labels Oct 10, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review October 10, 2026 03:37
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 8 value(s) increased
  • 🔴 bundle-reachability: 9 value(s) increased

Compares 4fe0867ca, the merge commit's first parent with 5e12cb731 on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. 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 2.417 2.433 ±0.0% ±0.0% … +0.0% ⚪ within noise
octane-tsrx replace 5.033 5.075 ±0.0% −4.7% … +4.0% ⚪ within noise
octane-tsrx add 2.342 2.308 ±0.0% −1.9% … ±0.0% ⚪ within noise
octane-tsrx update 0.126 0.127 +1.4% −0.3% … +3.1% ⚪ within noise
octane-tsrx select 0.005 0.005 +1.4% +0.5% … +2.1% ⚪ within noise
octane-tsrx swap 0.016 0.016 ±0.0% −0.6% … +1.1% ⚪ within noise
octane-tsrx remove 0.014 0.013 −1.0% −3.3% … +2.0% ⚪ within noise
octane-tsrx runlots 23.367 23.675 +1.0% −1.2% … +3.4% ⚪ within noise
octane-tsrx select_lots 0.006 0.006 −0.6% −1.8% … −0.3% ⚪ within noise
octane-tsrx clear 44.350 45.150 +0.4% −2.0% … +4.0% ⚪ within noise
octane-jsx run 3.700 3.517 −2.6% −5.4% … +4.6% ⚪ within noise
octane-jsx replace 6.425 6.883 −0.7% −3.0% … +1.7% ⚪ within noise
octane-jsx add 3.175 3.283 ±0.0% −2.9% … +0.0% ⚪ within noise
octane-jsx update 0.236 0.236 −0.7% −1.4% … +0.3% ⚪ within noise
octane-jsx select 0.125 0.123 ±0.0% −2.2% … +1.0% ⚪ within noise
octane-jsx swap 0.179 0.173 −0.3% −1.1% … +1.4% ⚪ within noise
octane-jsx remove 0.161 0.161 +0.3% −0.6% … +1.1% ⚪ within noise
octane-jsx runlots 27.800 28.083 −2.1% −3.9% … +0.4% ⚪ within noise
octane-jsx select_lots 1.563 1.571 +1.7% −1.4% … +4.2% ⚪ within noise
octane-jsx clear 47.092 46.150 +0.3% −0.9% … +1.6% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 88,710 87,251 −1,459 (−1.6%) 🟢
octane-tsrx js_gzip 29,503 29,052 −451 (−1.5%) 🟢
octane-tsrx js_brotli 26,322 25,950 −372 (−1.4%) 🟢
octane-tsrx app_gzip 2,335 2,334 −1 (−0.0%) 🟢
octane-tsrx app_brotli 2,036 2,039 +3 (+0.1%) 🔴
octane-tsrx fw_raw 81,756 80,297 −1,459 (−1.8%) 🟢
octane-tsrx fw_gzip 27,168 26,718 −450 (−1.7%) 🟢
octane-tsrx fw_brotli 24,286 23,911 −375 (−1.5%) 🟢
octane-tsrx todo_js_raw 101,362 99,903 −1,459 (−1.4%) 🟢
octane-tsrx todo_js_gzip 34,088 33,647 −441 (−1.3%) 🟢
octane-tsrx todo_js_brotli 30,332 29,983 −349 (−1.2%) 🟢
octane-tsrx todo_app_gzip 2,238 2,237 −1 (−0.0%) 🟢
octane-tsrx todo_fw_raw 96,721 95,262 −1,459 (−1.5%) 🟢
octane-tsrx todo_fw_gzip 31,850 31,410 −440 (−1.4%) 🟢
octane-tsrx todo_fw_brotli 28,431 28,082 −349 (−1.2%) 🟢
octane-tsrx chat_js_raw 100,702 99,243 −1,459 (−1.4%) 🟢
octane-tsrx chat_js_gzip 34,037 33,552 −485 (−1.4%) 🟢
octane-tsrx chat_js_brotli 30,346 29,958 −388 (−1.3%) 🟢
octane-tsrx chat_app_gzip 2,724 2,725 +1 (+0.0%) 🔴
octane-tsrx chat_app_brotli 2,389 2,386 −3 (−0.1%) 🟢
octane-tsrx chat_fw_raw 94,919 93,460 −1,459 (−1.5%) 🟢
octane-tsrx chat_fw_gzip 31,313 30,827 −486 (−1.6%) 🟢
octane-tsrx chat_fw_brotli 27,957 27,572 −385 (−1.4%) 🟢
octane-tsrx weather_js_raw 135,955 133,548 −2,407 (−1.8%) 🟢
octane-tsrx weather_js_gzip 45,056 44,278 −778 (−1.7%) 🟢
octane-tsrx weather_js_brotli 39,709 39,128 −581 (−1.5%) 🟢
octane-tsrx weather_app_brotli 6,652 6,692 +40 (+0.6%) 🔴
octane-tsrx weather_fw_raw 113,781 111,374 −2,407 (−2.1%) 🟢
octane-tsrx weather_fw_gzip 37,198 36,420 −778 (−2.1%) 🟢
octane-tsrx weather_fw_brotli 33,057 32,436 −621 (−1.9%) 🟢
octane-tsrx bindings_js_raw 680,555 679,689 −866 (−0.1%) 🟢
octane-tsrx bindings_js_gzip 224,124 223,857 −267 (−0.1%) 🟢
octane-tsrx bindings_js_brotli 190,743 190,487 −256 (−0.1%) 🟢
octane-tsrx bindings_app_brotli 96,214 96,166 −48 (−0.0%) 🟢
octane-tsrx bindings_fw_raw 332,813 331,947 −866 (−0.3%) 🟢
octane-tsrx bindings_fw_gzip 108,453 108,186 −267 (−0.2%) 🟢
octane-tsrx bindings_fw_brotli 94,529 94,321 −208 (−0.2%) 🟢
octane-tsrx full_fw_raw 575,369 575,606 +237 (+0.0%) 🔴
octane-tsrx full_fw_gzip 173,868 173,935 +67 (+0.0%) 🔴
octane-tsrx full_fw_brotli 146,392 146,307 −85 (−0.1%) 🟢
octane-jsx js_raw 167,055 165,598 −1,457 (−0.9%) 🟢
octane-jsx js_gzip 54,160 53,673 −487 (−0.9%) 🟢
octane-jsx js_brotli 47,444 47,068 −376 (−0.8%) 🟢
octane-jsx app_gzip 2,862 2,860 −2 (−0.1%) 🟢
octane-jsx app_brotli 2,410 2,438 +28 (+1.2%) 🔴
octane-jsx fw_raw 158,776 157,319 −1,457 (−0.9%) 🟢
octane-jsx fw_gzip 51,298 50,813 −485 (−0.9%) 🟢
octane-jsx fw_brotli 45,034 44,630 −404 (−0.9%) 🟢
octane-jsx full_fw_raw 575,369 575,606 +237 (+0.0%) 🔴
octane-jsx full_fw_gzip 173,868 173,935 +67 (+0.0%) 🔴
octane-jsx full_fw_brotli 146,392 146,307 −85 (−0.1%) 🟢

9 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 82,078 80,619 −1,459 (−1.8%) 🟢
cli-spa-starter gzip 28,189 27,715 −474 (−1.7%) 🟢
cli-spa-starter brotli 25,082 24,663 −419 (−1.7%) 🟢
root-static-specialized raw 53,863 52,403 −1,460 (−2.7%) 🟢
root-static-specialized gzip 18,296 17,851 −445 (−2.4%) 🟢
root-static-specialized brotli 16,587 16,200 −387 (−2.3%) 🟢
root-chained-jsx raw 56,214 54,755 −1,459 (−2.6%) 🟢
root-chained-jsx gzip 18,996 18,523 −473 (−2.5%) 🟢
root-chained-jsx brotli 17,194 16,808 −386 (−2.2%) 🟢
root-static raw 148,579 147,117 −1,462 (−1.0%) 🟢
root-static gzip 48,198 47,717 −481 (−1.0%) 🟢
root-static brotli 42,462 42,054 −408 (−1.0%) 🟢
root-static-local raw 53,862 52,402 −1,460 (−2.7%) 🟢
root-static-local gzip 18,282 17,838 −444 (−2.4%) 🟢
root-static-local brotli 16,589 16,237 −352 (−2.1%) 🟢
root-callback-local raw 56,695 55,235 −1,460 (−2.6%) 🟢
root-callback-local gzip 19,122 18,642 −480 (−2.5%) 🟢
root-callback-local brotli 17,322 16,900 −422 (−2.4%) 🟢
hooks-state raw 64,319 62,863 −1,456 (−2.3%) 🟢
hooks-state gzip 21,543 21,102 −441 (−2.0%) 🟢
hooks-state brotli 19,482 19,174 −308 (−1.6%) 🟢
prop-attributes raw 61,431 59,969 −1,462 (−2.4%) 🟢
prop-attributes gzip 20,692 20,246 −446 (−2.2%) 🟢
prop-attributes brotli 18,771 18,323 −448 (−2.4%) 🟢
context raw 70,185 68,729 −1,456 (−2.1%) 🟢
context gzip 23,384 22,939 −445 (−1.9%) 🟢
context brotli 21,155 20,740 −415 (−2.0%) 🟢
hydrate-root raw 117,426 117,485 +59 (+0.1%) 🔴
hydrate-root gzip 38,224 38,275 +51 (+0.1%) 🔴
hydrate-root brotli 33,751 33,769 +18 (+0.1%) 🔴
deferred-hydration raw 199,364 199,432 +68 (+0.0%) 🔴
deferred-hydration gzip 63,509 63,544 +35 (+0.1%) 🔴
deferred-hydration brotli 55,080 55,137 +57 (+0.1%) 🔴
hydrate-frame raw 348,922 348,990 +68 (+0.0%) 🔴
hydrate-frame gzip 109,991 110,020 +29 (+0.0%) 🔴
hydrate-frame brotli 94,371 94,427 +56 (+0.1%) 🔴
suspense-transition raw 124,420 122,373 −2,047 (−1.6%) 🟢
suspense-transition gzip 39,882 39,276 −606 (−1.5%) 🟢
suspense-transition brotli 35,321 34,842 −479 (−1.4%) 🟢
component-owned-effects raw 56,679 55,220 −1,459 (−2.6%) 🟢
component-owned-effects gzip 19,156 18,711 −445 (−2.3%) 🟢
component-owned-effects brotli 17,386 16,968 −418 (−2.4%) 🟢
binding-hooks raw 66,972 65,519 −1,453 (−2.2%) 🟢
binding-hooks gzip 22,725 22,282 −443 (−1.9%) 🟢
binding-hooks brotli 20,554 20,159 −395 (−1.9%) 🟢
binding-base-ui-vite raw 189,764 188,307 −1,457 (−0.8%) 🟢
binding-base-ui-vite gzip 61,054 60,621 −433 (−0.7%) 🟢
binding-base-ui-vite brotli 53,442 53,033 −409 (−0.8%) 🟢
binding-base-ui-esbuild raw 217,056 215,600 −1,456 (−0.7%) 🟢
binding-base-ui-esbuild gzip 70,639 70,176 −463 (−0.7%) 🟢
binding-base-ui-esbuild brotli 61,439 61,119 −320 (−0.5%) 🟢
binding-radix-vite raw 190,126 188,669 −1,457 (−0.8%) 🟢
binding-radix-vite gzip 60,949 60,486 −463 (−0.8%) 🟢
binding-radix-vite brotli 53,350 52,995 −355 (−0.7%) 🟢
binding-radix-esbuild raw 217,202 215,746 −1,456 (−0.7%) 🟢
binding-radix-esbuild gzip 70,510 70,085 −425 (−0.6%) 🟢
binding-radix-esbuild brotli 61,229 61,028 −201 (−0.3%) 🟢
binding-mantine-hooks-vite raw 64,975 63,522 −1,453 (−2.2%) 🟢
binding-mantine-hooks-vite gzip 21,970 21,516 −454 (−2.1%) 🟢
binding-mantine-hooks-vite brotli 19,921 19,498 −423 (−2.1%) 🟢
binding-mantine-hooks-esbuild raw 76,736 75,277 −1,459 (−1.9%) 🟢
binding-mantine-hooks-esbuild gzip 26,575 26,118 −457 (−1.7%) 🟢
binding-mantine-hooks-esbuild brotli 23,836 23,458 −378 (−1.6%) 🟢
binding-apollo-client-vite raw 331,927 330,471 −1,456 (−0.4%) 🟢
binding-apollo-client-vite gzip 103,310 102,863 −447 (−0.4%) 🟢
binding-apollo-client-vite brotli 90,437 90,188 −249 (−0.3%) 🟢
binding-apollo-client-esbuild raw 367,228 365,772 −1,456 (−0.4%) 🟢
binding-apollo-client-esbuild gzip 117,047 116,597 −450 (−0.4%) 🟢
binding-apollo-client-esbuild brotli 102,282 101,814 −468 (−0.5%) 🟢
binding-usehooks-ts-vite raw 65,757 64,304 −1,453 (−2.2%) 🟢
binding-usehooks-ts-vite gzip 22,202 21,739 −463 (−2.1%) 🟢
binding-usehooks-ts-vite brotli 20,131 19,713 −418 (−2.1%) 🟢
binding-usehooks-ts-esbuild raw 77,510 76,051 −1,459 (−1.9%) 🟢
binding-usehooks-ts-esbuild gzip 26,828 26,346 −482 (−1.8%) 🟢
binding-usehooks-ts-esbuild brotli 24,064 23,686 −378 (−1.6%) 🟢

36 other measured values are unchanged.

@trueadm

trueadm commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Good to go, with nits. Root error reporting is preserved in every case I traced. One esbuild size regression looks avoidable.

  1. esbuild public-root growth (the 🔴 Base UI/Radix esbuild rows).
    • registerEnabledRootErrorHandlers always swaps in registeredEnqueueInlineCaughtError. esbuild keeps writes to module-level lets, so every app that keeps public createRoot/hydrateRoot now retains the inline-catch chain: registeredEnqueueInlineCaughtError, inlineCaughtErrorOwner and cancelHiddenRevealAction. Before, only the @try call sites reached it.
    • A minified esbuild probe of createRoot(el).render(App) goes from 174,271 to 175,493 B, exactly the bot's +1,222 raw on binding-base-ui-esbuild and binding-radix-esbuild. Dropping only that swap gives +67, but then Vite apps that use @try with default roots save about 900 B less.
    • Declaring ROOT_ERROR_HANDLERS above those three call sites and guarding them by truthiness (if (reportInline && ROOT_ERROR_HANDLERS)) should keep both savings. I haven't measured it on Vite.
  2. Question: the lifetime proof may be unnecessary. Whether a root gets options depends only on the call itself: createRoot(x) through the module's own import with no spread can never receive options later. Tying the rewrite to proveVoidRoots is what forced the extra vite.js gate and the slot-hooks fallback. It also skips roots that escape their function or are exported, which could take the helper safely.
  3. Nit: two import routes for the same helpers. compile.js routes both helpers to octane/internal/client, but slot-hooks imports them from 'octane'. Only that second route needs the new index.ts exports, which add to the full-API growth (+141 B gzip).

Merge note:

Verified:

  • While no handlers are registered, the noop reporters behave exactly like the registered ones, and recovery arguments are still evaluated. Hydration-recoverable and view-transition errors read the registry directly.
  • Every factory that accepts options enables registration before its first registerRootErrorHandlers call. SSR is unchanged, and DEV/HMR/profile builds are excluded from the rewrite.
  • Options passed through a variable or spread, explicit undefined, extra arguments, namespace imports, re-exports and aliases all keep the full factory. Rewrites stay copy-on-write.
  • The bench-runner edits only teach the oracles the new helper names. Fixtures and measured bytes are unchanged, and the bot rows match the PR's numbers.

…ot-error-owner-bundle

# Conflicts:
#	packages/octane/tests/optional-driver-bundle.test.ts
…ot-error-owner-bundle

# Conflicts:
#	packages/octane/src/compiler/compile.js
@trueadm

trueadm commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Heads-up: CI is red after the latest main merge (70f5bf6dd5). The bundle size checks reachability gate fails with:

REACHABILITY FAIL: AssertionError [ERR_ASSERTION]: root-static: the reusable public root was replaced by the disposable contract

(job log). Main itself is green at 2075c0e723, so this comes from combining this PR with what landed since review: #1970 (ref consumers), #1971 and #1972 (static event categories). The root-static fixture now gets the default-options/void root helper where the gate expects the reusable public createRoot. This needs a fix or an explicit gate update with a rationale before merge.

@trueadm

trueadm commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

One request on b2f636dbd4 before merge. The new behavioral assertion is better than byte equality, because it checks that a value-returning replacement still renders. But the fixture moved away from fire-and-forget createRoot(document.body).render(Main); to a stored root with unmount. The fire-and-forget form is exactly the shape a void-root rewrite targets. No other rspack test covers it on the loader's unproven path (git grep finds only same-file-void-roots, which is the compiler-level case). So the "cannot prove resolved module output → not void" gate under rspack is no longer exercised.

Could you keep (or add back) the fire-and-forget form, evaluated against a container, and assert that the replacement value renders? For example createRoot(container).render(Main) inside mount(container), with no stored root. The stored-root case can stay as a second it.

The rest is fine: the gate update in run-minimal.mjs (819e1578ef) keeps the "reusable root never becomes the void contract" check, and CI is green on fae7f2c95c.

@trueadm

trueadm commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Update: no change needed for the loader test. I ran the fire-and-forget form against this head (c3708288f9) with export function mount(container) { createRoot(container).render(Main); } on the rspack loader's unproven path. The loader emits __createRootDefaultOptions(container).render(Main), which is the reusable root, not the void contract. A value-returning replacement renders correctly (rspack-plugin project, 2/2 passing).

So the behavior is right, and only the coverage moved. I'll add that case back in a small follow-up test PR after this lands. The only thing blocking merge now is the optional-driver-bundle.test.ts conflict with #1976's CAPTURE_DECLARATIONS: keep every list. Once that's green on current main, this merges.

@trueadm
trueadm merged commit 2fe1f9f into octanejs:main Oct 10, 2026
31 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 10, 2026
trueadm added a commit that referenced this pull request Oct 11, 2026
…th (#1994)

#1966 rewrote the only rspack loader case that rendered a fire-and-forget
`createRoot(container).render(Main)` root without a void-component proof,
switching it to a stored root with `unmount`. The unstored shape is the one
a void-root rewrite targets, so restore it as its own case: the loader must
keep `__createRootDefaultOptions` and render a value returned by a
replacement component.

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.

2 participants