Skip to content

feat: compile Strong named render blocks without descriptors - #2068

Merged
domgan-oai merged 3 commits into
octanejs:mainfrom
openai-oss-forks:feat/strong-render-values-2066
Oct 14, 2026
Merged

domgan-oai merged 3 commits into
octanejs:mainfrom
openai-oss-forks:feat/strong-render-values-2066

Conversation

@domgan-oai

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

Copy link
Copy Markdown
Contributor

Summary

Strong DOM templates now compile direct named props such as content={@{ <span>{props.label as string}</span> }} into marked render bodies without an authored arrow or element descriptor. Ordinary JSX and blocks in other value positions retain their descriptor contract. Closes #2066.

The compiler reuses children-body lowering, retains simple own-data capture dependencies with the existing guarded dependency probe, and declines outer memoization for setup, conditional reads, or deeper paths. Accessors remain unread until insertion. Existing reconciliation now distinguishes changed captures from different authored bodies, including descriptor, hostComponent, and dynamic-host forwarding. Markerless dynamic hosts use the existing whole-range rollback machinery.

Validation

  • Current head ba7005865f7b59345c348af75e3c3bbd22f7ca96: CI 27/27 jobs passed; PR benchmarks passed; Bugbot passed with no issues. Both earlier review threads are resolved.
  • Full pnpm format:check, pnpm typecheck, and pnpm test were not completed successfully locally; scoped alternatives and limits are below.
  • MCP benchmark catalog checks: 26/26. The new suite is registered in both the unified runner and the public MCP tool schema.
  • Final scoped formatting, typechecking, and git diff --check pass. All commands from the pnpm sync script completed; no generated diff remained.
  • 88 new behavior cases plus automatic-memoization suites: 526/526. Covers client/SSR/hydration, descriptor inspection, callback distinction, deferred setup/getters, capture updates, context/state/effects, repeated insertion, branch/type/key identity, suspended and failed replacement, multi-root rollback, SVG, and scoped styles.
  • Transparent as, satisfies, and non-null wrappers retain the direct-block contract in client and server output. Regression coverage verifies hidden getters stay deferred and updates retain DOM identity; pinned 2b08f813 fails classification and eagerly reads the hidden client getter. The wrapper fix leaves all six measured complete app assets and three executable microbenchmark bundles byte-identical.
  • Adjacent context-promotion, host-component, behavior-root, and hydration-diagnostic suites: 758/758. Earlier children-block/memo/hydration suites: 574/574.
  • Negative controls: pinned upstream reproduces descriptor output; removing scope guards throws on body-local or guarded reads; the new hidden-getter/deep-null cases fail in production before the guarded-probe fix. The durable render-value ratios fail on upstream and pass 3/3 on this head; runner tests pass 7/7.
  • perf-review: exact-base scan reports zero candidates. Hot paths: sameRenderBody (runtime.ts:16680), hostComponent (runtime.ts:36843), renderHostTagChildren (runtime.ts:38511), and childSlot (runtime.ts:39571). Shapes remain fixed, allocation changes are measured below, and there are no new scheduling hops or layout reads. Compiler capture emission (compiler/compile.js:34923) reuses guarded reflection; no new runtime type or Block/Scope field. Production shape probes retain one map per record family; the host record shrinks from 80 to 64 shallow bytes. No unresolved must-fix finding.
  • concise-code: compiler +71/−3, runtime +59/−31; no new public API. Reused nested-template compilation, guarded dependency probes, and range transactions. Rejected a new render-value runtime abstraction and broad descriptor rewriting. Independent read-only review findings were resolved. New files are the behavior fixture/test, focused benchmark fixture/entry, and changeset.

Production client/server output was compared against upstream 0bb503fc619303ef783fb1d52218186ae7984890. The direct block has no descriptor-construction helper in either target. The following are gzip bytes for the complete production JavaScript of the same minimal HTML consumer, including the runtime:

Form Base Oxc This head Oxc Base esbuild This head esbuild
Inline block 49,751 49,894 (+143) 59,725 59,363 (−362)
Explicit wrapper 49,484 49,629 (+145) 58,936 59,050 (+114)
Direct-template control 48,774 48,885 (+111) 58,159 58,280 (+121)

The new inline form costs 265/313 B more than the wrapper on the same runtime. Correctness requires the guarded accessor probe; this is not an across-the-board size reduction.

Clean minified Node 26.4.0/happy-dom bundles were measured in 24 balanced variant orders, 4,096 updates/sample after 8,192 warmups, with both V8 semispace bounds fixed at 256 MiB. All 192 measured loops had no GC or deoptimization, and retained DOM/text and teardown checks passed:

This-head comparison Inline Wrapper
Unchanged label, median μs/update 0.730 1.001
Changed label, median μs/update 1.218 1.127
Unchanged label, median heap-growth B/update 2,240 2,721
Changed label, median heap-growth B/update 2,913 2,770

Paired inline/wrapper time ratios are 0.723 for unchanged captures and 1.069 for changed captures. Inline time versus the old inline form is inconclusive in both cases (paired 95% intervals include 1). Guarded reflection allocates property-descriptor objects; zero new body-function expressions on a cache hit does not mean zero allocation. These are synthetic update/heap measurements, not browser latency or GC-pause evidence. node benchmarks/bench.mjs render-values --quick --ratios retains the function-creation and DOM-identity regression checks.

The current-head PR benchmark report also measures existing consumers. Complete Pagecraft production gzip grows from 169,276 to 169,393 B with Oxc (+117 B) and 188,669 to 188,782 B with esbuild (+113 B). All 64 js-framework work counters are unchanged; all 20 Chromium timing comparisons are within noise. This supports preserved measured work and timing, with a small bundle cost.

Risk / follow-ups

  • This is an explicit Strong-specific render-only contract: direct block props satisfy isChildrenBlock, not descriptor inspection. Use ordinary JSX for descriptor data. Other value positions and universal renderers are unchanged.
  • The broad local core attempt passed 45,622 tests but reported failures during iteration. Relevant behavioral failures were fixed and rerun above. Remaining local limits: an unavailable @wagmi/connectors/mock dependency, and an existing 6-second large-JS compiler threshold that also fails on the untouched baseline (31.09 s base / 24.64 s candidate; byte-identical output, one sample each—not a speed claim).
  • Main advanced to 6e939594fbce7f53bb7e8bb8c8645c1de36b7535 during validation. This PR retains the selected/tested base 0bb503fc619303ef783fb1d52218186ae7984890. GitHub reports no conflicts but marks it behind under strict branch protection; human review and a base update are still needed before merge. No merge or auto-merge is enabled.
  • Fresh dependency installation was blocked by registry metadata for [email protected]. Local checks reused an installed dependency tree with an identical lockfile; no package-manager policy or lockfile was changed. Clean CI installation and all validation jobs passed on the final head.
  • hostComponent forwarding is client-only coverage because that existing API does not adopt server DOM; descriptor and dynamic-host forwarding have SSR/hydration coverage.

Provenance

  • An agent produced this diff (agent-authored)

Implementation: Codex task · 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 compiler lowering and child-slot reconciliation for a new Strong-only render contract; behavior is heavily tested but mistakes could affect memoization, remounting, and host children identity.

Overview
Strong DOM templates now treat a direct component prop like content={@{ ... }} as a render-only body (isChildrenBlock), compiled via markChildrenBlock instead of an authored () => wrapper or element descriptor. Ordinary JSX and blocks in other positions keep descriptor behavior; docs add a Named render bodies contract.

The compiler enables strongRenderValues on client and server, lowers direct JSXCodeBlock props through compileRenderBlockValue, tightens auto-memo (render blocks opt out of flat guards; simple props.* captures use guarded dependency probes), and threads Strong mode into server compile.

Runtime reconciliation uses sameRenderBody so unchanged authored bodies can reuse slots while different bodies replace blocks; hostComponent drops the delegating children wrapper, and host-tag / childSlot paths remount or swap bodies when the compiled token changes (including suspension rollback).

A render-values benchmark suite, ratio guards, MCP registration, and broad client/SSR/hydration tests lock in narrow capture invalidation, DOM/focus retention, and parity with explicit wrappers.

Reviewed by Cursor Bugbot for commit ba70058. 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 feat PR: new feature or capability labels Oct 14, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 2b08f81. Configure here.

Comment thread packages/octane/src/compiler/compile.js Resolved
Comment thread packages/octane/src/compiler/compile.js Resolved
@domgan-oai
domgan-oai marked this pull request as ready for review October 14, 2026 22:12
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 40 value(s) increased
  • 🔴 bundle-reachability: 30 value(s) increased

Compares 0bb503fc6, the merge commit's first parent with 70bfeb0b7 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 6.633 6.042 −2.6% −17.5% … +7.3% ⚪ within noise
octane-tsrx replace 17.583 17.683 −7.5% −11.4% … −1.9% ⚪ within noise
octane-tsrx add 4.575 4.867 +3.9% −8.2% … +17.4% ⚪ within noise
octane-tsrx update 0.232 0.234 −1.6% −6.2% … +1.0% ⚪ within noise
octane-tsrx select 0.009 0.009 +1.4% −5.4% … +7.8% ⚪ within noise
octane-tsrx swap 0.025 0.022 −5.7% −14.9% … +2.4% ⚪ within noise
octane-tsrx remove 0.028 0.026 −3.9% −11.3% … +6.9% ⚪ within noise
octane-tsrx runlots 38.075 35.392 +3.3% −5.4% … +11.6% ⚪ within noise
octane-tsrx select_lots 0.009 0.009 −6.6% −13.2% … +4.1% ⚪ within noise
octane-tsrx clear 76.525 73.950 −1.3% −10.0% … +5.0% ⚪ within noise
octane-jsx run 5.325 4.800 +0.0% −7.3% … +13.4% ⚪ within noise
octane-jsx replace 10.983 11.183 +0.4% −3.5% … +7.1% ⚪ within noise
octane-jsx add 4.442 4.517 −7.1% −12.8% … −1.3% ⚪ within noise
octane-jsx update 0.353 0.360 −1.0% −4.1% … +4.1% ⚪ within noise
octane-jsx select 0.169 0.179 +0.5% −3.2% … +5.8% ⚪ within noise
octane-jsx swap 0.238 0.235 +0.9% −2.3% … +6.5% ⚪ within noise
octane-jsx remove 0.261 0.244 −3.0% −9.8% … +5.7% ⚪ within noise
octane-jsx runlots 40.300 45.192 +4.9% −1.4% … +12.3% ⚪ within noise
octane-jsx select_lots 4.047 4.181 +2.5% −22.1% … +34.4% ⚪ within noise
octane-jsx clear 100.158 103.308 +3.7% −8.0% … +9.3% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx bindings_js_raw 680,273 680,503 +230 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 224,093 224,143 +50 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 190,764 190,627 −137 (−0.1%) 🟢
octane-tsrx bindings_app_brotli 96,253 96,136 −117 (−0.1%) 🟢
octane-tsrx bindings_fw_raw 332,546 332,776 +230 (+0.1%) 🔴
octane-tsrx bindings_fw_gzip 108,433 108,483 +50 (+0.0%) 🔴
octane-tsrx bindings_fw_brotli 94,511 94,491 −20 (−0.0%) 🟢
octane-tsrx wayfinder_js_raw 457,026 457,405 +379 (+0.1%) 🔴
octane-tsrx wayfinder_js_gzip 148,741 148,858 +117 (+0.1%) 🔴
octane-tsrx wayfinder_js_brotli 128,816 128,927 +111 (+0.1%) 🔴
octane-tsrx pagecraft_oxc_js_raw 540,488 540,867 +379 (+0.1%) 🔴
octane-tsrx pagecraft_oxc_js_gzip 169,276 169,393 +117 (+0.1%) 🔴
octane-tsrx pagecraft_oxc_js_brotli 143,175 143,248 +73 (+0.1%) 🔴
octane-tsrx pagecraft_esbuild_js_raw 590,649 591,065 +416 (+0.1%) 🔴
octane-tsrx pagecraft_esbuild_js_gzip 188,669 188,782 +113 (+0.1%) 🔴
octane-tsrx pagecraft_esbuild_js_brotli 159,460 159,607 +147 (+0.1%) 🔴
octane-tsrx full_fw_raw 569,077 569,336 +259 (+0.0%) 🔴
octane-tsrx full_fw_gzip 172,236 172,283 +47 (+0.0%) 🔴
octane-tsrx full_fw_brotli 145,093 145,141 +48 (+0.0%) 🔴
octane-jsx js_raw 166,128 166,542 +414 (+0.2%) 🔴
octane-jsx js_gzip 53,912 54,036 +124 (+0.2%) 🔴
octane-jsx js_brotli 47,262 47,377 +115 (+0.2%) 🔴
octane-jsx app_gzip 2,861 2,857 −4 (−0.1%) 🟢
octane-jsx app_brotli 2,421 2,411 −10 (−0.4%) 🟢
octane-jsx fw_raw 157,857 158,271 +414 (+0.3%) 🔴
octane-jsx fw_gzip 51,051 51,179 +128 (+0.3%) 🔴
octane-jsx fw_brotli 44,841 44,966 +125 (+0.3%) 🔴
octane-jsx shell_js_raw 389,316 389,760 +444 (+0.1%) 🔴
octane-jsx shell_js_gzip 122,312 122,469 +157 (+0.1%) 🔴
octane-jsx shell_js_brotli 104,423 104,573 +150 (+0.1%) 🔴
octane-jsx shell_app_gzip 766 767 +1 (+0.1%) 🔴
octane-jsx shell_app_brotli 664 670 +6 (+0.9%) 🔴
octane-jsx shell_fw_raw 388,223 388,667 +444 (+0.1%) 🔴
octane-jsx shell_fw_gzip 121,546 121,702 +156 (+0.1%) 🔴
octane-jsx shell_fw_brotli 103,759 103,903 +144 (+0.1%) 🔴
octane-jsx shell_client_js_raw 323,667 324,111 +444 (+0.1%) 🔴
octane-jsx shell_client_js_gzip 101,164 101,286 +122 (+0.1%) 🔴
octane-jsx shell_client_js_brotli 87,241 87,372 +131 (+0.2%) 🔴
octane-jsx shell_client_app_gzip 769 768 −1 (−0.1%) 🟢
octane-jsx shell_client_app_brotli 660 663 +3 (+0.5%) 🔴
octane-jsx shell_client_fw_raw 322,566 323,010 +444 (+0.1%) 🔴
octane-jsx shell_client_fw_gzip 100,395 100,518 +123 (+0.1%) 🔴
octane-jsx shell_client_fw_brotli 86,581 86,709 +128 (+0.1%) 🔴
octane-jsx full_fw_raw 569,077 569,336 +259 (+0.0%) 🔴
octane-jsx full_fw_gzip 172,236 172,283 +47 (+0.0%) 🔴
octane-jsx full_fw_brotli 145,093 145,141 +48 (+0.0%) 🔴

47 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
root-static raw 147,655 148,071 +416 (+0.3%) 🔴
root-static gzip 47,932 48,045 +113 (+0.2%) 🔴
root-static brotli 42,214 42,279 +65 (+0.2%) 🔴
hydrate-frame raw 339,653 340,069 +416 (+0.1%) 🔴
hydrate-frame gzip 107,961 108,088 +127 (+0.1%) 🔴
hydrate-frame brotli 92,730 92,874 +144 (+0.2%) 🔴
split-shell raw 414,193 414,572 +379 (+0.1%) 🔴
split-shell gzip 132,695 132,800 +105 (+0.1%) 🔴
split-shell brotli 114,266 114,362 +96 (+0.1%) 🔴
split-shell-runtime raw 331,348 331,727 +379 (+0.1%) 🔴
split-shell-runtime gzip 105,203 105,307 +104 (+0.1%) 🔴
split-shell-runtime brotli 89,678 89,782 +104 (+0.1%) 🔴
binding-base-ui-vite raw 188,849 189,265 +416 (+0.2%) 🔴
binding-base-ui-vite gzip 60,841 60,948 +107 (+0.2%) 🔴
binding-base-ui-vite brotli 53,279 53,340 +61 (+0.1%) 🔴
binding-base-ui-esbuild raw 216,095 216,504 +409 (+0.2%) 🔴
binding-base-ui-esbuild gzip 70,374 70,477 +103 (+0.1%) 🔴
binding-base-ui-esbuild brotli 61,138 61,262 +124 (+0.2%) 🔴
binding-radix-vite raw 189,213 189,627 +414 (+0.2%) 🔴
binding-radix-vite gzip 60,724 60,826 +102 (+0.2%) 🔴
binding-radix-vite brotli 53,161 53,296 +135 (+0.3%) 🔴
binding-radix-esbuild raw 216,241 216,650 +409 (+0.2%) 🔴
binding-radix-esbuild gzip 70,273 70,423 +150 (+0.2%) 🔴
binding-radix-esbuild brotli 61,094 61,216 +122 (+0.2%) 🔴
binding-apollo-client-vite raw 331,015 331,396 +381 (+0.1%) 🔴
binding-apollo-client-vite gzip 103,097 103,182 +85 (+0.1%) 🔴
binding-apollo-client-vite brotli 90,370 90,517 +147 (+0.2%) 🔴
binding-apollo-client-esbuild raw 366,268 366,678 +410 (+0.1%) 🔴
binding-apollo-client-esbuild gzip 116,760 116,929 +169 (+0.1%) 🔴
binding-apollo-client-esbuild brotli 101,958 102,045 +87 (+0.1%) 🔴

90 other measured values are unchanged.

@domgan-oai
domgan-oai merged commit 479118f into octanejs:main Oct 14, 2026
32 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 14, 2026
trueadm added a commit that referenced this pull request Oct 15, 2026
Brings in #2067 (mdx providers as Strong templates), #2068 (479118f,
Strong named render blocks without descriptors), #2070 and Version Packages.
#2068's squash matches its reviewed head 2203905 in runtime and compiler
source; it adds only the MCP benchmark entry and its changeset line.

Conflicts:
- package.json: ci:workflow:test keeps the redesign's check-render-writes
  test in place of check-staged-dom; typecheck takes main's mdx typetests.
- runtime.ts, hostComponent: #2068 drops the stable delegating children
  body; the redesign's commit-time props (state.next, commitHostComponent)
  stay.

Re-expressed (the trial resolution of 4bf8ab0ddd): renderHostTagChildren's
replacement. #2068 journalled the slot and its range, deferred the outgoing
Block (deferRootReplacement, STAGED_DOM) and removed children at render. Here
a different body builds in the slot's frontier over committed DOM, the
outgoing Block and its nodes are queued as the slot's deletion, and
landHostTagChildren swaps the slot's Block at commit; fresh DOM, or no open
root render, replaces at once. scripts/render-writers.mjs classifies
replaceHostTagChildren as fresh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 15, 2026
renderHostTagChildren swapped a same-body capture into the children's Block
at render. A render that was then dropped left the Block holding the dropped
render's captures, so the Block's own next update rendered them: a parent
render passes label 'two' to the body, a sibling suspends and the render
drops, and a click inside the body then showed 'two:1' instead of 'one:1'.

renderWithBody renders with the new body and, in a root render that can be
dropped, restores the committed body after the render and lands the new one
at commit (landBody). A dropped render, or a held boundary's dropped window,
discards that op with the rest of its work; nothing is journalled.

The replacement's swap of the slot's Block now runs as the outgoing range's
deletion cleanup, so it lands and drops with the slot's pending structure
(dropRootOps, and the failed @Try's dropBodyOps, which leaves other ops in
place).

childSlot's isBodyFn swap has no such gap today: its existing root-journal
entry restores the body. The new test's direct case pins that, and fails when
that entry is removed.

Tests (strong-render-values):
- a body update after a dropped render renders the committed captures,
  direct and through a dynamic host; the dynamic-host case failed before;
- two replacements of one forwarded body in one drain (urgent, then the
  owner's transition in its boundary's window) land the last; the
  non-suspending case fails when the pending-replacement branch is skipped;
  the suspending case drops that window, and dropTransitionRender drops the
  transaction and renders it again, so the urgent replacement commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 15, 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 feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strong TSRX: descriptor-free render-block values without explicit arrow wrappers

1 participant