Repository navigation
fix(octane): keep a signal-capable only-child text hole's last primitive - #1643
Merged
Merged
Conversation
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
marked this pull request as ready for review
October 3, 2026 07:52
Contributor
Benchmark report
Compares js-framework: 1k/10k row operations (ms, lower is better)All 20 timed operations (20 within noise)
Application bundle size (bytes)
37 other measured values are unchanged. Public-import reachability bundles (bytes)
84 other measured values are unchanged. |
trueadm
added a commit
that referenced
this pull request
Oct 3, 2026
The waived guards now have owner PRs: ssr-final-replay try_closures (#1644), root-transactions equal_reads (#1643) and codegen-size gzip compiled/source (#1645). #1645 rebaselines the same codegen-size entry, so this branch no longer edits it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 3, 2026
trueadm
added a commit
that referenced
this pull request
Oct 3, 2026
…nd re-judge them (#1646) * ci(bench): triage the weekly ratio-guard breaches so new ones show The weekly Bench job (`bench.mjs --quick --ratios`) was red with 81 ratio breaches, 4 suites that wrote no numbers and 4 harness gate failures, so a new breach was invisible. Every item is now a fix or a rebaseline. - Harness drift, fixed. Each harness had stopped producing numbers when runtime source it anchors on changed: - ssr-final-replay: a second suspended loop since 2026-09-29. - root-transactions/contracts: staged-DOM text and attribute journaling since 2026-09-15. - signal-dom-bindings: a second native style Block allocation site since 2026-09-23. - codegen-size: the server runtime's lazy streamed-signals chunk since 2026-09-16. - recursive-context: counted a pure-call annotation and trailing newlines as output growth. - Rebaselined, with numbers in each note: five cross-framework bundle-size ratios and the workerd script-size ratio. The absolute app and server-render budgets are now the ratchet. Lynx's no-worklet byte caps from 2026-08-17 are reset to measured + 32, with the background program pinned exactly. - Fix pending, with dated waivers that expire 2026-10-24, each with an owner task: - three exact counters the revived harnesses exposed (one extra closure per ssrTry, 128 live text reads per 128 unchanged compiled updates, compiled output at 1.295x its source); - Lynx create ratios and the re-entrant transport gate; - superlinear hydrate boundary preparation; - Octane Three versus R3F size and frame dispatch; - two timing regressions near the timer floor; - ten quick-mode timing guards whose samples are noise-bound; - the scoped descriptor shape change. - bench.mjs supports a guard `waiver` ({ reason, expires }). A waived breach prints and does not fail, and fails again once the date passes. HARNESS_FAILURE_ALLOWLIST now also covers a suite whose harness writes no numbers. The budget breaches (57) clear when the budget reset lands. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(benchmarks): pair and lengthen the timing samples behind waived ratio guards Twelve timing guards breached in weekly quick runs without a verdict. Their samples sat near Chromium's 100 µs clock or under two-sample noise, and each target ran its whole block minutes after the other side of its guard. - benchmarks/lib/paired.mjs: rotating per-round visit order and a ~20 ms sample calibration shared by the harnesses below. - js-framework-reorder, memo-wall, svg-dashboard, spa-navigation: every target's page stays open in one browser and each sample round visits all targets; short ops repeat until a sample takes about 20 ms (clicks, hook invocations, op batches, and summed navigation legs). - activity caught-reveal: a sample reveals several independent hidden roots in one window, with the small case revealing eight times as many roots so both cases do equal work; the cases alternate per round. - ssr-workerd: an untimed priming spawn per target, then paired cold-spawn rounds; quick mode runs six rounds instead of two. - bench.yml: a `suites` dispatch input to run selected suites. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(benchmarks): collect garbage before every timed spa-navigation leg The untimed return leg mounts a whole route, and its collection landed inside the next timed teardown: nav_teardown samples ran at 17-45% rme. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(benchmarks): re-judge the twelve waived timing guards with paired samples Two quick CI runs of the paired, ~20 ms harness and same-runner A/B runs against the commits that set each guard decided every waiver: - Passing, waiver removed: activity reports, ssr-workerd cold_spawn_to_first_byte, svg-dashboard pan_zoom, memo-wall parent_rerender_equal_A and octane-jsx mount, spa-navigation nav_teardown and nav_mount (no Octane change since #674 on one runner). - Rebaselined: svg-dashboard icon_swap 1.2 -> 1.6, because #983's esbuild minification made React 15% faster while Octane stayed flat. - Confirmed Octane regressions, waiver kept and pointed at the fix: js-framework-reorder rotateb (1.41x per click since #639), memo-wall one_change_B (1.5x) and ctx_through_wall_B (1.44x), and svg-dashboard tooltip_swarm (1.31x since #635). - The rotateb note claimed React moves every survivor; it moves one. A new rotatef guard covers the LIS-vs-lastPlacedIndex differentiator (0.043x). Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(benchmarks): rebaseline spa-navigation nav_mount to its CI baseline The 1.2 ceiling came from a local 0.94x reading. On CI runners #674 itself measures 1.15x and head 1.09-1.16x, so the ceiling left 3% of quick-mode headroom; 1.35 keeps a margin while still catching per-node mount growth. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): drop the three weekly waivers that now have fix PRs The waived guards now have owner PRs: ssr-final-replay try_closures (#1644), root-transactions equal_reads (#1643) and codegen-size gzip compiled/source (#1645). #1645 rebaselines the same codegen-size entry, so this branch no longer edits it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): leave lynx-render to its owner fix The lynx-render transport gate failure and the create_1k/create_10k ratio breaches both trace to #885's JSON-encoded transport and now have an owner fix. Its branch re-notes those two guards, so this branch drops their waivers and the suite's allowlist entry instead of editing the same entries. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): keep harness failures unwaivable and leave descriptor shapes to their owner Waiving a suite that throws before it writes numbers would hide any crash in that suite, not only the known shape change, and skip all of its guards. The scoped-descriptor-shapes defect has an owner fix in progress. That fix re-pins the harness's expected keys, so narrowing the waiver here would edit the same assertion. HARNESS_FAILURE_ALLOWLIST is empty again, and a thrown suite failure always fails the job. Dated waivers remain only on individual ratio guards. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): leave the Three guards to their owner fixes three-renderer frame_1k_subscribers and the two three-bundle-size ratios have owner PRs (#1651, #1652) that re-note and ratchet those entries, so this branch drops their waivers instead of editing the same entries. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(benchmarks): point the four kept timing waivers at their attributed fixes rotateb and ctx_through_wall_B clear with #1655 and #1656; one_change_B's per-row remainder and tooltip_swarm's scoped-descriptor accessor reads each have their own fix task. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(benchmarks): point parent_rerender_equal_A's note at its per-commit journal fix 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
…1641) * ci(bench): triage the weekly ratio-guard breaches so new ones show The weekly Bench job (`bench.mjs --quick --ratios`) was red with 81 ratio breaches, 4 suites that wrote no numbers and 4 harness gate failures, so a new breach was invisible. Every item is now a fix or a rebaseline. - Harness drift, fixed. Each harness had stopped producing numbers when runtime source it anchors on changed: - ssr-final-replay: a second suspended loop since 2026-09-29. - root-transactions/contracts: staged-DOM text and attribute journaling since 2026-09-15. - signal-dom-bindings: a second native style Block allocation site since 2026-09-23. - codegen-size: the server runtime's lazy streamed-signals chunk since 2026-09-16. - recursive-context: counted a pure-call annotation and trailing newlines as output growth. - Rebaselined, with numbers in each note: five cross-framework bundle-size ratios and the workerd script-size ratio. The absolute app and server-render budgets are now the ratchet. Lynx's no-worklet byte caps from 2026-08-17 are reset to measured + 32, with the background program pinned exactly. - Fix pending, with dated waivers that expire 2026-10-24, each with an owner task: - three exact counters the revived harnesses exposed (one extra closure per ssrTry, 128 live text reads per 128 unchanged compiled updates, compiled output at 1.295x its source); - Lynx create ratios and the re-entrant transport gate; - superlinear hydrate boundary preparation; - Octane Three versus R3F size and frame dispatch; - two timing regressions near the timer floor; - ten quick-mode timing guards whose samples are noise-bound; - the scoped descriptor shape change. - bench.mjs supports a guard `waiver` ({ reason, expires }). A waived breach prints and does not fail, and fails again once the date passes. HARNESS_FAILURE_ALLOWLIST now also covers a suite whose harness writes no numbers. The budget breaches (57) clear when the budget reset lands. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): drop the three weekly waivers that now have fix PRs The waived guards now have owner PRs: ssr-final-replay try_closures (#1644), root-transactions equal_reads (#1643) and codegen-size gzip compiled/source (#1645). #1645 rebaselines the same codegen-size entry, so this branch no longer edits it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): leave lynx-render to its owner fix The lynx-render transport gate failure and the create_1k/create_10k ratio breaches both trace to #885's JSON-encoded transport and now have an owner fix. Its branch re-notes those two guards, so this branch drops their waivers and the suite's allowlist entry instead of editing the same entries. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): keep harness failures unwaivable and leave descriptor shapes to their owner Waiving a suite that throws before it writes numbers would hide any crash in that suite, not only the known shape change, and skip all of its guards. The scoped-descriptor-shapes defect has an owner fix in progress. That fix re-pins the harness's expected keys, so narrowing the waiver here would edit the same assertion. HARNESS_FAILURE_ALLOWLIST is empty again, and a thrown suite failure always fails the job. Dated waivers remain only on individual ratio guards. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(bench): leave the Three guards to their owner fixes three-renderer frame_1k_subscribers and the two three-bundle-size ratios have owner PRs (#1651, #1652) that re-note and ratchet those entries, so this branch drops their waivers instead of editing the same entries. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The weekly root-transactions guard
equal_reads(targettext-compiled, referencetext-compiled-work, maxRatio 0) breaches on main. Compiled text bindings make 128 livenodeValuereads across 128 unchanged updates, and the guard allows none. The breach went unnoticed becausebenchmarks/root-transactions/contracts.mjscrashed from 2026-09-15 until the weekly triage re-anchored it.Cause.
git bisect runovercontracts.mjs <checkout> --reads-only, starting from the guard's origin 3c1cc55 (#1079, where it measured 0), names 5ead1ff (#1069, async signals and streaming SSR).<span>{props.label}</span>compiled to_$childTextHoleUpdate(__s, 1, host, _v, _b.c, _b.d). That call guards on the raw previous value_b.d._$bindSignalChild(…, onlyChild = true).updateTextValue, which readsnodeValueto tell an unchanged value from a changed one.!onlyChild).The same path also changed behaviour. An unchanged value overwrote an outside edit to the text. React leaves the DOM alone when the props are equal, and so did Octane before #1069.
Changes
bindSignalChild's only-child path now keeps the last written primitive as its token, as #1591 does for marker-bounded holes.dangerouslySetInnerHTMLOwnsChildstill runs first, so raw HTML and children stay mutually exclusive.firstChildcomparison, because hydration can keep unclaimed server content ahead of the Text node it appends. Main updates that node correctly in this case; an earlier draft of this fix did not, and the new mismatch tests pin it.Cost per update:
nodeValuereadnodeValueread + writefirstChildread + writeA mount costs no extra DOM read. Hydration costs one
firstChildcomparison per hole.Validation
node benchmarks/root-transactions/contracts.mjs, with the weekly triage's re-anchored harness applied locally (uncommitted; it is not part of this PR):App 128/128;App changed 128 / equal 0,DescriptorApp 128/128(its guard allows 1×);packages/octane/tests/hydration/direct-signal-bindings.test.ts:characterDatamutation. The test also walkstrue, an element, a signal handle and back, checking a single child at every step. It fails on main (expected '1' to be 'edited').<b>x</b>, a comment, and<b>x</b>tail, updates write the appended client Text node and keep the server nodes. All three fail with a hydration-blind publication guard.dangerouslySetInnerHTMLOwnsChild.nullinstead offirstChildfails two of the new tests.vitest --project octane:direct-signal-bindings,mismatch-sibling-holeandmismatch-structuralpass (552 tests). The new tests also pass in--project octane-prod.pnpm typecheck:filesandpnpm format:files:checkon the changed files.run-minimal.mjs --budgets root-static-local root-chained-jsx hooks-state prop-attributes context) pass, and the signal-free fixtures are byte-identical. In an esbuild bundle that reachesbindSignalChild(bindSignalChildpluscreateRoot), the change costs +194 raw / +29 gzip / +3 brotli.bindSignalChildgrows by +194–196 raw, +45–76 gzip, and −34 to +86 brotli:root-static, theoctane-jsxapp, and the Base UI, Radix and Apollo binding bundles.pnpm test,pnpm typecheckandpnpm format:check, which are left to CI.Risk / follow-ups
Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches core
bindSignalChildDOM update paths for a common JSX pattern, including hydration edge cases, though behavior is narrowed and heavily regression-tested.Overview
Signal-capable only-child text holes (e.g.
<p>{props.value}</p>viabindSignalChild) no longer use the Text node as their binding token. They now keep the last written primitive, matching marker-bounded compiled text holes.Unchanged primitives return early after a raw-value check (still running
dangerouslySetInnerHTMLOwnsChild), so there is nonodeValueread on equal updates and outside DOM edits are not clobbered. Changed values still rewrite the same Text node, with token adoption rules for client mount, hydration when server nodes sit ahead of the adopted text, and staged ViewTransition renders.Adds hydration/direct-signal tests for unchanged-value no-ops, server Text node identity, mismatch append cases, and raw HTML rejection beside an unchanged child.
Reviewed by Cursor Bugbot for commit 9038a91. Bugbot is set up for automated code reviews on this repo. Configure here.