Skip to content

perf: omit unused capture completion code - #1976

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

trueadm merged 7 commits into
octanejs:mainfrom
openai-oss-forks:codex/capture-owner-bundle

Conversation

@domgan-oai

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

Copy link
Copy Markdown
Contributor

Summary

Applications without authored capture handlers retain capture completion work through the native capture observer. Install the existing completion target when capture handlers register, so these bundles can omit the finisher. The dispatcher and two-argument finisher bodies, call position, listener order and controlled-input restoration stay intact.

The runtime change is one local target, an assignment in the shared capture-registration function before capture flag/map publication, and the existing call's callee. Both public and compiler-private registration install the same target. A fresh production test adds capture to a live bubble-only root and verifies repeated stopped-input restoration, focus, DOM identity and teardown. Source-map assertions check absence and retention of the finisher body.

Historical complete production JavaScript gzip, exact fixed 4cc2a1 → the qualified implementation before main’s ref/clone/static-event integrations:

Fixture Canonical Oxc Ordinary esbuild
TSRX rows 32,140 → 32,050 B (−90) 37,614 → 37,529 B (−85)
JSX rows, capture retained 54,702 → 54,719 B (+17) 65,062 → 65,068 B (+6)
Public + internal client API ceiling 173,436 → 173,482 B (+46) 181,372 → 181,378 B (+6)

Oxc uses the canonical framework split; ordinary esbuild uses the original fixture configuration without a split. These are whole-JavaScript totals, not a minifier-only comparison.

Current integration validation

Signed merge af9530155 incorporates main 8c09d8152 and resolves the overlapping optional-driver bundle tests while preserving both parents' implementations, complete fixtures, and assertions. The merged source passes 130 focused test executions, the scoped runtime typecheck, formatting, and pnpm sync. Independent source and validation reviews 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,587 → 29,503 B for TSRX and 54,147 → 54,160 B for JSX; the bindings fixture grows by 14 B gzip, with other retained-feature tradeoffs listed in the report. No timing interval has a strictly positive lower bound in this run, which does not establish equivalence. The uploaded artifact contains summary intervals but no raw timing pairs or emitted JavaScript/maps; historical performance limitations below remain open.

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

Validation

Signed head 7c0cb3304 integrates main 64c33de2f and passes 30 focused optional-feature/event-registration executions across dev/prod, formatting and sync. All 255 production hashes stayed unchanged during validation. Independent review confirms the incoming main code and both parents' tests are preserved; the capture finisher and dispatcher bodies remain unchanged. CI passed on historical signed 7c0cb3304. The earlier browser, type, byte and timing receipts below remain tied to their named pre-integration source.

  • pnpm format:check — repo-wide check not run; scoped changed-file check passes.

  • pnpm typecheck — repo-wide check not run; runtime and changed-test checks pass with zero diagnostics.

  • pnpm test — full workspace sweep not run.

  • targeted tests: 88 candidate development/production executions across eight owning files; the new public restoration case also passes twice on the baseline.

  • No-op and omitted installers each fail both public restoration assertions; eager installation fails both body-absence assertions. Source restored exactly after each control.

  • Staged-DOM and performance scans, scoped formatting, and fresh production browser controls pass. All 12 baseline/candidate fault and trusted-input observations agree; a no-op finisher preserves capture delivery but fails the unchanged value/selection restoration oracle.

  • All 64 original ordinary call/DOM counters are equal, including original styles and direct-list gates. Complete owning flows are also equal: 36,355 normal-capture calls and 34,819 pre-try-error calls per side, with matching semantics/DOM and four zero-call quiet checks. Named diagnostics verify actual finisher execution and a genuinely dormant prefix.

  • perf-review: the original scan reports zero candidates. Capture registration installs one stable target before publishing its flag; dispatch changes only the finisher callee. No new record fields, per-event allocations/calls, DOM work or scheduling are added. The source/work/timing receipts below qualify the original implementation; later CI performance observations remain open as described below.

  • concise-code: runtime +4/−1 lines, no new exports/modules/hot-record fields; one existing test file and a release changeset. Keeping the direct reference retains the finisher; moving the whole capture body requires more machinery and was rejected after measured regressions. This smaller change keeps the original bodies and call placement. Byte benefits and retained-feature growth are reported above.

The original implementation’s Chromium timing uses the unchanged public stimulus after 1,000 bubble-only events, with 16 fresh browser groups per actual/identical cohort and operation, 10 warmup plus 12 retained pairs. All 64 groups and 1,408 paired windows are retained; no exclusions or retuning. Head/base ratios and nominal 95% intervals:

Owning operation Actual candidate Identical-baseline control
Warm capture dispatch 1.00638 [0.99528, 1.02270] 0.99056 [0.97391, 1.00624]
Warm pre-try exception 1.00042 [0.99223, 1.00971] 1.00999 [0.99307, 1.01250]
First affected capture 0.95442 [0.80645, 1.27778] 1.04303 [0.97325, 1.13636]
First affected exception 1.02136 [0.92079, 1.05882] 0.97293 [0.93529, 1.05435]

No slowdown was detected in the actual primary or order partitions. These finite bounds allow +2.27% normal steady cost and +0.97% exceptional steady cost; they do not establish universal parity. The identical exception control has positive candidate-first creation/execution partitions, and identical capture has a negative candidate-first creation partition. No control bias is subtracted.

First-use precision is coarse: capture spans 0.090–0.205 ms baseline / 0.090–0.250 ms head, paired median delta −0.0075 ms, seven of 16 slower. Exception spans 0.335–0.620 / 0.310–0.575 ms, paired median delta +0.010 ms, nine of 16 slower. The 5 µs clock does not dismiss these observations; first-use upper bounds are +27.78% and +5.88%, not startup guarantees. Calibration met 20 ms on both sides; capture batches later warmed to medians 13.610/13.775 ms without changing repeats. All calibration observations remain preserved.

Risk / follow-ups

The subsequent CI benchmark run 38049355295 on 76f8f1000 reports five positive nominal 95% timing intervals despite green checks: TSRX select +1.4% [+0.5%, +2.1%], swap +1.1% [+0.6%, +1.6%], clear +4.0% [+0.5%, +10.6%]; JSX select +1.2% [+0.6%, +2.2%], swap +2.1% [+0.6%, +3.6%]. All 64 deterministic work/DOM counters match. The uploaded report lacks emitted JavaScript and raw sample vectors. These observations remain unexplained; the earlier owning timings do not establish parity for these row operations. Performance acceptance remains open.

Main 2075c0e72 integration preserves the ref/clone changes and moves finisher installation into registerDelegatedCapture, so static compiled and public dynamic capture registrations both activate it. Signed head f885ceccf passes 64 focused development/production checks, scoped runtime/test typechecking with zero diagnostics, formatting and sync. The five-page Chromium integration passes four trusted-input controls and verifies a meaningful no-op-finisher restoration failure. Independent review verifies all 255 committed production files, 520 build inputs and 18 artifacts; no new latency measurement was taken. CI passed on historical signed 7c0cb3304.

The existing React-comparison browser suite is unavailable locally because exact pinned @tsrx/[email protected] is absent; no registry bypass or version substitute was used. The product diff does not edit that suite. Current-head CI remains a separate completion gate.

A separate composition with the seven prior changes measures 29,020 B canonical Oxc gzip (−98 B versus that combination). Its installer is at the shared capture publisher, covering the compiler helper as well as public registration; all four trusted-input positives and a causal no-op restoration control pass. This is a bytes/producer-integration receipt, not full joint correctness, work or latency qualification. No prior held capture-body experiment is used as validation here.

Independent final source, correctness and timing audits passed. Signed implementation 62d90a1e1 is preserved by signed merge 76f8f1000, which incorporates only required live base 5d6d02c8 to satisfy strict branch currency. Post-merge sync/format and 20 focused executions pass (six new host-diagnostic cases and 14 repeated finisher cases). Only the DEV host-property diagnostic source changed: all 10 minified product/timed JavaScript assets rebuild byte-identically. The never-timed named diagnostic differs only in 26 source-path region comments; its initial strict byte-guard failure is preserved. Qualified timings were not rerun. CI passed on historical signed 7c0cb3304; the earlier integration receipts above remain historical.

Provenance

  • An agent produced this diff (agent-authored)

Origin: Codex task, implementation subtask retention_audit, host com-79386. Key choices: fixed baseline; original bodies and call positions; one producer-installed target; meaningful restoration and retention negatives; complete-bundle, work and finite browser evidence with limitations stated separately.


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 the delegated event completion path and controlled-input restoration timing when capture is registered late; correctness is guarded by new production bundle tests.

Overview
Production bundles that never register onXxxCapture can now drop finishCaptureDispatch instead of keeping it on every delegated dispatch path.

Delegated dispatch calls a module-level CAPTURE_FINISH hook; registerDelegatedCapture assigns it to the existing finisher before capture flags are published, so behavior when capture is used is unchanged. Bundle tests treat the finisher like other optional runtime pieces and add a scenario that adds capture to a live bubble-only root and checks controlled-input restoration after stopPropagation.

Reviewed by Cursor Bugbot for commit af95301. 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 11:42
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 18 value(s) increased
  • 🔴 bundle-reachability: 20 value(s) increased

Compares 8c09d8152, the merge commit's first parent with 0406c5d6c 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.600 2.542 −1.7% −3.8% … ±0.0% ⚪ within noise
octane-tsrx replace 5.583 5.575 +0.0% −1.8% … +3.3% ⚪ within noise
octane-tsrx add 2.350 2.317 −0.0% −4.1% … ±0.0% ⚪ within noise
octane-tsrx update 0.123 0.123 +0.5% −1.2% … +1.9% ⚪ within noise
octane-tsrx select 0.005 0.005 −0.2% −1.1% … +0.6% ⚪ within noise
octane-tsrx swap 0.016 0.016 −1.1% −2.2% … +0.0% ⚪ within noise
octane-tsrx remove 0.013 0.013 −0.5% −2.8% … +1.0% ⚪ within noise
octane-tsrx runlots 24.050 23.842 −0.2% −3.7% … +5.9% ⚪ within noise
octane-tsrx select_lots 0.006 0.006 −0.6% −0.7% … ±0.0% ⚪ within noise
octane-tsrx clear 43.650 44.250 −0.4% −1.4% … +2.3% ⚪ within noise
octane-jsx run 3.092 3.100 +1.3% −0.0% … +3.3% ⚪ within noise
octane-jsx replace 6.433 6.442 −1.6% −5.7% … +2.2% ⚪ within noise
octane-jsx add 3.008 2.950 ±0.0% −3.2% … +3.2% ⚪ within noise
octane-jsx update 0.247 0.245 −0.7% −1.9% … +0.7% ⚪ within noise
octane-jsx select 0.128 0.129 +1.7% −0.3% … +3.1% ⚪ within noise
octane-jsx swap 0.173 0.175 +1.3% −0.8% … +2.9% ⚪ within noise
octane-jsx remove 0.171 0.172 +1.2% −0.0% … +1.5% ⚪ within noise
octane-jsx runlots 27.408 28.183 −1.1% −2.2% … +2.1% ⚪ within noise
octane-jsx select_lots 1.446 1.492 −0.9% −2.9% … +2.1% ⚪ within noise
octane-jsx clear 52.242 50.825 −6.0% −8.9% … −1.6% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 89,026 88,710 −316 (−0.4%) 🟢
octane-tsrx js_gzip 29,587 29,503 −84 (−0.3%) 🟢
octane-tsrx js_brotli 26,451 26,322 −129 (−0.5%) 🟢
octane-tsrx app_gzip 2,334 2,335 +1 (+0.0%) 🔴
octane-tsrx app_brotli 2,043 2,036 −7 (−0.3%) 🟢
octane-tsrx fw_raw 82,072 81,756 −316 (−0.4%) 🟢
octane-tsrx fw_gzip 27,253 27,168 −85 (−0.3%) 🟢
octane-tsrx fw_brotli 24,408 24,286 −122 (−0.5%) 🟢
octane-tsrx todo_js_raw 101,781 101,362 −419 (−0.4%) 🟢
octane-tsrx todo_js_gzip 34,207 34,088 −119 (−0.3%) 🟢
octane-tsrx todo_js_brotli 30,408 30,332 −76 (−0.2%) 🟢
octane-tsrx todo_app_brotli 1,906 1,901 −5 (−0.3%) 🟢
octane-tsrx todo_fw_raw 97,140 96,721 −419 (−0.4%) 🟢
octane-tsrx todo_fw_gzip 31,969 31,850 −119 (−0.4%) 🟢
octane-tsrx todo_fw_brotli 28,502 28,431 −71 (−0.2%) 🟢
octane-tsrx chat_js_raw 101,121 100,702 −419 (−0.4%) 🟢
octane-tsrx chat_js_gzip 34,150 34,037 −113 (−0.3%) 🟢
octane-tsrx chat_js_brotli 30,397 30,346 −51 (−0.2%) 🟢
octane-tsrx chat_app_gzip 2,726 2,724 −2 (−0.1%) 🟢
octane-tsrx chat_app_brotli 2,392 2,389 −3 (−0.1%) 🟢
octane-tsrx chat_fw_raw 95,338 94,919 −419 (−0.4%) 🟢
octane-tsrx chat_fw_gzip 31,424 31,313 −111 (−0.4%) 🟢
octane-tsrx chat_fw_brotli 28,005 27,957 −48 (−0.2%) 🟢
octane-tsrx weather_js_raw 136,271 135,955 −316 (−0.2%) 🟢
octane-tsrx weather_js_gzip 45,136 45,056 −80 (−0.2%) 🟢
octane-tsrx weather_js_brotli 39,842 39,709 −133 (−0.3%) 🟢
octane-tsrx weather_app_gzip 7,856 7,858 +2 (+0.0%) 🔴
octane-tsrx weather_app_brotli 6,679 6,652 −27 (−0.4%) 🟢
octane-tsrx weather_fw_raw 114,097 113,781 −316 (−0.3%) 🟢
octane-tsrx weather_fw_gzip 37,280 37,198 −82 (−0.2%) 🟢
octane-tsrx weather_fw_brotli 33,163 33,057 −106 (−0.3%) 🟢
octane-tsrx bindings_js_raw 680,546 680,555 +9 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 224,110 224,124 +14 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 190,617 190,743 +126 (+0.1%) 🔴
octane-tsrx bindings_app_gzip 115,673 115,671 −2 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 96,103 96,214 +111 (+0.1%) 🔴
octane-tsrx bindings_fw_raw 332,804 332,813 +9 (+0.0%) 🔴
octane-tsrx bindings_fw_gzip 108,437 108,453 +16 (+0.0%) 🔴
octane-tsrx bindings_fw_brotli 94,514 94,529 +15 (+0.0%) 🔴
octane-tsrx full_fw_raw 575,360 575,369 +9 (+0.0%) 🔴
octane-tsrx full_fw_brotli 146,316 146,392 +76 (+0.1%) 🔴
octane-jsx js_raw 167,048 167,055 +7 (+0.0%) 🔴
octane-jsx js_gzip 54,147 54,160 +13 (+0.0%) 🔴
octane-jsx js_brotli 47,471 47,444 −27 (−0.1%) 🟢
octane-jsx app_gzip 2,860 2,862 +2 (+0.1%) 🔴
octane-jsx fw_raw 158,769 158,776 +7 (+0.0%) 🔴
octane-jsx fw_gzip 51,287 51,298 +11 (+0.0%) 🔴
octane-jsx fw_brotli 45,061 45,034 −27 (−0.1%) 🟢
octane-jsx full_fw_raw 575,360 575,369 +9 (+0.0%) 🔴
octane-jsx full_fw_brotli 146,316 146,392 +76 (+0.1%) 🔴

10 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 82,394 82,078 −316 (−0.4%) 🟢
cli-spa-starter gzip 28,282 28,189 −93 (−0.3%) 🟢
cli-spa-starter brotli 25,192 25,082 −110 (−0.4%) 🟢
root-static-specialized raw 54,179 53,863 −316 (−0.6%) 🟢
root-static-specialized gzip 18,394 18,296 −98 (−0.5%) 🟢
root-static-specialized brotli 16,658 16,587 −71 (−0.4%) 🟢
root-chained-jsx raw 56,530 56,214 −316 (−0.6%) 🟢
root-chained-jsx gzip 19,078 18,996 −82 (−0.4%) 🟢
root-chained-jsx brotli 17,284 17,194 −90 (−0.5%) 🟢
root-static raw 148,570 148,579 +9 (+0.0%) 🔴
root-static gzip 48,192 48,198 +6 (+0.0%) 🔴
root-static brotli 42,476 42,462 −14 (−0.0%) 🟢
root-static-local raw 54,178 53,862 −316 (−0.6%) 🟢
root-static-local gzip 18,381 18,282 −99 (−0.5%) 🟢
root-static-local brotli 16,663 16,589 −74 (−0.4%) 🟢
root-callback-local raw 57,012 56,695 −317 (−0.6%) 🟢
root-callback-local gzip 19,207 19,122 −85 (−0.4%) 🟢
root-callback-local brotli 17,391 17,322 −69 (−0.4%) 🟢
hooks-state raw 64,635 64,319 −316 (−0.5%) 🟢
hooks-state gzip 21,637 21,543 −94 (−0.4%) 🟢
hooks-state brotli 19,579 19,482 −97 (−0.5%) 🟢
prop-attributes raw 61,747 61,431 −316 (−0.5%) 🟢
prop-attributes gzip 20,782 20,692 −90 (−0.4%) 🟢
prop-attributes brotli 18,839 18,771 −68 (−0.4%) 🟢
context raw 70,501 70,185 −316 (−0.4%) 🟢
context gzip 23,476 23,384 −92 (−0.4%) 🟢
context brotli 21,178 21,155 −23 (−0.1%) 🟢
hydrate-root raw 117,742 117,426 −316 (−0.3%) 🟢
hydrate-root gzip 38,347 38,224 −123 (−0.3%) 🟢
hydrate-root brotli 33,836 33,751 −85 (−0.3%) 🟢
deferred-hydration raw 199,680 199,364 −316 (−0.2%) 🟢
deferred-hydration gzip 63,610 63,509 −101 (−0.2%) 🟢
deferred-hydration brotli 55,167 55,080 −87 (−0.2%) 🟢
hydrate-frame raw 348,913 348,922 +9 (+0.0%) 🔴
hydrate-frame gzip 109,963 109,991 +28 (+0.0%) 🔴
hydrate-frame brotli 94,402 94,371 −31 (−0.0%) 🟢
suspense-transition raw 124,736 124,420 −316 (−0.3%) 🟢
suspense-transition gzip 39,961 39,882 −79 (−0.2%) 🟢
suspense-transition brotli 35,374 35,321 −53 (−0.1%) 🟢
component-owned-effects raw 56,995 56,679 −316 (−0.6%) 🟢
component-owned-effects gzip 19,247 19,156 −91 (−0.5%) 🟢
component-owned-effects brotli 17,457 17,386 −71 (−0.4%) 🟢
binding-hooks raw 67,288 66,972 −316 (−0.5%) 🟢
binding-hooks gzip 22,809 22,725 −84 (−0.4%) 🟢
binding-hooks brotli 20,652 20,554 −98 (−0.5%) 🟢
binding-base-ui-vite raw 189,755 189,764 +9 (+0.0%) 🔴
binding-base-ui-vite gzip 61,053 61,054 +1 (+0.0%) 🔴
binding-base-ui-vite brotli 53,417 53,442 +25 (+0.0%) 🔴
binding-base-ui-esbuild raw 217,047 217,056 +9 (+0.0%) 🔴
binding-base-ui-esbuild gzip 70,624 70,639 +15 (+0.0%) 🔴
binding-base-ui-esbuild brotli 61,362 61,439 +77 (+0.1%) 🔴
binding-radix-vite raw 190,117 190,126 +9 (+0.0%) 🔴
binding-radix-vite gzip 60,928 60,949 +21 (+0.0%) 🔴
binding-radix-vite brotli 53,292 53,350 +58 (+0.1%) 🔴
binding-radix-esbuild raw 217,193 217,202 +9 (+0.0%) 🔴
binding-radix-esbuild gzip 70,506 70,510 +4 (+0.0%) 🔴
binding-radix-esbuild brotli 61,261 61,229 −32 (−0.1%) 🟢
binding-mantine-hooks-vite raw 65,291 64,975 −316 (−0.5%) 🟢
binding-mantine-hooks-vite gzip 22,066 21,970 −96 (−0.4%) 🟢
binding-mantine-hooks-vite brotli 20,002 19,921 −81 (−0.4%) 🟢
binding-mantine-hooks-esbuild raw 77,190 76,736 −454 (−0.6%) 🟢
binding-mantine-hooks-esbuild gzip 26,733 26,575 −158 (−0.6%) 🟢
binding-mantine-hooks-esbuild brotli 23,936 23,836 −100 (−0.4%) 🟢
binding-apollo-client-vite raw 331,918 331,927 +9 (+0.0%) 🔴
binding-apollo-client-vite gzip 103,289 103,310 +21 (+0.0%) 🔴
binding-apollo-client-vite brotli 90,544 90,437 −107 (−0.1%) 🟢
binding-apollo-client-esbuild raw 367,219 367,228 +9 (+0.0%) 🔴
binding-apollo-client-esbuild gzip 117,031 117,047 +16 (+0.0%) 🔴
binding-apollo-client-esbuild brotli 102,147 102,282 +135 (+0.1%) 🔴
binding-usehooks-ts-vite raw 66,073 65,757 −316 (−0.5%) 🟢
binding-usehooks-ts-vite gzip 22,301 22,202 −99 (−0.4%) 🟢
binding-usehooks-ts-vite brotli 20,161 20,131 −30 (−0.1%) 🟢
binding-usehooks-ts-esbuild raw 77,964 77,510 −454 (−0.6%) 🟢
binding-usehooks-ts-esbuild gzip 26,960 26,828 −132 (−0.5%) 🟢
binding-usehooks-ts-esbuild brotli 24,157 24,064 −93 (−0.4%) 🟢

36 other measured values are unchanged.

…pture-owner-bundle

# Conflicts:
#	packages/octane/tests/optional-driver-bundle.test.ts
@trueadm

trueadm commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

The code at this head is correct, but it needs a rebase with one runtime change before it can land. The only EVENT_CAPTURE write (L30540) comes right after the installer. The CAPTURE_FINISH call (L31536) is behind the flag check (L31488).

runtime.ts conflicts with #1972, not just the test file. #1972 routes both the public delegateCaptureEvents and the compiled __delegateCaptureEvents through registerDelegatedCapture.

  • runtime.ts: take main's side, and put CAPTURE_FINISH = finishCaptureDispatch; right above type.flags |= EVENT_CAPTURE; in registerDelegatedCapture. Putting it only in delegateCaptureEvents would still pass the new createElement test. But a compiled onInputCapture/onFocusCapture would then call undefined from dispatchDelegatedCapture's finally, which skips the stopped-edit restore and, for focus/blur, the bubble queue.
  • Test file:
    • Keep both REF_DECLARATIONS and CAPTURE_DECLARATIONS, and spread all three lists into resolveDeclarationRanges.
    • Keep main's ref apps, then add LATE_CAPTURE_RESTORE_APP.
    • The plain-app absence check should stay [...OPTIONAL_DECLARATIONS, ...CAPTURE_DECLARATIONS]. PLAIN_APP renders <li ref={props.onRef}>, so the ref drains are correctly retained there.

Please add a compiled .tsrx capture case (onInputCapture) to the bundle test so the __delegateCaptureEvents path is covered. The only behavioral case today registers through createElement.

Nit: let CAPTURE_FINISH: typeof finishCaptureDispatch; has no initializer. It's safe behind the flag, but the rest of the series uses let x: typeof f = noop.

Verified:

  • There is one writer, never reset, so rollback, multiple roots and hydration replay are fine.
  • No folding is needed and no fields are added.
  • The restore test fails without the installer.
  • Bot: TSRX rows −90 B gzip. Rows that keep capture grow +9 B raw. Work counters are unchanged.

@trueadm
trueadm merged commit 4fe0867 into octanejs:main Oct 10, 2026
31 checks passed
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