Skip to content

perf: omit unused controlled commit helpers - #1963

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

trueadm merged 7 commits into
octanejs:mainfrom
openai-oss-forks:codex/controlled-commit-owner

Conversation

@domgan-oai

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

Copy link
Copy Markdown
Contributor

Summary

Keep controlled commit draining and manual-submit pending publication out of applications that do not produce that work. Install their existing implementations from the two queue producers and manual-submit transition registration, before staging or count publication. Installation is monotonic; both implementation bodies remain unchanged.

The original implementation’s matched complete rows benchmark against 4cc2a1ed falls from 32,140 to 31,706 gzip bytes with the canonical Oxc configuration (−434 bytes, −1.35%). The ordinary esbuild build also shrinks, by 463 gzip bytes.

Changes

  • Reuse noop and two stable function bindings; no new records, per-node fields, runtime calls, queue algorithms, scheduling changes, or compiler changes.
  • Preserve deferred replay, rollback, controlled select/default projection, autofocus, development diagnostics, and overlapping manual form transitions.
  • Add late/reentrant first-use regressions and production source-map absence/presence assertions in the existing owning tests; add a patch changeset.
  • Keep the staged-DOM audit’s existing read:method classification associated with the renamed publisher; no permission expansion.

Validation

Signed head d3515d240 integrates main 2075c0e72. The final integrated source passes 35 focused executions (optional-feature retention and event-registration in dev/prod, plus private entrypoint contracts), scoped formatting and sync. Independent source review preserves both parents’ tests and feature logic. Current-head CI is running; earlier evidence below qualifies its stated source.

  • Current-head CI passed at 0cf1946ed (31 checks, including full test/parity shards, typecheck, lint, browser integration and Bugbot; no actionable review threads). CI run.

  • Current-head benchmark report confirms rows −1,473 raw / −434 gzip / −351 Brotli, weather −458 gzip, Todo −312, chat −274 and JSX rows −114. All 64 work counters are unchanged; all 20 timed operations are classified within noise by the repository report. Feature-retaining growth matches the disclosed controls (+36 gzip bindings, +61 full-framework).

  • pnpm sync and scoped formatting; worktree clean.

  • Targeted tests: 332/332, 10 owning files in both dev/prod, using a scoped Vitest config with the real compiler and setup. Covers controlled selects, hydration/staging/cancel, form diagnostics/actions/reset, focus and host props.

  • Mutation checks: omitting each installation independently fails its behavioral regression; restoring eager reachability fails the negative source-map gate.

  • Existing staged-DOM scanner regression observed failing on the stale owner name, then 9/9 tests passed after the classification rename; scoped format and sync passed. Corrective head 0cf1946ed preserves runtime SHA256 02066003…2930e67 exactly from the measured f76998c artifacts.

  • Runtime-only scoped typecheck. The selected test program reports 59 unchanged existing diagnostics on both exact base and head (zero added/removed); that check is not claimed as passing.

  • Full workspace pnpm format:check, pnpm typecheck, and pnpm test were not run locally. The scoped test configuration avoids unrelated unavailable dependencies in the full workspace config; CI remains required.

  • Ordinary production work: all 64 call/DOM/direct-insertion counters match for TSRX and JSX with unchanged fixture configurations (esbuild, no framework split).

  • Active select/reprojection work: 50,710 production calls on each side, with controlled state, 512 fields, DOM identity and focus preserved.

  • Manual-submit production control: exact hook/public transition fixture, plain and counter builds, twice per fresh page. Both sides publish pending once, enter two transitions, settle twice and publish idle once; all four snapshots and render counts match.

  • perf-review: zero scan findings; independent source review clean. Queue installers add identity comparisons without calls/allocations; targets stay stable after installation. Owning timing evidence is below.

  • concise-code: runtime +13/−3; no new exports, types, records or modules. Reused producer boundaries instead of a driver record or per-node state. Keeping only one helper was smaller but left the other independently removable graph retained. Both implementation bodies compare byte-for-byte after declaration renaming.

Matched final-source size deltas against 4cc2a1ed (Node 24.20.0, whole emitted JavaScript; positive values are growth):

Build Fixture Raw Gzip Brotli
Oxc/framework split rows −1,473 −434 −351
Oxc/framework split weather −1,473 −458 −424
Oxc/framework split bindings +48 +36 −82
Oxc/framework split full API +48 +61 +60
Ordinary esbuild rows −1,697 −463 −389
Ordinary esbuild weather −1,697 −517 −398
Ordinary esbuild bindings +52 +16 +5
Ordinary esbuild full API +48 +5 −47

The feature-retaining controls make the small bundle-size growth explicit. The full-API Oxc framework-only Brotli delta is +55; the table reports total output. CI bundle reports are authoritative.

Owning timing uses unchanged fixtures and final ordinary esbuild artifacts. Each confirmed cohort has 24 fresh browser/process groups, 30 paired warmups and 12 retained paired windows per group, balanced creation/import and execution order, and interleaved identical-byte controls. Primary intervals resample the 24 group arithmetic means; they do not pool the within-group windows. All samples are retained. Browser clocks are isolated/high resolution; shared benchmark locking prevents competing runs.

Scenario Candidate/base, 95% interval Identical-byte control
Production native select, ~40 ms windows 0.99990 [0.99510, 1.00567] 0.99937 [0.99377, 1.00515]
Node 24/jsdom development diagnostics, 32,000 inputs 0.99277 [0.97171, 1.01045] 1.00280 [0.96711, 1.01687]
Node 24/jsdom development diagnostics, 4,000 inputs 0.99032 [0.97838, 1.00457] 0.99498 [0.98692, 1.01366]

Initial 200-pair single-realm runs showed positive intervals: select 1.01448 [1.00830, 1.02219], dev 32k 1.02385 [1.01344, 1.03673], dev 4k 1.01642 [1.00645, 1.03277]. They are retained here, not discarded. Independent-group confirmation addresses persistent realm/import bias; it is not proof of universal performance equivalence.

Risk / follow-ups

Performance acceptance remains open. The earlier benchmark run 38049629770 on 2dce104b3 reported JSX select_lots at +6.1% [95% interval +4.0%, +7.5%], with all 64 work/DOM counters equal. Its uploaded report contains neither the emitted JavaScript nor the raw 30-pair timing vectors, so the cause remains unconfirmed. The existing controlled-form selection follow-up exercises a different operation and does not resolve this row-selection observation. Green checks alone do not establish performance parity.

No slowdown was detected in the independent-group fixtures (upper confidence bounds: select +0.57%, dev 32k +1.04%, dev 4k +0.46%); their confidence bounds and the initial positive observations are reported above. These are owning-path measurements, not user-visible latency claims. Current-head CI is green and there are no actionable review threads. Maintainer approval is still required; this PR is unmerged.

Provenance

  • An agent produced this diff (agent-authored)

Origin: Codex task, host com-79386. Implementation: codex/controlled-commit-owner in the dedicated controlled-commit-owner/octane worktree.


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
Touches core form commit, autofocus, and manual-submit/useFormStatus timing; mitigated by extensive regressions and unchanged implementation bodies after install.

Overview
Lazy-installs controlled commit draining and manual-submit pending publication so production bundles that never queue deferred form work or entangle submit with transitions can drop those helpers (~400+ gzip bytes on typical apps).

drainControlledSyncs and publishManualFormPending start as stable noop bindings and wire to drainQueuedControlledSyncs / publishRegisteredManualFormPending on first use (controlled/dev-form queues or a transition during active submit dispatch). Installation is one-way; behavior for late-first use (select defaults, autofocus, dev diagnostics, overlapping useFormStatus transitions) is covered by new bundle and conformance tests. Staged-DOM audit and a comment in dom-stage.ts follow the publisher rename.

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

# Conflicts:
#	packages/octane/src/runtime.ts
#	packages/octane/tests/optional-driver-bundle.test.ts
@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 01:51
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 14 value(s) increased
  • 🔴 bundle-reachability: 16 value(s) increased

Compares 2075c0e72, the merge commit's first parent with 659ccad0f 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.633 2.617 ±0.0% −3.8% … +0.0% ⚪ within noise
octane-tsrx replace 5.783 5.767 +0.9% −5.0% … +6.2% ⚪ within noise
octane-tsrx add 2.417 2.417 ±0.0% −1.9% … +4.2% ⚪ within noise
octane-tsrx update 0.118 0.120 +1.7% +0.3% … +2.2% ⚪ within noise
octane-tsrx select 0.005 0.005 ±0.0% −1.0% … +0.5% ⚪ within noise
octane-tsrx swap 0.016 0.016 ±0.0% −0.8% … +1.1% ⚪ within noise
octane-tsrx remove 0.014 0.014 −1.4% −3.0% … +4.1% ⚪ within noise
octane-tsrx runlots 23.658 23.558 −0.8% −2.5% … ±0.0% ⚪ within noise
octane-tsrx select_lots 0.006 0.006 −0.6% −0.6% … +1.2% ⚪ within noise
octane-tsrx clear 40.425 40.817 −0.4% −3.1% … +1.1% ⚪ within noise
octane-jsx run 3.300 3.325 ±0.0% −2.7% … +2.6% ⚪ within noise
octane-jsx replace 5.992 6.450 +0.1% −1.7% … +4.9% ⚪ within noise
octane-jsx add 3.083 3.083 −0.0% −3.1% … +1.6% ⚪ within noise
octane-jsx update 0.248 0.242 −0.6% −1.7% … ±0.0% ⚪ within noise
octane-jsx select 0.127 0.126 +0.5% −0.0% … +1.0% ⚪ within noise
octane-jsx swap 0.170 0.171 +0.8% +0.2% … +1.8% ⚪ within noise
octane-jsx remove 0.162 0.164 −0.0% −1.3% … +1.1% ⚪ within noise
octane-jsx runlots 26.408 27.125 +1.3% −0.6% … +4.0% ⚪ within noise
octane-jsx select_lots 1.419 1.435 +1.2% +0.3% … +1.8% ⚪ within noise
octane-jsx clear 43.450 43.758 +0.9% −1.2% … +2.7% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 93,101 91,628 −1,473 (−1.6%) 🟢
octane-tsrx js_gzip 30,804 30,339 −465 (−1.5%) 🟢
octane-tsrx js_brotli 27,543 27,122 −421 (−1.5%) 🟢
octane-tsrx app_gzip 2,336 2,335 −1 (−0.0%) 🟢
octane-tsrx fw_raw 86,147 84,674 −1,473 (−1.7%) 🟢
octane-tsrx fw_gzip 28,468 28,004 −464 (−1.6%) 🟢
octane-tsrx fw_brotli 25,504 25,083 −421 (−1.7%) 🟢
octane-tsrx todo_js_raw 104,060 103,183 −877 (−0.8%) 🟢
octane-tsrx todo_js_gzip 34,902 34,604 −298 (−0.9%) 🟢
octane-tsrx todo_js_brotli 30,959 30,753 −206 (−0.7%) 🟢
octane-tsrx todo_app_brotli 1,899 1,902 +3 (+0.2%) 🔴
octane-tsrx todo_fw_raw 99,419 98,542 −877 (−0.9%) 🟢
octane-tsrx todo_fw_gzip 32,665 32,367 −298 (−0.9%) 🟢
octane-tsrx todo_fw_brotli 29,060 28,851 −209 (−0.7%) 🟢
octane-tsrx chat_js_raw 103,400 102,523 −877 (−0.8%) 🟢
octane-tsrx chat_js_gzip 34,798 34,515 −283 (−0.8%) 🟢
octane-tsrx chat_js_brotli 31,038 30,763 −275 (−0.9%) 🟢
octane-tsrx chat_app_gzip 2,726 2,724 −2 (−0.1%) 🟢
octane-tsrx chat_app_brotli 2,389 2,387 −2 (−0.1%) 🟢
octane-tsrx chat_fw_raw 97,617 96,740 −877 (−0.9%) 🟢
octane-tsrx chat_fw_gzip 32,072 31,791 −281 (−0.9%) 🟢
octane-tsrx chat_fw_brotli 28,649 28,376 −273 (−1.0%) 🟢
octane-tsrx weather_js_raw 140,049 138,576 −1,473 (−1.1%) 🟢
octane-tsrx weather_js_gzip 46,297 45,822 −475 (−1.0%) 🟢
octane-tsrx weather_js_brotli 40,761 40,386 −375 (−0.9%) 🟢
octane-tsrx weather_app_brotli 6,650 6,656 +6 (+0.1%) 🔴
octane-tsrx weather_fw_raw 117,875 116,402 −1,473 (−1.2%) 🟢
octane-tsrx weather_fw_gzip 38,440 37,965 −475 (−1.2%) 🟢
octane-tsrx weather_fw_brotli 34,111 33,730 −381 (−1.1%) 🟢
octane-tsrx bindings_js_raw 678,716 678,761 +45 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 223,483 223,518 +35 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 190,143 190,320 +177 (+0.1%) 🔴
octane-tsrx bindings_app_gzip 115,670 115,671 +1 (+0.0%) 🔴
octane-tsrx bindings_app_brotli 96,179 96,277 +98 (+0.1%) 🔴
octane-tsrx bindings_fw_raw 330,974 331,019 +45 (+0.0%) 🔴
octane-tsrx bindings_fw_gzip 107,813 107,847 +34 (+0.0%) 🔴
octane-tsrx bindings_fw_brotli 93,964 94,043 +79 (+0.1%) 🔴
octane-tsrx full_fw_raw 573,435 573,483 +48 (+0.0%) 🔴
octane-tsrx full_fw_gzip 173,260 173,250 −10 (−0.0%) 🟢
octane-tsrx full_fw_brotli 145,807 145,732 −75 (−0.1%) 🟢
octane-jsx js_raw 168,668 168,274 −394 (−0.2%) 🟢
octane-jsx js_gzip 54,615 54,502 −113 (−0.2%) 🟢
octane-jsx js_brotli 47,904 47,745 −159 (−0.3%) 🟢
octane-jsx app_gzip 2,860 2,861 +1 (+0.0%) 🔴
octane-jsx app_brotli 2,411 2,415 +4 (+0.2%) 🔴
octane-jsx fw_raw 160,389 159,995 −394 (−0.2%) 🟢
octane-jsx fw_gzip 51,755 51,641 −114 (−0.2%) 🟢
octane-jsx fw_brotli 45,493 45,330 −163 (−0.4%) 🟢
octane-jsx full_fw_raw 573,435 573,483 +48 (+0.0%) 🔴
octane-jsx full_fw_gzip 173,260 173,250 −10 (−0.0%) 🟢
octane-jsx full_fw_brotli 145,807 145,732 −75 (−0.1%) 🟢

9 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 84,713 83,240 −1,473 (−1.7%) 🟢
cli-spa-starter gzip 28,971 28,522 −449 (−1.5%) 🟢
cli-spa-starter brotli 25,788 25,336 −452 (−1.8%) 🟢
root-static-specialized raw 56,498 55,024 −1,474 (−2.6%) 🟢
root-static-specialized gzip 19,075 18,615 −460 (−2.4%) 🟢
root-static-specialized brotli 17,280 16,867 −413 (−2.4%) 🟢
root-chained-jsx raw 58,849 57,377 −1,472 (−2.5%) 🟢
root-chained-jsx gzip 19,758 19,317 −441 (−2.2%) 🟢
root-chained-jsx brotli 17,892 17,497 −395 (−2.2%) 🟢
root-static raw 148,414 148,020 −394 (−0.3%) 🟢
root-static gzip 48,068 47,960 −108 (−0.2%) 🟢
root-static brotli 42,384 42,237 −147 (−0.3%) 🟢
root-static-local raw 56,497 55,023 −1,474 (−2.6%) 🟢
root-static-local gzip 19,060 18,601 −459 (−2.4%) 🟢
root-static-local brotli 17,284 16,867 −417 (−2.4%) 🟢
root-callback-local raw 59,310 57,836 −1,474 (−2.5%) 🟢
root-callback-local gzip 19,879 19,424 −455 (−2.3%) 🟢
root-callback-local brotli 17,999 17,591 −408 (−2.3%) 🟢
hooks-state raw 68,645 67,172 −1,473 (−2.1%) 🟢
hooks-state gzip 22,808 22,353 −455 (−2.0%) 🟢
hooks-state brotli 20,663 20,204 −459 (−2.2%) 🟢
prop-attributes raw 65,845 64,372 −1,473 (−2.2%) 🟢
prop-attributes gzip 21,977 21,534 −443 (−2.0%) 🟢
prop-attributes brotli 19,874 19,465 −409 (−2.1%) 🟢
context raw 74,809 73,336 −1,473 (−2.0%) 🟢
context gzip 24,821 24,353 −468 (−1.9%) 🟢
context brotli 22,339 21,905 −434 (−1.9%) 🟢
hydrate-root raw 120,061 118,588 −1,473 (−1.2%) 🟢
hydrate-root gzip 39,092 38,587 −505 (−1.3%) 🟢
hydrate-root brotli 34,423 34,041 −382 (−1.1%) 🟢
deferred-hydration raw 203,579 202,106 −1,473 (−0.7%) 🟢
deferred-hydration gzip 64,858 64,359 −499 (−0.8%) 🟢
deferred-hydration brotli 56,193 55,759 −434 (−0.8%) 🟢
hydrate-frame raw 350,551 350,160 −391 (−0.1%) 🟢
hydrate-frame gzip 110,455 110,311 −144 (−0.1%) 🟢
hydrate-frame brotli 94,750 94,620 −130 (−0.1%) 🟢
suspense-transition raw 125,755 125,320 −435 (−0.3%) 🟢
suspense-transition gzip 40,188 40,070 −118 (−0.3%) 🟢
suspense-transition brotli 35,602 35,518 −84 (−0.2%) 🟢
component-owned-effects raw 59,314 57,841 −1,473 (−2.5%) 🟢
component-owned-effects gzip 19,926 19,481 −445 (−2.2%) 🟢
component-owned-effects brotli 18,077 17,714 −363 (−2.0%) 🟢
binding-hooks raw 69,227 67,754 −1,473 (−2.1%) 🟢
binding-hooks gzip 23,361 22,910 −451 (−1.9%) 🟢
binding-hooks brotli 21,152 20,742 −410 (−1.9%) 🟢
binding-base-ui-vite raw 187,433 187,477 +44 (+0.0%) 🔴
binding-base-ui-vite gzip 60,219 60,258 +39 (+0.1%) 🔴
binding-base-ui-vite brotli 52,730 52,697 −33 (−0.1%) 🟢
binding-base-ui-esbuild raw 214,755 214,803 +48 (+0.0%) 🔴
binding-base-ui-esbuild gzip 69,843 69,859 +16 (+0.0%) 🔴
binding-base-ui-esbuild brotli 60,731 60,754 +23 (+0.0%) 🔴
binding-radix-vite raw 187,795 187,841 +46 (+0.0%) 🔴
binding-radix-vite gzip 60,140 60,191 +51 (+0.1%) 🔴
binding-radix-vite brotli 52,625 52,643 +18 (+0.0%) 🔴
binding-radix-esbuild raw 214,901 214,949 +48 (+0.0%) 🔴
binding-radix-esbuild gzip 69,756 69,782 +26 (+0.0%) 🔴
binding-radix-esbuild brotli 60,588 60,719 +131 (+0.2%) 🔴
binding-mantine-hooks-vite raw 69,389 67,916 −1,473 (−2.1%) 🟢
binding-mantine-hooks-vite gzip 23,280 22,823 −457 (−2.0%) 🟢
binding-mantine-hooks-vite brotli 21,008 20,645 −363 (−1.7%) 🟢
binding-mantine-hooks-esbuild raw 81,340 79,675 −1,665 (−2.0%) 🟢
binding-mantine-hooks-esbuild gzip 27,971 27,480 −491 (−1.8%) 🟢
binding-mantine-hooks-esbuild brotli 24,996 24,648 −348 (−1.4%) 🟢
binding-apollo-client-vite raw 329,588 329,634 +46 (+0.0%) 🔴
binding-apollo-client-vite gzip 102,485 102,517 +32 (+0.0%) 🔴
binding-apollo-client-vite brotli 89,868 89,878 +10 (+0.0%) 🔴
binding-apollo-client-esbuild raw 364,926 364,974 +48 (+0.0%) 🔴
binding-apollo-client-esbuild gzip 116,241 116,256 +15 (+0.0%) 🔴
binding-apollo-client-esbuild brotli 101,512 101,463 −49 (−0.0%) 🟢
binding-usehooks-ts-vite raw 70,171 68,698 −1,473 (−2.1%) 🟢
binding-usehooks-ts-vite gzip 23,532 23,048 −484 (−2.1%) 🟢
binding-usehooks-ts-vite brotli 21,293 20,878 −415 (−1.9%) 🟢
binding-usehooks-ts-esbuild raw 82,114 80,449 −1,665 (−2.0%) 🟢
binding-usehooks-ts-esbuild gzip 28,216 27,720 −496 (−1.8%) 🟢
binding-usehooks-ts-esbuild brotli 25,282 24,875 −407 (−1.6%) 🟢

36 other measured values are unchanged.

@trueadm

trueadm commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Good to go, with one optional nit. Neither gated helper can be noop at a point where it would have done work, so behavior is unchanged.

Optional nit: the comment at dom-stage.ts#L27 still names handleFormSubmit/publishManualFormPending as the $$pendingSubmits writer. check-staged-dom.mjs now points at publishRegisteredManualFormPending, but the comment wasn't updated.

Merge note: the optional-driver-bundle.test.ts conflicts with #1964, #1966, #1969 and #1970 come from sibling *_DECLARATIONS arrays edited on the same lines. Keep every array and spread all of them into both the ranges map and the plain-app absence assertion.

Verified:

  • No SSR, compiler, binding or dom-stage code references either helper, and hydration-adopted controls still return before queueing.
  • Install is monotonic and survives journal rollback. The late-select, cross-root autofocus, late manual submit and resetModules dev-conformance tests each fail without their installer.
  • The change reuses the existing noop-installer pattern, adds no fields, and perf-review-scan is clean.
  • The bot report matches the claimed savings: rows −434 B gzip, weather −458 B, todo −312 B. Growth appears only where the features are kept (+48 B raw), and all 64 work counters are unchanged.
  • The early single-realm timing slowdowns (+1.4–2.4%) disappeared under independent groups. The only new hot-path work is one identity compare per queue push, which can't plausibly cost that much, so a measurement artifact is the likelier explanation.
  • No semantic overlap with fix: restore controlled inputs after deferred replay drains #1968. It changes the event-restore queue, not these commit queues, and the two merge cleanly.

@domgan-oai

domgan-oai commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Updated the dom-stage.ts writer comment to publishRegisteredManualFormPending in 6ab51e4. This is a comment-only correction; sync and scoped formatting pass. The signed base integration is 2dce104; all 30 current-head checks pass.

@trueadm
trueadm merged commit a03d79d into octanejs:main Oct 10, 2026
31 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 10, 2026
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