Repository navigation
perf: omit unused root error reporting for default roots - #1966
Conversation
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
9 other measured values are unchanged. Public-import reachability bundles (bytes)
36 other measured values are unchanged. |
|
Good to go, with nits. Root error reporting is preserved in every case I traced. One esbuild size regression looks avoidable.
Merge note:
Verified:
|
…ot-error-owner-bundle
…ot-error-owner-bundle # Conflicts: # packages/octane/tests/optional-driver-bundle.test.ts
…ot-error-owner-bundle # Conflicts: # packages/octane/src/compiler/compile.js
|
Heads-up: CI is red after the latest main merge ( (job log). Main itself is green at |
…ot-error-owner-bundle # Conflicts: # packages/octane/tests/optional-driver-bundle.test.ts
|
One request on Could you keep (or add back) the fire-and-forget form, evaluated against a container, and assert that the replacement value renders? For example The rest is fine: the gate update in |
|
Update: no change needed for the loader test. I ran the fire-and-forget form against this head ( 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 |
…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]>
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
createRootbinding. 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/clientand 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
67c7d1f0eincorporates main4fe0867caafter #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
c3708288fincorporates main8c09d8152and 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, andpnpm 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:Signed head
fae7f2c95integrates main64c33de2f. 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
18edand equal 64 work counters. Their paired within-run JSX timing observations are retained separately:bf1aaa938, run 38021220636acfc80d5c, run 380218633503967c5646, run 38023207281406449617, run 38025079559Matched 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:
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
38025079559also 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
18edsource’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:
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
agent-authored)Originating Codex task; implementation subtask: root-error ownership; host:
com-79386.Need help on this PR? Tag
@codesmith-botwith 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
createRootis called with exactly one argument (no options), while still supporting arbitrary returned values fromroot.renderunless 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__createRootDefaultOptionsand__createVoidRootDefaultOptions, imported fromoctane/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__createVoidRootstill 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.