Skip to content

fix(signals): a Show branch mounted by a held write reads the value that mounted it (#4010) - #4027

Merged
ryansolid merged 4 commits into
nextfrom
claude/project-thread-w8qjvi-4010
Oct 13, 2026
Merged

ryansolid merged 4 commits into
nextfrom
claude/project-thread-w8qjvi-4010

Conversation

@ryansolid

@ryansolid ryansolid commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Requested by Ryan · project thread

Fixes #4010.

Before: when a held write mounts a <Show> branch, a binding inside it that re-runs before the transaction lands (an isPending reader, or a plain binding re-run by a live write) is served the committed screen, where the Show condition is still null. item().name throws into <Errored>, and since #3977 the unchanged landing never re-runs it, so the error sticks.

After: the branch's bindings read the transaction that mounted them until it lands. No error, and the final screen is correct.

How: holdFrame already visits exactly the held frame's members, so it now tags each with an internal CONFIG_HELD_FRAME bit (cleared in commitPendingNode with CONFIG_HELD, and defensively at the three lane sites that drop CONFIG_HELD). A new internal bornInto(c, t) treats a tagged member like a never-run node, born into t. It is used in frameRead, stagedScreen and recompute. observeFlight (in verdict.ts, so only isPending/latest users pay) makes such a member wait on its own transaction's flight; without that gate a keyed branch that probes and reads the flight loops forever. Each of the four sites is needed: removing any one fails at least one new test.

Size

+89 B minified in the always-loaded signals core (+121 B with isPending/latest). Ten scenarios crossed their caps; each is raised to measured + 10 B rounded up to 0.01 KB, with a dated ledger note in scripts/size/scenarios.js. Two of them are frozen floor caps in floor-caps.json: core floor 7.45 -> 7.48 KB and the simple-app floor 9.94 -> 9.98 KB. Hello world stays under 10 KB at 9,966 B.

Size-Exception: accepted by the maintainer (2026-10-13) — #4010's held-frame tag lives in the always-loaded core read path; hello world stays under 10 KB.

Behavior note

A never-run verdict reader that reads its own transaction's held flight now waits on it instead of seeing the committed value. Consistent with A29 ("a node born into the future has no screen"); no existing test pinned the old behavior.

Public API changes

None. bornInto and CONFIG_HELD_FRAME are internal.

How did you test this change?

  • packages/signals/tests/held-branch-verdict-reader-4010.test.ts (4 tests) and packages/web/test/show-held-branch-verdict-reader-4010.spec.tsx (the reporter's repro, count 0 and 1). All fail on unmodified next.
  • signals 5201 passed; solid-js 856/856; web jsdom 1391/1391; web hydrate unchanged; web server has 1 failure that also fails on next (server-functions-adapter-request.spec.tsx). Typecheck clean.
  • scripts/size: every scenario within its cap; check-floor-caps passes with the Size-Exception line.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NcUAu8BQ6Xsf8XRBhr9V1w

…hat mounted it (#4010)

A binding in a branch a held pass mounted is a member of that pass's held
frame (ruling A): the branch exists only in the transaction. Only a member
that had never run (STATUS_UNINITIALIZED) was treated as born into it; one
whose first pass published before the seam held it was served the
committed screen whenever it ran again before the landing — `frameRead`
made it a stale reader, `recompute` published it mainline, and
`stagedScreen` served a verdict reader the committed value in the
transaction's own flush. A non-keyed Show's narrowed accessor then read the
committed `null` and threw into <Errored>; since #3977 an unchanged landing
left the error up.

The park seam now flags every member of a held pass's frame
(CONFIG_HELD_FRAME, cleared by its commit), and `bornInto(c, t)` — held by
t and uninitialized or flagged — replaces the uninitialized-only test in
`recompute`, `frameRead` and `stagedScreen`. `observeFlight` likewise no
longer serves such a verdict reader the committed value of its own
transaction's flight: it waits with its frame. Without that, a member that
probes and reads the flight let the transaction land under it and was
re-derived into a fresh observation every round (an infinite flush loop).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NcUAu8BQ6Xsf8XRBhr9V1w
@changeset-bot

changeset-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 73c288c

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

This PR includes changesets to release 13 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
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 13, 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.47 KB +25 B (+0.3%) +89 B 0 B 7.48 KB ✅
signals: + createStore 14.93 KB +48 B (+0.3%) +89 B 0 B 14.94 KB ✅
signals: + isPending/latest 9.75 KB +47 B (+0.5%) +121 B 0 B 9.77 KB ✅
app: render + one signal (the simple-app floor) 9.97 KB +47 B (+0.5%) +89 B 0 B 9.98 KB ✅
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 17.89 KB +51 B (+0.3%) +89 B −77 B 17.93 KB ✅ lazy-page.js 0.04 KB
app: hydrating + every store primitive family 29.44 KB −15 B (−0.1%) +100 B +128 B 29.50 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.05 KB +46 B (+0.4%) +89 B 0 B 13.07 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 14.62 KB +2 B (+0.0%) +89 B 0 B 14.64 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 28.98 KB +54 B (+0.2%) +89 B 0 B 29.00 KB ✅ lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 10.15 KB +16 B (+0.2%) +89 B 0 B 10.17 KB ✅
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 25.74 KB +93 B (+0.4%) +89 B 0 B 25.75 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 31.61 KB +49 B (+0.2%) +89 B 0 B 31.62 KB ✅ stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.43 KB 0 B 0 B 0 B 11.43 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 34.17 KB +90 B (+0.3%) +89 B −1626 B 34.33 KB ✅ assets.js 0.78 KB, bind.js 1.83 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, trace.js 8.99 KB, wire.js 0.93 KB
page: live server components (base + live/GET + action + isPending/latest) 37.87 KB +13 B (+0.0%) +121 B −1682 B 38.15 KB ✅ assets.js 0.78 KB, bind.js 1.83 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, trace.js 8.99 KB, wire.js 0.93 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 34.95 KB −18 B (−0.1%) +89 B −2704 B 35.66 KB ✅ assets.js 0.78 KB, bind.js 1.83 KB, decode.js 6.23 KB, regions.js 0.80 KB, sc-comments.js 0.20 KB, trace.js 8.95 KB, wire.js 0.93 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 40.55 KB +46 B (+0.1%) +138 B −2697 B 41.21 KB ✅ eager (counted): web.js 21.50 KB; assets.js 0.78 KB, bind.js 1.84 KB, decode.js 6.23 KB, regions.js 0.79 KB, sc-comments.js 0.19 KB, trace.js 8.93 KB, wire.js 0.93 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.49 KB +117 B (+0.3%) +83 B −1619 B 41.79 KB ✅ assets.js 0.78 KB, bind.js 1.85 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, server.js 1.02 KB, serverForms.js 3.58 KB, trace.js 8.98 KB, wire.js 0.94 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 47.21 KB +24 B (+0.1%) +139 B −1612 B 47.49 KB ✅ eager (counted): client.js 27.69 KB; assets.js 0.78 KB, bind.js 1.84 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.81 KB, server.js 1.02 KB, serverForms.js 3.30 KB, trace.js 8.96 KB, wire.js 0.94 KB
server: floor (getRequestEvent + isServer) 1.33 KB 0 B 0 B 0 B 1.34 KB ✅
server: renderToString (the server-render floor) 20.47 KB 0 B 0 B 0 B 20.48 KB ✅

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

Copy link
Copy Markdown
Member Author

The Size check is red because of this PR: the fix adds +89 B minified to always-loaded floor code, which puts 10 scenarios over their caps (core floor by 18 B, compiled CSR by 86 B, the rest by 17 to 37 B). It's not a flake, so I haven't re-run it. The floor caps are frozen, so this waits on a maintainer decision: either raise the caps with a Size-Exception note, or find an offset elsewhere in the floor. The tests are green.

— Claude via Claude Code


Generated by Claude Code

@coveralls

coveralls commented Oct 13, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 38436719295

Coverage remained the same at 77.429%

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: 1321
Covered Lines: 1079
Line Coverage: 81.68%
Relevant Branches: 1036
Covered Branches: 746
Branch Coverage: 72.01%
Branches in Coverage %: Yes
Coverage Strength: 27.13 hits per line

💛 - Coveralls

@codspeed

codspeed Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 9.56%

⚠️ 2 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 2 improved benchmarks
✅ 193 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ createStore setter: delete + set one root key (#3044 overlay) 2.1 ms 1.8 ms +13.5%
⚡ memo + sync render effect only (reference) 28.2 ms 26.6 ms +5.75%

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-w8qjvi-4010 (73c288c) with next (25935fe)

Open in CodSpeed

Accepted by the maintainer: +89 B minified in the always-loaded signals
core. Each cap is set at measured + 10 B rounded up to 0.01 KB; hello
world stays under 10 KB (9,966 B).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NcUAu8BQ6Xsf8XRBhr9V1w

Copy link
Copy Markdown
Member Author

Two red checks, neither from the fix's code:

  • Size check: every scenario is now within its raised cap. Only the check-floor-caps step fails, because it reads SIZE_EXCEPTION from the pull_request event payload, which still holds the PR body from before the Size-Exception: line was added. Editing the body doesn't fire a new event and a re-run reuses the old payload, so it passes on the next push to this branch.
  • CodSpeed: dbmon shallow full tick reads −7%. CodSpeed flags that it compared across different runtime environments, the same code (b26f40e) showed no change on its earlier run, and that store benchmark never enters a held frame. I've re-run the benchmarks once.

— Claude via Claude Code


Generated by Claude Code

@ryansolid
ryansolid merged commit c9027a9 into next Oct 13, 2026
7 checks passed
ryansolid pushed a commit that referenced this pull request Oct 13, 2026
…-w8qjvi-4007

Resolves the attribution scenario cap conflict with #4027: keeps next's
#4010 note and re-measures this PR on top of it (28,984 -> 29,230 B, cap
29.24 KB), accepted by the maintainer 2026-10-13.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NcUAu8BQ6Xsf8XRBhr9V1w
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