Skip to content

fix(signals): a derived store's write in a lane pass is the lane's derivation - #4478

Merged
ryansolid merged 10 commits into
nextfrom
claude/project-thread-x1ore2-store-lane-leaf
Oct 30, 2026
Merged

ryansolid merged 10 commits into
nextfrom
claude/project-thread-x1ore2-store-lane-leaf

Conversation

@ryansolid

@ryansolid ryansolid commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Before: take createStore(d => { d.v = m() }) with m = createMemo(() => 1 + latest(s)), and an action that writes s and stays open. m is a verdict reader, so its pass runs in the action's verdict lane and shows the new value at once (F-6, D-25). The derive reads m, so its pass is that lane's work too. Its leaf writes, though, were plain stagings that parked with the action, so the store showed the old value until the action ended while the memo showed the new one.

After: the store shows what the memo shows. A derive's write in a lane pass is the lane's derivation, the same way a memo derived from m publishes into the lane.

How: in holdWithDerive (store/store.ts), a leaf write in a lane pass (passLane, not a user write) becomes the lane's derivation on the leaf. It lists the node on the lane, sets _x._lane and CONFIG_OVERRIDE, and leaves the committed value untouched underneath; the lane's end commits it. The branch is gated on the lane engine (laneStageHook), so store bundles without lanes pay 0 B.

Size vs next @ d0fc285 (after #4479), measured locally (linux). Only bundles with lanes pay; the CI size report has the exact brotli deltas.

scenario minified delta cap
hello world, core, createStore, compiled CSR, compiled hydrating, every non-lane scenario 0 unchanged
page: base server components (frozen floor) +28 unchanged at 33.77 KB (33,711 B); recorded minified 101,638 → 101,675 (Size-Exception)
page: live server components (frozen floor) +17 38.91 → 38.93 KB (38,919 B); recorded minified 117,566 → 117,583 (Size-Exception)
page: compiled base server components +32 35.72 → 35.76 KB
page: compiled live server components +17 unchanged; recorded minified re-recorded
app: hydrating + every store primitive, page: base + router, page: live + router +13 to +83 unchanged; recorded minified re-recorded

Size-Exception: the base and live server-components floors carry the derived store's lane-pass write (D-25, F-6), gated on the lane engine. Base server components keeps its 33.77 KB cap and re-records its minified 101,638 → 101,675 (+28 B of this PR, the rest next's own drift). Live server components goes 38.91 → 38.93 KB and re-records 117,566 → 117,583. Hello world and the core, simple-app and hydrating floors are unchanged. Correctness.

How did you test this change?

  • New packages/signals/tests/derived-store-lane-derive.test.ts and packages/web/test/async-gen/store-derive-lane-e3.spec.ts.

  • Suites after merging next @ d0fc285:

    suite passed expected fail
    signals 6,055 17
    web 1,569 7

Found by the async-gen rerun on rc.20 (pair E3, rows #2 and #7).


🤖 Generated with Claude Code

https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2

…rivation

`createStore(d => { d.v = m() })` with `m = createMemo(() => 1 + latest(s))`.
An action writes `s` and stays open: `m` is a verdict reader, so its pass
runs in the action's verdict lane and shows the new value now (F-6, D-25).
The derive reads `m`, so its pass is that lane's work too, but its leaf
writes are plain signal writes: they were staged in the flush, which joined
the action, and the store showed the old value until the action ended. A
memo derived the same way publishes into the lane. The derive's write in a
lane pass now becomes the lane's derivation on the leaf (its value the
lane's, the committed value untouched beneath; the lane's end commits it).

Found by the async-gen rerun on rc.20 (pair E3, rows #2 and #7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
Re-measured after merging next @ ab3d2ad: the same bytes; the ledger
lines name the new base.

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

changeset-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5c002e8

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.19 KB 0 B 0 B 0 B 11.19 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 0 B 0 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.44 KB −31 B (−0.1%) +83 B +83 B 32.48 KB ✅ lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.45 KB 0 B 0 B +9 B 13.47 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 15.19 KB 0 B 0 B +9 B 15.20 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 29.75 KB 0 B 0 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 0 B 0 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 0 B 0 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.71 KB +39 B (+0.1%) +28 B +37 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.10 KB, wire.js 3.47 KB
page: live server components (base + live/GET + action + isPending/latest) 38.92 KB +7 B (+0.0%) +17 B +35 B 38.91 KB ❌ over by 6 B assets.js 0.78 KB, decode.js 7.09 KB, lazy-page.js 0.04 KB, regions.js 1.06 KB, trace.js 9.11 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.74 KB +29 B (+0.1%) +32 B +41 B 35.72 KB ❌ over by 25 B assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.06 KB, sc-comments.js 0.20 KB, trace.js 9.06 KB, wire.js 3.47 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 42.87 KB +8 B (+0.0%) +17 B +17 B 42.87 KB ✅ eager (counted): web.js 22.89 KB; assets.js 0.78 KB, decode.js 7.09 KB, regions.js 1.08 KB, sc-comments.js 0.19 KB, trace.js 9.08 KB, wire.js 3.47 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.21 KB +100 B (+0.2%) +26 B +33 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.59 KB, trace.js 9.06 KB, wire.js 3.48 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 48.47 KB −17 B (−0.0%) +13 B +13 B 48.51 KB ✅ eager (counted): client.js 28.00 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.06 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; +0 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; +0 B minified over this PR's base

❌ Fails the gate

  • page: live server components (base + live/GET + action + isPending/latest): over brotli cap by 6 B; minified 117,601 B vs 117,566 B recorded with the cap (+35 B) — 15 B past the 20 B minified allowance; +17 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)
  • page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread): over brotli cap by 25 B; minified 108,048 B vs 108,007 B recorded with the cap (+41 B) — 21 B past the 20 B minified allowance; +32 B minified over this PR's base. real growth: reduce it, or raise the cap and its recorded minified in this PR with a reason (frozen floors need Size-Exception:)

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 41109664498

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.7 hits per line

💛 - Coveralls

@codspeed

codspeed Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 2.74%

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

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 198 untouched benchmarks
⏩ 5 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ arrow in template 11.1 ms 12.4 ms -10%
⚡ polymorphic-chain mount+clear 1000 rows: compiled 428.9 ms 408.1 ms +5.1%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/project-thread-x1ore2-store-lane-leaf (5c002e8) with next (c8d6fd2)

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

Copy link
Copy Markdown
Member Author

CodSpeed flags projection derive: write one NESTED field (reference) at −12% (2.1 → 2.4 ms). I don't think that comes from this PR:

  • The bench is noisy on its own, with swings this size on PRs that don't touch the store path.
  • CodSpeed reports that 2 changed benchmarks ran on different hardware for base and head.
  • The opposite swing shows up in the same report: arrow in template +9%, which is server-only code this PR doesn't touch.

This PR changes only holdWithDerive's lane write, which a plain projection write with no hold never reaches.

I'll leave the check as it is rather than re-run it. If it reproduces on the next push that carries code, I'll profile the bench against next on the same runner.


Generated by Claude Code

…gine

Store bundles without lanes pay 0 B: createStore and compiled CSR and
hydrating drop their cap raises. The lane bundles re-record.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
@ryansolid
ryansolid merged commit bb7f9b5 into next Oct 30, 2026
7 of 8 checks passed
ryansolid added a commit that referenced this pull request Oct 30, 2026
…4475, #4478, #4459) (#4501)

Next @ 643a7a7 sits over four caps after the batch merged back to back
(each fix PR carried no ledger edits, per the batch process). Re-records,
measured over next @ 643a7a7 (linux):

- signals: + isPending/latest: 11.19 -> 11.29 KB, minified 30,840 -> 31,101
- page: live server components (frozen floor): 38.91 -> 38.98 KB,
  minified 117,566 -> 117,858
- page: compiled live server components: 42.87 -> 42.95 KB,
  minified 125,724 -> 126,018
- page: live + router: 48.51 -> 48.58 KB, minified 142,987 -> 143,269

and the recorded minified only (caps unchanged) where the batch drifted
more than 20 B: hydrating + every store (98,463 -> 98,535), base server
components (frozen, 101,638 -> 101,675), compiled base server components
(108,007 -> 108,048), base + router (125,470 -> 125,503).

Hello world is unchanged at 9,973 B (cap 9.98 KB).


Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2

Co-authored-by: Claude <noreply@anthropic.com>
ryansolid added a commit that referenced this pull request Oct 31, 2026
… derives from (#4451) (#4522)

A derive's lane-pass write to a key nobody had read yet stages on the
container (`stageOn` → `holdWithDerive` lists it in the lane, #4478); the
leaf born from that staging in the same flush was a plain staging the park
then held with the frame, so frame readers saw the committed `undefined`
beneath while the memo the derive reads showed the lane's value. An
`Errored` over the store stayed on its fallback until the action landed; a
memo over the key derived NaN.

`bornStaged` now hands a leaf born from a lane container's staging (OVERRIDE
without GUESS) to `holdWithDerive` with the container's lane: the staging
becomes the lane's derivation, as the write would have left a leaf that
existed then (E3, D-25, D-39). `holdWithDerive`'s `userWrite` discriminator
moves to its callers so the born leaf — a read, possibly inside a user
setter's body — is classified by the container's staging, not the caller's.

The #4137 pin's mid-action screen changes from `["a",null]` to `["a","b"]`
(accepted by the maintainer): the derive's new key is the lane's derivation
for a leaf born after the write as for one that existed; the memo twin
shows `["a","b"]` on both.

Size: "app: hydrating + every store primitive family" 32.48 -> 32.50 KB
(+48 B minified / +58 B brotli over next on that scenario; core floor,
hello world and every bundle without stores 0 B). Accepted by the
maintainer.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude <noreply@anthropic.com>
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