Skip to content

feat: add async signals and streaming SSR - #1069

Merged
callie-openai merged 67 commits into
octanejs:mainfrom
openai-oss-forks:codex/callie-async-signals
Sep 16, 2026
Merged

callie-openai merged 67 commits into
octanejs:mainfrom
openai-oss-forks:codex/callie-async-signals

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements signals and streamed SSR with early interaction, renderer-free presentation, and native StyleX bindings. The aim is continuity: preserve server values and newer user input as results arrive, components hydrate, and navigation changes. This is an implementation checkpoint, not a claim that every RFC follow-up is complete.

Implemented

  • Signals without mandatory scopes: module-level signal$, derived$, and query$, request-local server values, browser ownership, and stale async-result rejection.
  • Early input: direct two-way value={draft$} / checked={selected$} bindings and inline input capture. Once the signal engine and handlers are installed, updates run without the renderer; capture alone does not run derivations or reproduce trusted user activation.
  • Streaming and navigation: adopt server results without repeating initial requests, protect newer selections across A → B → A navigation, reveal independent regions, and start compiler-proven independent reads together.
  • Renderer-free UI: compiled text, conditionals, keyed lists, supported pure child components and slots, controls, cleanup, and normal-hydration handoff. Rich streaming fixtures cover evolving titles, text, links, lists, and placeholder-to-widget updates. Arbitrary components are not supported on this path.
  • Native StyleX: signal-backed sx, coordinated class/style updates, and shared eligible recipes, preserving StyleX units, null handling, precedence, and CSS extraction. Changing which styles apply still requires the appropriate merge or compiled lookup.
  • Actions: event-time command capture, revision-aware optimistic receipts, and separately authorized/settled independent read batches.
  • Signal transitions: private signal writes join existing Action batches and renderer/renderer-free presentation commits. Pending work retains committed values and UI; urgent native edits remain live. Async derivations and browser-owned streams transfer their accepted subscriptions without restarting.

Latest changes

  • Keep shared transition state separate from the full transition frame, so recursive split-chunk grouping does not pull deferred orchestration into early signal/control modules. This preserves existing APIs and synchronous Action behavior; it changes startup placement, not total feature cost.
  • Add coordinated signal-transition preparation, supersession, post-await Action writes, timeout recovery, and cancellation while retaining existing commit machinery.
  • Preserve input value, focus, and selection during pending Actions, including props-spread controls, standalone renderer-free controls, early hydration adoption, and reentrant action startup.
  • Move explicit declaration keys to trailing options: signal$(initial, { key }), derived$(compute, { key }), and query$(select, load, { key }). Explicit scope APIs are unchanged.
  • Correct the StyleX adapter example to retain development data-style-src metadata. Prior native sx, nested component, and shared-recipe improvements remain included.
  • Merge upstream through 1ed5d2ab9, combining browser-failure diagnostics and retaining the upstream syntax-highlighter test-race fix. This integration changes no runtime, compiler, SSR, signals, StyleX, or dependency-lock code.

Remaining

  • Remaining transition/API scope: receiver-owned SSR query handoff and unresolved historical adoption still reject explicit transition participation; untracked/post-await guidance and boundary-driven resource reset remain open. Immediate, fenced navigation does not require explicit transitions.
  • Size and performance: downstream full-startup budgets remain unresolved. The module split removes transition-only code from eager signal chunks, but does not eliminate the added implementation cost. Versus the preceding RFC checkpoint, isolated early binding/bootstrap entries add about 0.6–0.8 kB gzip, the ordinary client renderer adds 5.1 kB, and ordinary SSR bytes are unchanged. These overlapping entries are not an application total; cached implicit/global reads also show about 0.5–0.8 ns overhead in the local microbenchmark.
  • Transport and hydration efficiency: compact/coalesced frames, structural versus leaf seeds, dependency-aware derived adoption, and shared-result references.
  • Browser coverage: general late-stylesheet independence and native iOS Safari/IME qualification remain open.

Dominic’s review is partially addressed, not closed. Detailed contracts and examples live in the RFC and implementation guide.

Validation and readiness

  • Integration commit 7a0333ff8: 64 workflow checks, 11 focused syntax-highlighter cases, generated adapted-test/parity verification, formatting, and repository synchronization pass. Independent review found no issue in the combined failure diagnostics. Runtime sources and dependency locks are byte-identical to the preceding 8ae2143b4 checkpoint.
  • Packaging successor 8ae2143b4: 949 targeted cases across 65 suite executions, 40 Chromium/WebKit development/production scenarios, 14 bundle-boundary checks, source types, prepack, formatting, and repository synchronization pass. All 447 captured source hashes stayed unchanged during the targeted run. Independent two-pass review found no actionable issue.
  • A real recursive split-chunk probe keeps the signal engine usable before loading the renderer, then verifies synchronous Action entry, private post-await writes, coherent acceptance, and urgent-write precedence. Eager engine size falls by 2,779 bytes gzip; the sum of its three chunks increases by 274 bytes. This is a startup placement fix, not a total-size or latency improvement. The new boundary guard rejects the earlier checkpoint in six early-entry cases, including otherwise tree-shaken module edges.
  • Browser scenarios cover native/direct/spread-bound controls, standalone renderer-free input, focus/caret, synthetic composition events, captured writes, and related/unrelated pending Actions. No page errors or source drift. They do not establish physical iOS Safari, native OS IME, or latency results.
  • Performance: reproducible checkpoint accounting records bundle closures and paired owner-read results. The report distinguishes added bytes and measured overhead from remaining application acceptance; no performance improvement is claimed.
  • Downstream validation of this exact source plus its retained host patch reproduces the clean package installation and passes 110 existing composer browser cases, the 19-task application validation run, and 94 patch-inventory cases. The matched production build confirms the early-placement improvement but exceeded the original full-startup size caps; application acceptance is tracked separately. These application results do not qualify the unpatched source or native devices.
  • CI and review: integration head 7a0333ff8 passes all 26 jobs in run 35138862800, without a retry. Its Bugbot review reports no issues. All 13 review threads are resolved, with no pending or change-request reviews. GitHub reports the branch approved and mergeable against 1ed5d2ab9.
  • Readiness: the conflict-resolution checkpoint has passed its local validation, CI, review, and mergeability gates. Application integration, size acceptance, and the remaining RFC items above are tracked separately. Full workspace local testing and native-device qualification are not claimed.
Import, attribution, and integration history

Import and attribution

  • Submitted on behalf of Callie, who supplied the changes for publication. The handoff identifies the source as agent-authored.
  • Updated source: ec0bff17b759530036aed06963d280e2c9dc6e67, following 9661ee42387723d2e65a5ad9d7fd7ab966b30a97, from openai-oss-forks/octane, branch dev/callie/async-signals-streaming-ssr.
  • Original patch base: 2789eab27ced3e2519cba4508b8e6aa9e728a3eb. The existing PR was first integrated with upstream 8a45222ab; this update incorporates upstream 1e12db7d6d57b573b780b3d68c4e573d065320d1 in merge 8a317eb55e565d9206c256a42d9e280c222ab0c5 before applying Callie's incremental changes.
  • Verified the incremental patch against the previous export and the complete patch against the original Git base. Both reproduce all 30,742 regular snapshot files and executable modes exactly. The 76-file incremental delta adds 16 files and deletes none. Six unchanged symlink targets were inspected separately and excluded from extraction.
  • Incremental patch SHA-256: b8c409eab763ddca6b19bc5c0dc6072644c5a760bc4571ebfba97d9c0c754af0. Full patch SHA-256: 9f6a3720d0fa6d05ef8a96eabb36f43e398157da198127fa2882393bba5d7c8a.
  • The exports contain no Git history or original author email. Source commit identifiers and authorship come from the handoff; this PR imports verified aggregate diffs without inventing commit attribution.

Integration adjustments

  • Preserve upstream event-dispatch and template Text-node optimizations; resolve RPC/history requests against the page origin even with an external HTML base.
  • Keep reusable CSS, HTML, SVG, and component-prop types scalar while accepting direct signals at automatic JSX host sites. Public type tests cover resource inference, synchronous request descriptions, read-only values, document authority, and receiver capabilities.
  • Use standard git for benchmark subprocesses, expose the conversation benchmark in MCP, provision WebKit in the actual CI job, and coordinate integration peers with the matching core release.
  • Maintain Vite/app-core, MDX, evaluation, and Three harness integration. Normalize only compiler-owned input identity in Select/textarea parity helpers; preserve pristine expectations and refresh evidence after declared cases pass.
  • Keep helper-selection assertions in deterministic benchmark coverage; retain evaluated compiler checks for effects, diagnostics, nested declarations, Promise/stream values, and stable sites.

Provenance

  • An agent produced this diff (agent-authored)

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


Note

High Risk
Touches core signal ownership, streaming hydration, server/client identity, and early native control paths—areas where mismatched deploys or partial adoption easily cause subtle continuity bugs.

Overview
This PR documents and validates a large async signals / streaming SSR checkpoint: dozens of new changesets describe owner-bound signal$ / derived$ / query$, streamed RPC, renderer-free adoptBindings presentation, early hydration handoffs, native StyleX sx, transition staging, API moves (declaration keys in trailing { key } options, createResource replacing scope.asyncSignal$), and related compiler/runtime fixes (stable control sites, parallel independent reads, undefined attribute reconciliation).

New measurement and docs: adds a production-style conversation-streaming benchmark (Vite app fixture plus a behavior-only path that boots signals without the renderer), registers it in bench.mjs, exposes it via MCP, and adds CONTEXT.md signal-continuity terminology. CI expands React-parity browser diagnostics and installs WebKit alongside Chromium for package coverage jobs.

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

Import the supplied aggregate patch on behalf of Callie, preserving current
upstream changes. Include signal ownership, renderer-free streamed adoption,
independent hydration, server calls, integrations, tests and evidence ledgers.

Repair benchmark portability, coordinated core peer requirements, browser CI
provisioning and integration test lifecycle/realm setup found during import.
Keep RPC and history requests on the page origin under an external HTML base.

Source-Revision: 9661ee42387723d2e65a5ad9d7fd7ab966b30a97
Source-Branch: dev/callie/async-signals-streaming-ssr
Patch-Base: 2789eab
Patch-SHA256: 4a92a372027621cfb5f570ce1039e7880475db5f71de95287a5f9023ed2ab602
Provenance: agent-authored, supplied at Callie's request
@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 Sep 12, 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.

Stale Bugbot comment from a previous run.

@domgan-oai
domgan-oai marked this pull request as ready for review September 12, 2026 22:54
@domgan-oai domgan-oai changed the title feat: add Callie's async signals and streaming SSR feat: add async signals and streaming SSR Sep 12, 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.

Stale Bugbot comment from a previous run.

@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.

Stale Bugbot comment from a previous run.

@cursor cursor Bot mentioned this pull request Sep 19, 2026
7 tasks done
trueadm added a commit that referenced this pull request Sep 27, 2026
…1335)

The committed src/**/*.tsrx.d.ts files had drifted since #432: #1069 added a
top-level JSX namespace to octane/jsx-runtime, and #943 changed memo's return
type. Streamdown's types:check was never run by CI, so the drift went unnoticed.

Regenerate the declarations and run `pnpm --dir packages/streamdown types:check`
as a root `test` precheck alongside Visx's.

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 2, 2026
… fixtures in PR CI (#1583)

* fix(compiler): keep cached-array regions on signal-capable child holes

Since #1069, a renderable `{expr}` hole in a DOM template lowers to the
signal-capable `bindSignalChild` binding whenever the module can carry a
signal handle, which is any identifier hole. That branch returned before the
only-child path that wraps a compiler-owned calculated descriptor array in its
`compilerCacheArray` auto-memo region, so an unchanged array inside a
component-children body reached `childSlot` for the list and each item on
every parent render. The hook-memo provider-output guard
`inline_memo_snapshot_slots` rose from 0 to 256 per 128 updates.

Wrap the signal-capable binding in the same region. Only an unchanged plain
data array can hit; a signal handle or any other value fails
`compilerCacheArray` and rebinds every render, and the existing identity miss
rebuilds a previously cached array after the hole held something else.

The new value-position case switches one calculated child between cached rows
and a signal handle. It fails in the production compile when the region's
identity miss is dropped, and passes on the uncached path too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hg86UdUyzRwFTLWhpAMdFE

* test(bench): report hook-memo scenarios net of the root update driver

Eight hook-memo ratio guards breached on main (eligible hit functions 704,
eligible hit arrays 3,872, and so on) while the inline memo tier's own counts
were unchanged. Per-site attribution put every excess event in the runtime's
same-component `root.render()` path: the per-update request/retry closures
and the root render transaction's undo log, OffscreenCapture arrays and
committed-transaction queue, 2 functions and 10 arrays per render in both
compiler variants. Bisecting `run.mjs` output found 5f7a457 (#833, root
render transactions) to be the first breaching commit; it did not touch this
benchmark, and its documented root-transaction cost is unrelated to hooks.

Add a hook-free Driver control that runs the identical phase sequence, report
every scenario net of the driver's same-phase counts (failing the run if a
scenario falls below it), and keep raw counters in the JSON metadata. Two new
guards pin the driver's per-update cost at its current 2 functions and
10 arrays so the root update path cannot grow silently.

The corrected runner reports identical net counts on both sides of #833, and
against 814a3c1 (before closure-free memo lowering) it still breaches the
same seven memo guards the original measurement recorded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hg86UdUyzRwFTLWhpAMdFE

* ci: check the Lynx bench fixture contracts on every pull request

The weekly Bench workflow runs the Lynx table-stage and list fixture
contracts before its ratio guards. Those tests compile copies of
packages/lynx/src, and Lynx changes broke them twice (09-21: an unresolved
`octane/internal/context` import; 09-28: a removed `universalBlock` export,
fixed on main by #1391). PR CI never ran them, so each break surfaced only
in the next weekly run and kept every ratio guard from executing.

Add both suites to `ci:workflow:test`, which the lint job runs on every
ready pull request, and assert the two lists stay aligned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hg86UdUyzRwFTLWhpAMdFE

* fix(compiler): keep raw-HTML hosts off the cached signal child region

A host that may receive dangerouslySetInnerHTML, directly or through a
spread, must reach its child binding on every render: that call is where
children and raw HTML are kept mutually exclusive. The ordinary only-child
path already checks this before choosing the cached-array region, but the
region restored around bindSignalChild did not, so an unchanged cached array
let a spread add raw HTML beside still-mounted rows without the error.

Skip the region for such hosts, as the ordinary path does. The new spread
case fails in the production compile without the guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hg86UdUyzRwFTLWhpAMdFE

---------

Co-authored-by: Claude <[email protected]>
trueadm added a commit that referenced this pull request Oct 2, 2026
…g and SSR metadata ratio guards (#1591)

* fix: recover the template-call-memo, transition-hooks, signal-favoring and SSR metadata ratio guards

Four ratio suites breached deterministic guards on main. Each was bisected
over the suite's own output, with every old checkout on its own installed
dependencies.

- template-call-memo (0df8be7, #1265): a Strong `@for` row calling
  `console.log` lost DEP-PURE because `console` is a host global. The
  receiver of a statement-position `console.method()` call no longer counts
  as an ambient row read; its arguments still do.
- ssr-final-metadata (5ead1ff, #1069): `ssrComponent` re-encoded a keyed
  descriptor's key that ssrChildValue's `child-key` membrane already holds.
  ssrChildValue now passes `identityScoped: 'key'`.
- transition-hooks (5ead1ff, #1069; 8a45222, #1068): runTransition's
  native candidate resolver and fireEventSlot's invoke callback no longer
  allocate a closure per transition or delegated event. The pooled event
  frame's first allocation gets a one-time work-model allowance.
- signal-favoring (5ead1ff, #1069): the JSX static-fragment fold matches
  `_$createElementFromConfig(site, C, props)` again, and bindSignalChild keeps
  textHoleUpdate's primitive fast path. Bump samples are calibrated to 20 ms
  because a TSRX bump sat under Chromium's 100 us clock floor; the dialect
  ceiling moves to 18 from same-runner measurements before #1069 and after
  this fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: keep a skipped text hole's token unpublished and fit the chained-JSX budget

bindSignalChild returned the new primitive as its token even when the block
was already pending, so childSlot skipped the write. The repeated render then
matched that token and left the previous text in place. A skipped pass now
keeps the token unpublished; the new test drives a mid-render self-update
through an earlier hole.

invokeEventSlot is an if/else chain without the redundant bundle alias, which
brings root-chained-jsx back to its raw and gzip ceilings. Removing the
per-event closure still costs 2 brotli bytes, so that budget moves one
32-byte step to 25344.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf: trim bindSignalChild's primitive text fast path

Fold the pending-pass check into the primitive-token flag and drop the
ownsHost test: only the implicit childSlot path passes ownsHost, and that
path's implicitSignal already keeps it off the fast path. Saves 36 raw and
19 gzip bytes in bundles that reach bindSignalChild.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
The compiled/source gzip guard (maxRatio 1.06) records 26132 / 24713 from
136b0e3 (#638). The suite wrote no numbers from 2026-09-16 until its Rspack
chunk assertion was fixed, so nothing checked it. Main now measures
35039 / 27077 = 1.294x.

Splitting the growth:
- Compiler: the 136b0e3 corpus files the current compiler still accepts
  (14 of 16) compile to 22338 -> 25107 gzip. A sampled timeline plus git
  bisect over that fixed set names 5ead1ff (#1069): +2065 B in one step,
  because every opaque text and attribute binding became signal-capable.
  #1270 kept that design while removing its runtime tax. The rest is gradual.
- Corpus: tests extended the context, boundary, control,
  controlled-forms-diff and components fixtures. Source gzip rose
  24713 -> 27077 and those fixtures add the remaining +6138 compiled bytes.

Both are intended, so the ceiling moves to 1.30, leaving 161 B.

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
…d can produce (#1661)

#1279 made the plain-object memo compare check own-property membership for
every key, so an inherited Object.prototype value cannot stand in for a
removed prop. On a plain or null-prototype object a missing own prop reads as
undefined or an Object.prototype member, which is a function or an object, so
a primitive that compares equal is already own. The lookup now runs only for
undefined, function and object values.

memo-wall's wall B bails 999 rows of four primitive props and a callback on
every one_change_B; it made five lookups per row and now makes one. Paired
A/B with the #833/#1069 fixes: one_change_B 0.269 -> 0.252 ms.

memo-props gains a case for an own __proto__ prop holding Object.prototype
(the object branch; it fails without it), and memo-wall gains a deterministic
guard counting own-prop lookups per bailed row (5 on main, 1 now).

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
…ive (#1643)

Since #1069 a `{props.value}` hole that is its host's only child compiles to
bindSignalChild, because the value can carry a signal handle. The binding kept
the Text node as its token, so every render went through updateTextValue,
which reads nodeValue to compare. 128 unchanged updates now made 128 live
nodeValue reads where the compiled childTextHoleUpdate path made none. An
unchanged value also overwrote an outside edit to the text.

The only-child path now keeps the last written primitive as its token, like
#1591 did for marker-bounded holes. An unchanged primitive returns before any
DOM read; raw HTML still claims the host first. The token's Text node is the
host's first child. A changed primitive or a switch to a signal handle
recovers it from there. A primitive becomes the token only where that
position is proven:
- by the previous token;
- by a client mount's empty template;
- otherwise by one comparison, because hydration can keep unclaimed server
  content ahead of the node it adopted.
A staged ViewTransition render keeps the Text token.

Restores root-transactions equal_reads text-compiled to 0 (guard maxRatio 0).

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
…#1659)

Since #1069 the client's scoped value descriptor defined an enumerable
__octaneInvocationSite accessor, so Object.keys, for...in and spread listed
an internal seventh key that ordinary createElement descriptors carry only
when a site exists. A deferred value cannot know whether its record has a
site without resolving it, so make the accessor non-enumerable, as the
server twin already was. The getter still forwards the resolved record's
site to component slots, signal identity and SSR.

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
…ak maps (#1655)

* perf(octane): record event signal authority on the host instead of weak maps

#1069 made every module that can receive a signal handle record each native
handler's signal authority: the element's owner in one weak map and an
"escaped" mark for the scope in another. Keyed rows paid two weak-map
insertions per mounted row even with no signals in use. A same-runner paired
A/B put prepend100/append100/insertmid100 at 0.48 -> 0.76 ms across #1069.

The element's authority now lives in a $$signalOwner property beside its
handler slots, journaled and rolled back like before, and the escape mark is a
signalTokenEscaped field on Scope/Block with the same retirement truth table.
Mounting no longer touches a weak map.

bindSignalText also writes a scalar over the Text it already owns directly,
skipping bindDirectSignal's policy dispatch; setText still journals the text
and the binding bag. That path runs for every compiled text-hole update in
such a module (memo-wall context refresh: 0.669 -> 0.622 ms paired).

The signal-dom-bindings suite gains a deterministic guard counting weak-map
insertions per mounted and inserted handler row (2 on main, 0 now), with
dispatch and survivor-identity controls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(bench): observe stable event authority on the host property

The stable-event-authority work observer counted authority writes through
WeakMap.prototype.set. Authority now lives in each host's $$signalOwner
property, so the observer counts writes through an Element.prototype
accessor instead. The expected counts are unchanged (400 mount, 0 retained,
0 changed capture), and dropping the runtime's unchanged-authority skip
still fails the retained-write assertion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 3, 2026
…ng its render (#1664)

* perf(octane): record event signal authority on the host instead of weak maps

#1069 made every module that can receive a signal handle record each native
handler's signal authority: the element's owner in one weak map and an
"escaped" mark for the scope in another. Keyed rows paid two weak-map
insertions per mounted row even with no signals in use. A same-runner paired
A/B put prepend100/append100/insertmid100 at 0.48 -> 0.76 ms across #1069.

The element's authority now lives in a $$signalOwner property beside its
handler slots, journaled and rolled back like before, and the escape mark is a
signalTokenEscaped field on Scope/Block with the same retirement truth table.
Mounting no longer touches a weak map.

bindSignalText also writes a scalar over the Text it already owns directly,
skipping bindDirectSignal's policy dispatch; setText still journals the text
and the binding bag. That path runs for every compiled text-hole update in
such a module (memo-wall context refresh: 0.669 -> 0.622 ms paired).

The signal-dom-bindings suite gains a deterministic guard counting weak-map
insertions per mounted and inserted handler row (2 on main, 0 now), with
dispatch and survivor-identity controls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): restore keyed survivor indices from the list's shape record

#833 made root renders undoable and journaled every keyed survivor's previous
itemIndex in updateSurvivor: four journal slots per row on each reorder,
removal, or insertion that shifts positions. A same-runner paired A/B put a
1,000-row rotate at 0.050 ms before #833 and 0.071 ms on main.

An index moves only when the list's membership or order does, which records
the list's shape (journalForSlot) anyway. reconcileKeyed now takes that
record before the first survivor index write, and restoreForSlot restores
each row's itemIndex from its chain position; a row whose index already
differed is kept exactly. The hydration adoption branch, which restores a DOM
range instead of a chain, still journals indices per row. Transition journals,
which never restored itemIndex, now restore it too.

The shape record also builds the key order with one spread and an early-exit
comparison instead of an iterator loop that copied the order element by
element.

The root-transactions suite gains reorders.mjs, which counts root-journal
slots per row for rotate/reverse/remove-first/insert-first (4 on main, 0
now). A held-root test pins that index-reading rows render their positions
after a held reorder retries; it fails when the index restore is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(bench): observe stable event authority on the host property

The stable-event-authority work observer counted authority writes through
WeakMap.prototype.set. Authority now lives in each host's $$signalOwner
property, so the observer counts writes through an Element.prototype
accessor instead. The expected counts are unchanged (400 mount, 0 retained,
0 changed capture), and dropping the runtime's unchanged-authority skip
still fails the retained-write assertion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): trim the keyed index journal to +51 raw / +10 gzip bytes

The bench report on this PR measured +250 raw / +90 gzip bytes in every
bundle with a keyed list. journalForSlot now returns false, so the call
sites clear their pending flag without a helper. Rollback restores each
row's index from its chain position without a side map, since every
reconcile leaves a row's index equal to its position and the record is
taken before the first survivor index write. The hydration-adoption branch
does not restore a chain at all (its rows are fresh), so it no longer
journals indices per row either.

js-framework octane-tsrx bundle against main: +51 raw / +10 gzip (was
+251 / +51). The held-root index test still fails when the restore is
removed; the reorder guard still reads 0 slots per row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(octane): keep row indices across a hydrating keyed rollback

The hydration-adoption branch of journalForSlot restores a DOM range, not a
chain, so the trim that dropped its per-row index entries left an existing
row's itemIndex on the aborted position after a hydrating render reordered
the list and rolled back. Journal each existing row's index there again,
before reconcileKeyed moves any of them. Bundle cost against main is now
+130 raw / +31 gzip for js-framework octane-tsrx.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): update a same-component de-opt list item without entering its render

A value-position list rebuilt by createElement (memo-wall wall B, every
@octanejs binding) hands back a fresh descriptor per row. Each surviving row
entered its item render (renderBlock, deoptItemBody, a nested childSlot) only
to reach the memo bail of the component already mounted there, and the root
journal recorded the item's inputs and render for every row.

updateSurvivor now hands a plain de-opt item to updateDeoptComponent, which
takes that nested childSlot's same-component branch directly, in the item's
scope and with the priority its render would inherit: the memo bail, the
identical-props bail, or a journaled props update and render of the existing
component Block. A bail leaves the item's committed descriptor in place.
Hydration, signal owners, native reads, non-root captures, unsettled items and
every other child regime keep the ordinary item render. The function reaches
updateSurvivor through ForSlot.itemUpdate, stamped in renderPreparedChildList,
so compiled @for bundles never retain the descriptor renderer.

Per bailed row (new memo-wall survivor-work guard, jitless precise calls):
48 calls and 8 root-journal slots before, 26 and 0 now. One __oneChangeB on
the memo-wall production build: 46,138 calls before, 24,138 now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): point childSlot's same-component branch at its de-opt item twin

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): drop de-opt item fast-path checks its component Block already implies

An item whose nested slot holds a component Block never has recorded
$$ctxReads (it is neither memo nor armed) and never also holds a portal.
Its end marker and a former body-function flag do not change the
same-component branch it mirrors. A non-object item fails the kind check
without the separate null and typeof tests. -100 raw / -17 gzip in bundles
that include the descriptor renderer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): drop the one_change_B waiver and tighten its guard to 1.1

#1646 waived memo-wall one_change_B (octane-tsrx/react, maxRatio 1.4) until
the per-row survivor work was fixed. With same-component de-opt survivors
taking the memo bail directly, paired ~20 ms samples measured 0.80x, 0.80x
and 0.82x across two same-runner runs (the previous code: 1.30-1.41x; #639:
0.97x). 1.1 keeps about 35% headroom while catching a return of the per-row
item render.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(octane): carry the de-opt survivor update in ForSlot.plainDeopt

The plain de-opt flag now holds the list's survivor update itself
(updateDeoptComponent, or null), so ForSlot needs no second field and the
compiled @for path that shares updateSurvivor pays only one optional call.
updateDeoptComponent writes the survivor's index. The js-framework rows app
(compiled lists only) now grows +20 raw / +11 gzip over main, within the
committed +32 budget, instead of +74 / +29.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 5, 2026
…t signals (#1762)

* perf(octane): stop shipping the signal binding runtime in apps without signals

Since async signals (#1069) the compiler treated every opaque text,
attribute, control and textarea hole, such as `{row.label as string}`, as a
potential signal handle in every module. Every app therefore retained
bindSignalText and the direct-binding engine and stamped signal identities
on every component, even when it never created a handle.

Opaque holes now bind handles only in modules that import from
`octane/signals` (a type-only `SignalHandle` import is enough and does not
enable native reads), in modules using DOM bindings, or everywhere with the
new `opaqueSignalHandles` compiler option. `$`-named expressions still bind
in every module. A dev-only error reports a handle that reaches a plain text
hole.

Gating exposed two plain-path hydration gaps that the signal path had been
masking: a sibling or whole-output hole whose first client value is
`undefined` kept the server content (the #1426 sentinel now seeds every
hole), and an `undefined` first attribute value kept the server attribute
(the IfChanged writers now apply the direct-signal path's hydration rule).

Runtime gzip: rows 38,991 -> 37,307, TodoMVC 44,217 -> 41,076,
chat 43,638 -> 40,347, weather 48,986 -> 47,270. Budgets lowered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): re-lower byte budgets after merging main

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): re-lower minimal budgets after merging main

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(bench): opt scoped-signals harnesses that pass opaque handles into opaqueSignalHandles

These workflow tests render real handles through ordinary props in modules
without a signals import (late model-engine imports, opaque rows and
attributes), which now binds only with the opaqueSignalHandles option.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(octane): look through satisfies and instantiation wrappers for nested $ handles

The syntactic-only capability check unwrapped as/!/parentheses but not
`satisfies` or instantiation expressions, so `(a ?? b$) satisfies T`
stopped binding `b$` in a module without a signals import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: update signal-capable mapping and writer tests for the opaque-handle gate

signals-dom-bindings passes handles through ordinary props in an untyped
module, so it opts into opaqueSignalHandles. The playground mapping rows for
signal-free modules now map to the plain writers, and a signals-importing
variant keeps the named writer-record targets covered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm pushed a commit that referenced this pull request Oct 29, 2026
…#2286)

"attaches to existing DOM without replacing nodes or mutating protected
attributes" compiles 582 fixture modules across its dev/prod matrix. On a
busy machine the compiles take about 9 s of a 12 s run, and a quiet one
still takes 5.5–9 s. Its 15 s limit dates from #1069, when the test was
about a third of its current length. CI timed it out on 2026-10-14 and
2026-10-28, and the abandoned body then threw from a later test's shared
hydratedRoot.

Use the 60 s budget other compile-heavy tests use.

Co-authored-by: Claude Opus 5.5 <[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 feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants