Skip to content

fix(signals): a Loading fallback is born held only when the output that builds it read the hold (#4428) - #4464

Merged
ryansolid merged 17 commits into
nextfrom
claude/project-thread-x1ore2-4428
Oct 30, 2026
Merged

ryansolid merged 17 commits into
nextfrom
claude/project-thread-x1ore2-4428

Conversation

@ryansolid

@ryansolid ryansolid commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Before: fallback() builds the boundary's fallback memo with runWithOwner(out._parent, () => computed(...)), beside the output and while the output's own pass is running. The memo's first pass ran at creation, under the output's owner. So the born-held check at the close of that pass read the enclosing pass's flag, not the output's. Under a mount that read a hold, the fallback was born held even though the pass creating it (the output) read nothing held. The fallback then waited with that hold.

After: the fallback is born held only when the output pass that builds it read the hold (D-27, one level: "a node it creates during that pass").

How: the fallback memo is created lazy. Its first pass runs in the output's read(b._fb) just below, in the output's context, so the born-held check asks the output. It stays owned by out._parent, so the walk over running owners for #4341 is unchanged. Lazy also releases it when its one reader, the output, stops reading it, which happens where drop disposes it or where a held swap commits. The old CONFIG_AUTO_DISPOSE clear is therefore dropped. The option is written lazy: 1 to save a byte. The seat shadow's known entry for #4428 is removed, since it could now only hide a regression.

Size vs next @ ab3d2ad, measured locally (linux): +7 B minified on bundles with a boundary, and hello world +0. Next already sits 15 B over the app: hydrating (no stores) frozen floor's recorded minified (13 B before #4463, 2 B from it), so this PR's 7 B take it to +22, past the 20 B allowance. Its cap stays at 18.74 KB and its recorded minified rises 53,585 → 53,607. page: compiled live server components goes 42.73 → 42.75 KB (recorded minified 125,518 → 125,540): it is 25 B brotli over next, and next already sits 15 B over its record.

Size-Exception: the hydrating (no stores) floor's recorded minified rises 53,585 → 53,607 (cap unchanged at 18.74 KB): 7 B are the lazy fallback memo that fixes #4428's born-held fallback, and the rest is next's own growth since the record. Correctness.

Tests: new packages/signals/tests/fallback-born-creator-4428.test.ts, which fails on next. Signals 6,026 passed after merging next. Before that merge, web 1,560 and hydrate 716 passed. Server 1,905 passed; the only failure was the known server-functions-adapter-request (#3311).

Fixes #4428


Generated by Claude Code

claude added 12 commits October 30, 2026 08:45
… builds it (#4428)

`fallback()` builds the boundary's fallback memo beside the output,
`runWithOwner(out._parent, () => computed(...))`, while the output's own
pass runs. The memo's first pass ran at creation, in the output's owner, so
the born-held test at its close (`creatorPass(oldcontext)` JOINED) read the
enclosing pass's flag: under a mount that read the hold, the fallback was
born held though the pass creating it, the output, read nothing held.

Create the memo lazy. Its first pass runs in the output's `read(b._fb)` just
below, in the output's context, so born held asks the output (D-27, one
level: "a node it creates during that pass"). It stays owned by
`out._parent`, so the walk over running owners for #4341 is unchanged.
CONFIG_AUTO_DISPOSE, which `lazy` sets, is cleared: the fallback lives
until `drop()` disposes it, as before.

Fixes #4428

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
Resolves the generated RULES-INDEX.md (regenerated) after #4438.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
… pass)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
…s it (#4428)

Drop the CONFIG_AUTO_DISPOSE clear: the fallback memo's one reader is the
output, and the output stops reading it only where `drop` disposes it or a
held swap commits, so the release lands with the disposal it already had.
The clear cost 9 B minified and reshuffled the prop mangler's names across
every bundle (±50–100 B brotli with 0 B minified on scenarios without a
boundary).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
…-x1ore2-4428

# Conflicts:
#	scripts/size/scenarios.js
…nified)

Frozen floor 18.74 KB -> 18.79 KB, recorded minified 53,585 -> 53,606 B
(+8 B this fix; the rest is next's growth since the floor was recorded).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
…-x1ore2-4428

# Conflicts:
#	packages/signals/docs/RULES-INDEX.md
@changeset-bot

changeset-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6b7da5e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@solidjs/signals Patch
test-integration Patch
@solidjs/web Patch
@solidjs/babel-plugin Patch
@solidjs/compiler Patch
@solidjs/diagnostics Patch
@solidjs/element Patch
@solidjs/h Patch
@solidjs/html Patch
solid-js Patch
@solidjs/universal Patch
board-example Patch
canvas-example Patch
server-dbmon-example Patch
todos-server-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Size (brotli, eager entry chunk)

scenario head vs base minified vs base minified vs recorded cap lazy chunks (not counted)
signals: core floor (createSignal/Memo/Effect/Root/flush) 7.42 KB 0 B 0 B +15 B 7.43 KB ✅
signals: + createStore 14.96 KB 0 B 0 B +6 B 14.97 KB ✅
signals: + isPending/latest 11.11 KB 0 B 0 B +15 B 11.12 KB ✅
signals: + until/refresh (truth readers, no optimism) 8.05 KB 0 B 0 B +2 B 8.06 KB ✅
app: render + one signal (the simple-app floor) 9.78 KB 0 B 0 B +15 B 9.78 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 18.75 KB +18 B (+0.1%) +7 B 0 B 18.74 KB ⚠️ over by 12 B, 20 B minified headroom lazy-page.js 0.04 KB
app: hydrating + every store primitive family 32.38 KB +17 B (+0.1%) +7 B +13 B 32.48 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.45 KB +23 B (+0.2%) +7 B +9 B 13.47 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 15.20 KB +11 B (+0.1%) +7 B +9 B 15.20 KB ⚠️ over by 1 B, 11 B minified headroom lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 29.78 KB +13 B (+0.0%) +7 B +9 B 29.78 KB ✅ lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 9.97 KB 0 B 0 B +2 B 9.98 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 26.33 KB +6 B (+0.0%) +7 B +13 B 26.33 KB ⚠️ over by 3 B, 7 B minified headroom stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 32.45 KB −67 B (−0.2%) +7 B +7 B 32.54 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.75 KB 0 B 0 B 0 B 11.77 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 33.67 KB +5 B (+0.0%) +7 B +9 B 33.77 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.03 KB, wire.js 3.47 KB
page: live server components (base + live/GET + action + isPending/latest) 38.80 KB +23 B (+0.1%) +7 B +22 B 38.85 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.03 KB, wire.js 3.47 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 35.72 KB +11 B (+0.0%) +7 B +9 B 35.72 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.06 KB, sc-comments.js 0.20 KB, trace.js 9.01 KB, wire.js 3.47 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 42.73 KB +25 B (+0.1%) +7 B 0 B 42.75 KB ✅ eager (counted): web.js 22.77 KB; assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.07 KB, sc-comments.js 0.19 KB, trace.js 9.05 KB, wire.js 3.47 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.11 KB −120 B (−0.3%) +7 B +7 B 41.25 KB ✅ assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, server.js 1.03 KB, serverForms.js 3.57 KB, trace.js 9.03 KB, wire.js 3.48 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 48.37 KB −46 B (−0.1%) +7 B +22 B 48.44 KB ✅ eager (counted): client.js 27.90 KB; assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.07 KB, server.js 1.03 KB, serverForms.js 3.30 KB, trace.js 9.03 KB, wire.js 3.49 KB
server: floor (getRequestEvent + isServer) 1.27 KB 0 B 0 B 0 B 1.29 KB ✅
server: renderToString (the server-render floor) 22.79 KB 0 B 0 B 0 B 22.80 KB ✅

⚠️ Over the brotli cap within the minified allowance (passes)

  • app: hydrating (no stores) with Show/For/Loading/Errored/lazy: over brotli cap by 12 B; minified 53,607 B vs 53,607 B recorded with the cap (+0 B) — 20 B of the 20 B minified allowance left; +7 B minified over this PR's base
  • app: CSR, observe tier (same app on the observe artifacts): over brotli cap by 1 B; minified 41,991 B vs 41,982 B recorded with the cap (+9 B) — 11 B of the 20 B minified allowance left; +7 B minified over this PR's base
  • app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store): over brotli cap by 3 B; minified 80,048 B vs 80,035 B recorded with the cap (+13 B) — 7 B of the 20 B minified allowance left; +7 B minified over this PR's base

Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in scripts/size/scenarios.js; the floor and page caps in floor-caps.json are frozen (lower only, or Size-Exception: in the PR body). npm run ratchet lowers caps per RC; it never raises one (scripts/size/README.md).

@coveralls

coveralls commented Oct 30, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 41089801789

Coverage remained the same at 78.1%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1362
Covered Lines: 1125
Line Coverage: 82.6%
Relevant Branches: 1090
Covered Branches: 790
Branch Coverage: 72.48%
Branches in Coverage %: Yes
Coverage Strength: 29.77 hits per line

💛 - Coveralls

@codspeed

codspeed Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 8.78%

2 warnings

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 2 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 2 improved benchmarks
✅ 198 untouched benchmarks
⏩ 5 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ arrow in template 12.1 ms 11 ms +9.84%
⚡ memo + sync render effect only (reference) 34.7 ms 32.2 ms +7.73%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/project-thread-x1ore2-4428 (6b7da5e) with next (ab3d2ad)

Open in CodSpeed

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

The byte keeps the hydrating floor inside its minified allowance, so the
frozen floor raise and its Size-Exception go. The seat shadow's known
entry for #4428 could now only hide a regression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
…ext; rewrap the fallback comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
…-x1ore2-4428

Both sides drop a seat known entry (#4428 here, #4429 on next); both stay
dropped. Compiled live re-recorded over next @ ab3d2ad.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants