Skip to content

perf(octane): ship the host descriptor renderer only where host descriptors exist - #2249

Merged
domgan-oai merged 4 commits into
octanejs:mainfrom
openai-oss-forks:codex/pr-2247-descriptor-conflicts
Oct 27, 2026
Merged

domgan-oai merged 4 commits into
octanejs:mainfrom
openai-oss-forks:codex/pr-2247-descriptor-conflicts

Conversation

@domgan-oai

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

Copy link
Copy Markdown
Contributor

Summary

This fork-based replacement for #2247 preserves its commits and merges main at fcb02246d. Applications that can create host element descriptors install the renderer. Applications that use only renderable holes over text, arrays, components, and compiled children can drop it.

The conflict resolution keeps #2246’s memo and context handling alongside the host renderer. The descriptor-children bundle must retain both the implicit bailout and the host renderer. The renderable-holes bundle must retain the shared list path and drop the host renderer. The renderer diff against main has the same 16 files as #2247.

The website integration job also caught an existing nested paragraph on the Signals guide. The opening sentence now uses the same MDX string expression as the neighboring guides, so the browser can hydrate it as a single paragraph. A route smoke assertion catches nested paragraphs independently of hydration timing.

Validation

  • pnpm sync produced no generated changes.
  • Scoped Prettier checks on the three conflicted files and the two website files, plus git diff --check.
  • pnpm exec octane-tsc -p packages/octane/tsconfig.json.
  • Focused Vitest run with the octane and octane-prod projects. All 1,037 tests passed across 18 test-file runs, covering descriptors, host upgrades, context, memo, Strong-mode compilation, and the universal renderer.
  • Six production bundle scenarios passed their semantic and reachability checks for renderable-holes, descriptor-children, memo-context, context, controlled-input, and hydrate-frame.
  • node scripts/split-runtime.mjs check found zero violations across 34 modules.
  • All 30 website route smoke tests and all 105 tests in the local website integration job passed, including the Chromium hydration check for /docs/signals. The smoke assertion caught the nested paragraph before the MDX fix.
  • Full CI on ea476e160 passed, including repository-wide formatting, typecheck, four Node test shards, four React parity shards, and Chromium integration. CI run
  • The benchmark passed with all 64 runtime work counters unchanged. The TSRX shell shrank by 3,685 gzip bytes and the descriptor-children fixture grew by 135 gzip bytes. Benchmark report

Risk / follow-ups

The full example size comparisons are from #2247. Local validation on this merged head measured the six bundle fixtures above.

Provenance

  • An agent produced this diff (agent-authored)

Conflict resolution by Codex task on host com-79386.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Note

Medium Risk
Changes core child-slot and de-opt reconciliation routing plus compiler capability detection; incorrect tree-shaking or tag classification could break host DOM updates or dynamic tags.

Overview
Makes the host element descriptor renderer optional at bundle time so client JavaScript only retains reconcileDeoptHost, hostElementBody, generic host prop writers, and related de-opt paths when something in the app can actually create a host descriptor.

The compiler now emits an enableHostDescriptors capability when JSX cannot prove a function component (dynamic tags); static host factories and createHostElement still install the driver at runtime. HOST_DESCRIPTORS in drivers.ts centralizes host reconcile/adopt/upgrade hooks, and childSlot / deoptItemBody branch on that driver instead of always pulling host code through shared reconcileDeoptNode. Module function components are classified like lazy components for codegen (componentSlotFunction), avoiding the generic componentSlot dynamic-tag path.

Benchmarks add a renderable-holes scenario that must drop the host renderer while keeping list/child-slot paths; descriptor-children must still retain it. Tests cover host capability install sites and updated slot codegen expectations.

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

trueadm and others added 3 commits October 26, 2026 21:30
…iptors exist

Renderable holes statically reached the whole runtime host descriptor renderer
(deopt.ts host bodies, keyed host reconcile, adoption, records) and through it
the generic setHostProps/attribute/style and controlled-form writers, so every
.tsrx app shipped them even when nothing built a host element descriptor.

- runtime/drivers.ts: HOST_DESCRIPTORS driver, named only by
  enableHostDescriptors, so bundler tree-shaking drops the renderer and oxc
  folds the guards. childSlot and deoptItemBody read it once, on host values.
- deopt.ts: reconcileDeoptNode keeps text; reconcileDeoptHost takes host
  descriptors; text and host commit orders get their own ops.
- Host factories install it (createHostElement, scoped element records, public
  factories); createElementFromConfig no longer does, and compiled JSX
  installs it per module only when a value-position tag may be a host string.
- componentSlot's dynamic host tag renders through hostStringTagBody without
  the driver, so it no longer installs it.
- Compiler: module function declarations that are never reassigned call
  componentSlotFunction instead of the generic dynamic-tag entry.
- bundle-size: renderable-holes scenario gates that a pure .tsrx app drops
  the renderer; descriptor-children keeps it as the control.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep the host descriptor and memo bail drivers independently installable. Combine their bundle checks so descriptor children retain both the host renderer and the implicit bailout, while renderable holes still drop the renderer.
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent perf PR: performance work labels Oct 27, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review October 27, 2026 13:06
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 48 value(s) increased
  • 🔴 bundle-reachability: 32 value(s) increased

Compares fcb02246d, the merge commit's first parent with d6953ac64 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 4.292 3.717 +6.1% −9.1% … +13.8% ⚪ within noise
octane-tsrx replace 9.950 9.742 +6.4% −5.6% … +20.8% ⚪ within noise
octane-tsrx add 3.517 3.567 +2.6% −14.6% … +14.6% ⚪ within noise
octane-tsrx update 0.126 0.128 −4.5% −11.5% … +4.4% ⚪ within noise
octane-tsrx select 0.010 0.011 +3.9% −1.9% … +12.7% ⚪ within noise
octane-tsrx swap 0.030 0.032 +4.0% −8.1% … +10.4% ⚪ within noise
octane-tsrx remove 0.029 0.028 +1.2% −4.3% … +11.6% ⚪ within noise
octane-tsrx runlots 44.725 42.450 +0.6% −6.8% … +8.8% ⚪ within noise
octane-tsrx select_lots 0.010 0.009 +1.6% −8.1% … +8.7% ⚪ within noise
octane-tsrx clear 64.817 67.950 +2.6% −1.4% … +6.4% ⚪ within noise
octane-jsx run 3.892 3.883 −2.8% −10.0% … +1.2% ⚪ within noise
octane-jsx replace 7.242 7.383 +0.6% −4.1% … +2.7% ⚪ within noise
octane-jsx add 2.850 2.833 ±0.0% −3.2% … +3.3% ⚪ within noise
octane-jsx update 0.177 0.184 +3.5% +2.1% … +5.9% ⚪ within noise
octane-jsx select 0.090 0.094 +3.1% −1.6% … +9.0% ⚪ within noise
octane-jsx swap 0.129 0.129 −0.9% −3.2% … +1.1% ⚪ within noise
octane-jsx remove 0.124 0.130 +1.2% −2.0% … +2.0% ⚪ within noise
octane-jsx runlots 28.258 27.042 +1.0% −3.9% … +7.0% ⚪ within noise
octane-jsx select_lots 0.897 0.929 +1.3% −0.4% … +4.8% ⚪ within noise
octane-jsx clear 47.583 47.367 +1.8% −0.2% … +3.3% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx bindings_js_raw 691,924 692,458 +534 (+0.1%) 🔴
octane-tsrx bindings_js_gzip 229,316 229,452 +136 (+0.1%) 🔴
octane-tsrx bindings_js_brotli 195,264 195,294 +30 (+0.0%) 🔴
octane-tsrx bindings_app_raw 357,769 357,944 +175 (+0.0%) 🔴
octane-tsrx bindings_app_gzip 118,629 118,654 +25 (+0.0%) 🔴
octane-tsrx bindings_app_brotli 98,536 98,470 −66 (−0.1%) 🟢
octane-tsrx bindings_fw_raw 334,155 334,514 +359 (+0.1%) 🔴
octane-tsrx bindings_fw_gzip 110,687 110,798 +111 (+0.1%) 🔴
octane-tsrx bindings_fw_brotli 96,728 96,824 +96 (+0.1%) 🔴
octane-tsrx shell_js_raw 305,381 293,902 −11,479 (−3.8%) 🟢
octane-tsrx shell_js_gzip 99,521 95,836 −3,685 (−3.7%) 🟢
octane-tsrx shell_js_brotli 86,693 83,434 −3,259 (−3.8%) 🟢
octane-tsrx shell_app_brotli 1,006 1,013 +7 (+0.7%) 🔴
octane-tsrx shell_fw_raw 303,482 292,003 −11,479 (−3.8%) 🟢
octane-tsrx shell_fw_gzip 98,369 94,684 −3,685 (−3.7%) 🟢
octane-tsrx shell_fw_brotli 85,687 82,421 −3,266 (−3.8%) 🟢
octane-tsrx shell_client_js_raw 249,202 238,623 −10,579 (−4.2%) 🟢
octane-tsrx shell_client_js_gzip 80,959 77,525 −3,434 (−4.2%) 🟢
octane-tsrx shell_client_js_brotli 71,082 68,092 −2,990 (−4.2%) 🟢
octane-tsrx shell_client_app_gzip 1,155 1,159 +4 (+0.3%) 🔴
octane-tsrx shell_client_app_brotli 1,012 1,014 +2 (+0.2%) 🔴
octane-tsrx shell_client_fw_raw 247,295 236,716 −10,579 (−4.3%) 🟢
octane-tsrx shell_client_fw_gzip 79,804 76,366 −3,438 (−4.3%) 🟢
octane-tsrx shell_client_fw_brotli 70,070 67,078 −2,992 (−4.3%) 🟢
octane-tsrx wayfinder_js_raw 371,377 363,393 −7,984 (−2.1%) 🟢
octane-tsrx wayfinder_js_gzip 122,054 119,622 −2,432 (−2.0%) 🟢
octane-tsrx wayfinder_js_brotli 105,716 103,679 −2,037 (−1.9%) 🟢
octane-tsrx pagecraft_oxc_js_raw 547,161 547,521 +360 (+0.1%) 🔴
octane-tsrx pagecraft_oxc_js_gzip 172,278 172,375 +97 (+0.1%) 🔴
octane-tsrx pagecraft_oxc_js_brotli 146,419 146,434 +15 (+0.0%) 🔴
octane-tsrx pagecraft_esbuild_js_raw 581,325 581,682 +357 (+0.1%) 🔴
octane-tsrx pagecraft_esbuild_js_gzip 188,361 188,505 +144 (+0.1%) 🔴
octane-tsrx pagecraft_esbuild_js_brotli 160,125 160,265 +140 (+0.1%) 🔴
octane-tsrx full_fw_raw 535,612 535,984 +372 (+0.1%) 🔴
octane-tsrx full_fw_gzip 167,815 168,031 +216 (+0.1%) 🔴
octane-tsrx full_fw_brotli 142,726 142,810 +84 (+0.1%) 🔴
octane-jsx js_raw 162,270 162,640 +370 (+0.2%) 🔴
octane-jsx js_gzip 53,132 53,287 +155 (+0.3%) 🔴
octane-jsx js_brotli 46,934 47,180 +246 (+0.5%) 🔴
octane-jsx app_brotli 2,878 2,902 +24 (+0.8%) 🔴
octane-jsx fw_raw 151,470 151,840 +370 (+0.2%) 🔴
octane-jsx fw_gzip 49,620 49,775 +155 (+0.3%) 🔴
octane-jsx fw_brotli 44,056 44,278 +222 (+0.5%) 🔴
octane-jsx shell_js_raw 337,657 338,067 +410 (+0.1%) 🔴
octane-jsx shell_js_gzip 110,078 110,225 +147 (+0.1%) 🔴
octane-jsx shell_js_brotli 95,690 95,723 +33 (+0.0%) 🔴
octane-jsx shell_app_raw 1,089 1,103 +14 (+1.3%) 🔴
octane-jsx shell_app_gzip 761 773 +12 (+1.6%) 🔴
octane-jsx shell_app_brotli 653 667 +14 (+2.1%) 🔴
octane-jsx shell_fw_raw 336,568 336,964 +396 (+0.1%) 🔴
octane-jsx shell_fw_gzip 109,317 109,452 +135 (+0.1%) 🔴
octane-jsx shell_fw_brotli 95,037 95,056 +19 (+0.0%) 🔴
octane-jsx shell_client_js_raw 282,403 282,794 +391 (+0.1%) 🔴
octane-jsx shell_client_js_gzip 91,444 91,590 +146 (+0.2%) 🔴
octane-jsx shell_client_js_brotli 80,077 80,231 +154 (+0.2%) 🔴
octane-jsx shell_client_app_raw 1,097 1,111 +14 (+1.3%) 🔴
octane-jsx shell_client_app_gzip 766 771 +5 (+0.7%) 🔴
octane-jsx shell_client_app_brotli 660 675 +15 (+2.3%) 🔴
octane-jsx shell_client_fw_raw 281,306 281,683 +377 (+0.1%) 🔴
octane-jsx shell_client_fw_gzip 90,678 90,819 +141 (+0.2%) 🔴
octane-jsx shell_client_fw_brotli 79,417 79,556 +139 (+0.2%) 🔴
octane-jsx full_fw_raw 535,612 535,984 +372 (+0.1%) 🔴
octane-jsx full_fw_gzip 167,815 168,031 +216 (+0.1%) 🔴
octane-jsx full_fw_brotli 142,726 142,810 +84 (+0.1%) 🔴

47 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
root-static raw 105,327 93,125 −12,202 (−11.6%) 🟢
root-static gzip 34,642 30,725 −3,917 (−11.3%) 🟢
root-static brotli 31,177 27,613 −3,564 (−11.4%) 🟢
memo-context raw 149,817 141,138 −8,679 (−5.8%) 🟢
memo-context gzip 49,106 46,523 −2,583 (−5.3%) 🟢
memo-context brotli 43,703 41,404 −2,299 (−5.3%) 🟢
hydrate-frame raw 344,068 344,428 +360 (+0.1%) 🔴
hydrate-frame gzip 110,694 110,810 +116 (+0.1%) 🔴
hydrate-frame brotli 96,225 96,345 +120 (+0.1%) 🔴
descriptor-children raw 157,439 157,799 +360 (+0.2%) 🔴
descriptor-children gzip 51,375 51,510 +135 (+0.3%) 🔴
descriptor-children brotli 45,758 45,767 +9 (+0.0%) 🔴
renderable-holes raw – 100,285 – 🆕
renderable-holes gzip – 33,002 – 🆕
renderable-holes brotli – 29,709 – 🆕
split-shell raw 395,511 395,894 +383 (+0.1%) 🔴
split-shell gzip 128,969 129,122 +153 (+0.1%) 🔴
split-shell brotli 112,475 112,554 +79 (+0.1%) 🔴
split-shell-runtime raw 322,981 323,364 +383 (+0.1%) 🔴
split-shell-runtime gzip 104,026 104,172 +146 (+0.1%) 🔴
split-shell-runtime brotli 89,977 90,047 +70 (+0.1%) 🔴
binding-base-ui-vite raw 170,180 170,542 +362 (+0.2%) 🔴
binding-base-ui-vite gzip 55,674 55,835 +161 (+0.3%) 🔴
binding-base-ui-vite brotli 49,361 49,597 +236 (+0.5%) 🔴
binding-base-ui-esbuild raw 199,355 199,733 +378 (+0.2%) 🔴
binding-base-ui-esbuild gzip 67,114 67,256 +142 (+0.2%) 🔴
binding-base-ui-esbuild brotli 59,408 59,559 +151 (+0.3%) 🔴
binding-aria-esbuild gzip 2,954 2,955 +1 (+0.0%) 🔴
binding-aria-esbuild brotli 2,646 2,648 +2 (+0.1%) 🔴
binding-radix-vite raw 167,427 167,787 +360 (+0.2%) 🔴
binding-radix-vite gzip 54,634 54,780 +146 (+0.3%) 🔴
binding-radix-vite brotli 48,509 48,675 +166 (+0.3%) 🔴
binding-radix-esbuild raw 196,881 197,250 +369 (+0.2%) 🔴
binding-radix-esbuild gzip 66,206 66,350 +144 (+0.2%) 🔴
binding-radix-esbuild brotli 58,538 58,692 +154 (+0.3%) 🔴
binding-apollo-client-vite raw 316,554 316,891 +337 (+0.1%) 🔴
binding-apollo-client-vite gzip 99,061 99,180 +119 (+0.1%) 🔴
binding-apollo-client-vite brotli 87,691 87,772 +81 (+0.1%) 🔴
binding-apollo-client-esbuild raw 353,422 353,765 +343 (+0.1%) 🔴
binding-apollo-client-esbuild gzip 114,755 114,909 +154 (+0.1%) 🔴
binding-apollo-client-esbuild brotli 101,224 101,310 +86 (+0.1%) 🔴
binding-usehooks-ts-esbuild brotli 25,653 25,645 −8 (−0.0%) 🟢

96 other measured values are unchanged.

MDX treats bare prose in this multiline paragraph as another paragraph. Use the same string expression as the other guides and cover the rendered structure in the route smoke test.
@domgan-oai
domgan-oai merged commit 10b10ad into octanejs:main Oct 27, 2026
31 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 27, 2026
trueadm added a commit that referenced this pull request Oct 28, 2026
…tely (#2255)

#2249 reached the host renderer through one HOST_DESCRIPTORS object. Apps
that install the renderer reach all seven of its fields, and a minifier keeps
every property name in full: the object literal plus about 14 hostDriver.x
reads at call sites.

Make each entry point its own module binding, set together by
enableHostDescriptors. HOST_BODY is set exactly when the renderer is
installed, so it serves as the installed check, and callers keep the guard
shapes that fold away in a bundle that never installs it. An early return
keeps repeat installs from the public factories to one check, as ??= did.

Against main d44d6d9: js-framework octane-jsx −99 raw / −28 gzip,
descriptor-children −99 raw / −80 gzip, renderable-holes −3 raw / −5 gzip.
Both reachability gates pass.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Dominic Gannaway <[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