Skip to content

Commit f3b4362

Browse files
committed
Merge branch 'next' into claude/project-thread-x1ore2-4525
Resolve the _laneRebase keyFn lines over the store family rename (#4494) and read the guess-site derive through `t._fam`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
2 parents 91f783e + e44f824 commit f3b4362

26 files changed

Lines changed: 647 additions & 123 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@solidjs/signals": patch
3+
---
4+
5+
An error boundary no longer hands its reader an error that was superseded inside the same transition (#4527). Here is the case: an action keeps its transition open, the store's re-ask is rejected (that rejection is staged, D-41), and a second re-ask answers before the commit. An effect whose compute created `createErrorBoundary(() => store, …)` used to get the fallback at the commit and never ran again. Now it gets the answer, as the screen does.
6+
7+
Two changes make that work. First, a pass that a derived store's pull throws a staged error into is now linked to the store's derive, including the untracked shape probe of a returned proxy. That way the re-ask and the answer that supersede the error reach the memo. Second, an error boundary no longer waits for first content: one that has not shown content reveals a recovery that lands in the hold it caught the error in together with that hold's commit, instead of keeping its fallback past it.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/signals": patch
3+
---
4+
5+
A derived store (or memo) reading a keyed optimistic store through `latest()` now picks up a confirmed row after a correction folded the truth beneath the guess: a confirming truth landing re-derives the `latest()` readers too.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/signals": patch
3+
---
4+
5+
Smaller store bundles: the store family field (`_fam`) and its `_overlaid`, `_asked`, `_woke` and `_shallow` fields are now `_`-prefixed internals, so the prod and observe builds mangle them (no behavior change).

‎packages/signals/docs/RULES-DERIVED.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ An armed boundary catches a lane the same way it catches a transition (D-12, D-1
180180

181181
**From:** F-6, F-10, F-9. **Scenarios:** S-25, S-45.
182182

183-
`latest(x)` answers the held write (the newest value a flush has processed, held or not — for a memo nobody has read, the value the flushes it missed would have given it), the optimistic value where one displays, the arrived truth under a superseded override, and the committed value of a node whose own flight is up (below the async nothing newer exists). A sync derivation of a held source is visible through it (the held recompute is a write path like any other). It throws `NotReadyError` only when no value has been produced — before a first landing, including an async memo with no resolution — in every scope. It returns `T`, never `undefined`. A lane held on async downstream of the read does not paint, and does not hide a value `latest` can already return. A memo behind a fallback, or in a branch not yet attached, has still produced its value, so `latest` returns it — a memo born held included: its plain read throws, and `latest` returns its pending value (F-9). Resolved async never pairs `[false, undefined]`. **A first landing a hold carries is a produced value (clarified 2026-10-28, amended 2026-10-30):** an async memo's first answer that lands in the same tick as a write to its input that a hold carries — an action's, or a plain write re-asking it — is held with it (D-4), and `latest` of it returns that answer while the plain read still throws (F-9); a `Loading` whose only read is `latest` of it shows the answer now (S-40). The frame is whole: the screen's committed input beside the answer to it. **A memo nobody has read has still produced what the flushes it missed would have given it (ruled 2026-10-30, #4474):** `latest` of a lazy memo whose sources have committed values is that value, computed on the committed world (laziness is never observable — #3078, #4366, #4474). An identity memo over an async memo, read for the first time in the flush that re-asks the async memo, shows the async memo's landed answer and is pending on the re-ask, the same screen as with a prior reader of it; a plain read of it in that mount is not display-ahead (D-27): its reader is born held (D-2) and shows the re-ask's answer. **Inside a flush, `latest()` of a staging not yet held is the frame's read like any other (clarified 2026-10-28):** it serves the staging, opens no hold, and leaves a plain read beside it in the same pass reading the staging too (F-10: one frame for every channel); if the flush parks, the pass re-derives once as a verdict reader (D-2, A10). A `latest()` read that manufactured a hold for the frame so its pass could run once made the plain reads after it see the screen in a flush that then committed (#4365).
183+
`latest(x)` answers the held write (the newest value a flush has processed, held or not — for a memo nobody has read, the value the flushes it missed would have given it), the optimistic value where one displays, the arrived truth under a superseded override, and the committed value of a node whose own flight is up (below the async nothing newer exists). A sync derivation of a held source is visible through it (the held recompute is a write path like any other). It throws `NotReadyError` only when no value has been produced — before a first landing, including an async memo with no resolution — in every scope. It returns `T`, never `undefined`. A lane held on async downstream of the read does not paint, and does not hide a value `latest` can already return. A memo behind a fallback, or in a branch not yet attached, has still produced its value, so `latest` returns it — a memo born held included: its plain read throws, and `latest` returns its pending value (F-9). Resolved async never pairs `[false, undefined]`. **A first landing a hold carries is a produced value (clarified 2026-10-28, amended 2026-10-30):** an async memo's first answer that lands in the same tick as a write to its input that a hold carries — an action's, or a plain write re-asking it — is held with it (D-4), and `latest` of it returns that answer while the plain read still throws (F-9); a `Loading` whose only read is `latest` of it shows the answer now (S-40). The frame is whole: the screen's committed input beside the answer to it. **A memo nobody has read has still produced what the flushes it missed would have given it (ruled 2026-10-30, #4474):** `latest` of a memo on the observation lifecycle (unowned, or `lazy: true`) whose sources have committed values is that value, computed on the committed world (laziness is never observable — #3078, #4366, #4474). An identity memo over an async memo, read for the first time in the flush that re-asks the async memo, shows the async memo's landed answer and is pending on the re-ask, the same screen as with a prior reader of it; a plain read of it in that mount is not display-ahead (D-27): its reader is born held (D-2) and shows the re-ask's answer. **Inside a flush, `latest()` of a staging not yet held is the frame's read like any other (clarified 2026-10-28):** it serves the staging, opens no hold, and leaves a plain read beside it in the same pass reading the staging too (F-10: one frame for every channel); if the flush parks, the pass re-derives once as a verdict reader (D-2, A10). A `latest()` read that manufactured a hold for the frame so its pass could run once made the plain reads after it see the screen in a flush that then committed (#4365).
184184

185-
**Collapses:** [A28](./SPEC-ASYNC-SEMANTICS.md#a28-a-write-becomes-visible-at-flush--to-every-channel) (`latest` reads the flushed staged world), [A11](./SPEC-ASYNC-SEMANTICS.md#a11-sync-derivations-of-held-sources-are-visible-through-latestispending), [A7](./SPEC-ASYNC-SEMANTICS.md#a7-resolved-async-never-reads-false-undefined), [A17](./SPEC-ASYNC-SEMANTICS.md#a17-an-active-override-is-the-displayed-value-until-its-transaction-commits-and-the-graphs-value-until-its-own-source-answers) (`latest` returns the arrived value). **Status:** standing. **Deviation today:** a lazy memo released unread at its source's landing (#2934) and woken in a flush that re-asks the source has no value; latest of it returns undefined, a plain read of it is born held. Ruled 2026-10-30: it has the value the missed flush would have given it (laziness is never observable). Fix belongs at the wake, both read orders (#4474). Pinned `it.fails` at the ruled screen in `tests/latest-unread-identity-memo-4474.test.ts`; a memo in a root is never released and already reads as ruled.
185+
**Collapses:** [A28](./SPEC-ASYNC-SEMANTICS.md#a28-a-write-becomes-visible-at-flush--to-every-channel) (`latest` reads the flushed staged world), [A11](./SPEC-ASYNC-SEMANTICS.md#a11-sync-derivations-of-held-sources-are-visible-through-latestispending), [A7](./SPEC-ASYNC-SEMANTICS.md#a7-resolved-async-never-reads-false-undefined), [A17](./SPEC-ASYNC-SEMANTICS.md#a17-an-active-override-is-the-displayed-value-until-its-transaction-commits-and-the-graphs-value-until-its-own-source-answers) (`latest` returns the arrived value). **Status:** standing. **Deviation today:** a memo on the observation lifecycle (unowned, or `lazy: true`) released unread at its source's landing (#2934) and woken in a flush that re-asks the source has no value; latest of it returns undefined, a plain read of it is born held. Ruled 2026-10-30: it has the value the missed flush would have given it (laziness is never observable). Fix belongs at the release, both read orders (#4474). Pinned `it.fails` at the ruled screen in `tests/latest-unread-identity-memo-4474.test.ts`; a memo in a root is never released and already reads as ruled.
186+
187+
**Open (2026-10-31, #4474; fix in progress).** The memo is not lazy: `createMemo(() => m())` with no `lazy` option computes eagerly at creation and is blocked on the uninitialized `m` (`_blocked`). It is _unowned_ — `CONFIG_AUTO_DISPOSE` is `!context || options?.lazy` (core.ts) — and the cause is release ordering at `m`'s landing: the settle walk (async.ts `settlePendingSource`) queues the blocked memo's retry (`enqueueSub`) and then, the node having no subscribers, releases it (`releaseIfSettledUnobserved` → `unobserved` → `deleteFromHeap`), destroying the retry it just queued; the commit sweep then clears `STATUS_UNINITIALIZED` on a node that never computed, and `latest` of it is `undefined`. The owned twin and the unowned twin with a subscriber both run the retry and already show the ruled screen (the "in a root" and prior-reader rows of `tests/latest-unread-identity-memo-4474.test.ts`). D-22 already rules the screen; no new ruling. The fix belongs at the release — run the queued retry, then release (#2934's requirement, a release with no perpetual recompute, is met) — not at the wake: branch `fix/release-after-retry-4474`, in progress. History: a wake-side fix (branch `fix/core-batch-4474-4417`, `ed85ca2a3` — a dormant memo's pass served the committed value and marked pending, a catch-up on the screen re-deriving after) was built on 2026-10-30 and parked: +186 B brotli on the core floor, +149 B on hello world, and a remount regression (generator seed 91501 #15992, `[ROOT-E]` for a program that never errors).
186188

187189
### D-23. `isPending(x)`: three causes, two exceptions, question-scoped, atomic with the value
188190

@@ -230,6 +232,8 @@ A `<Show when={latest(x) > 0}>` opens at once (display-ahead). The `<Loading>` i
230232

231233
**Collapses:** #3851/#3869 (2026-10-07), [A29](./SPEC-ASYNC-SEMANTICS.md#a29-a-tracked-read-served-a-live-transactions-staged-value-enters-that-transaction)'s 2026-10-07 amendment, L2 statement 3 as amended, #3835. **Status:** standing (`tests/verdict-mount-first-pass-3851.test.ts`, `tests/optimistic-mount-binding-3835.test.ts`).
232234

235+
**Parked (2026-10-31, #4417; issue open).** The ruling stands: the branch a display-ahead `Show` opens under a plain write's hold is born held and attaches once, at the landing, with its content (S-46 — today it attaches with its text hole empty, F-2's empty slot; and the `[1,2,2]` mount-count pins of `tests/boundary-not-born-held-3540.test.ts` / `web/test/loading-on-keyed-boundary-3540.spec.tsx` see a third mount). A fix was attempted on 2026-10-30 beside #4474's ("a pass whose mount is the hold's is the hold's": a render effect born held under a verdict-lane mount marks its creator pass joined, and `laneStage` leaves the verdict lane for the hold; reference branch `fix/4417-display-ahead-attach-parked`, commit `04c218537`) and dropped before #4474's reference branch was cut: it looped forever on the generator's seed 91501 #32043 (`boundarySeam` → `redraw` re-enqueueing a held boundary's output every round) and opened four new findings (seed 7 #1691 E6, #17379 E1, #38770 E6, #46918 E1). Rulings reaffirmed 2026-10-31 after a rules review: S-46 reading A (born held, attaches at the landing — entailed by D-27 and D-2's in-flush carve-out; attaching with the committed value instead would re-rule S-31's `[fallback]` row) and the `[1,2,2]` mount count. No mechanism inside the size budget is known for either half: adoption's frame half measures ≥100 B minified on the live-page floor; the display-ahead attach attempt looped. Parked; issue open; pins stay `test.fails` at the ruled screens: the S-46 plain row in `web/test/display-ahead-plain-write-content-s46.spec.tsx`, the four `[1,2,2]` rows.
236+
233237
### D-28. A read throws on its own; an earlier read does not disarm a later throw
234238

235239
**From:** F-1, F-2, F-4. **Scenarios:** S-39.

‎packages/signals/docs/SCENARIOS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,9 @@ const save = action(function* () { setX(1); yield gate; });
636636
| 2 | `gate`, body returns | `1 \| content 1` | |
637637
| ✗ | | after 1: `0 \| content 1` (the torn frame #3869 fixed) | |
638638

639-
### S-46. The content a display-ahead `Show` opens reads the screen, whoever opened the hold — D-27, D-37
639+
### S-46. The content a display-ahead `Show` opens reads the screen, whoever opened the hold — D-27
640640

641-
_Ruled 2026-10-30 ("actions aren't special — they are a way to extend the hold"). Pinned: `tests/display-ahead-plain-write-content.test.ts` (signals, passes) and `web/test/display-ahead-plain-write-content-s46.spec.tsx` (through `Show` + `insert`; the plain row is `test.fails` — today the branch attaches with its text hole empty, `selected: ` and nothing, F-2's empty slot and #4417's mechanism). S-31's rule in the plain-write, no-boundary form: a write to `id` is held because an async memo over it is on screen; no action, no `Loading`._
641+
_Ruled 2026-10-30 ("actions aren't special — they are a way to extend the hold"), reaffirmed 2026-10-31 (A over C: C would re-rule S-31). Pinned: `tests/display-ahead-plain-write-content.test.ts` (signals, passes) and `web/test/display-ahead-plain-write-content-s46.spec.tsx` (through `Show` + `insert`; the plain row is `test.fails` — today the branch attaches with its text hole empty, `selected: ` and nothing, F-2's empty slot and #4417's mechanism). S-31's rule in the plain-write, no-boundary form: a write to `id` is held because an async memo over it is on screen; no action, no `Loading`. Parked 2026-10-31: a fix was attempted and dropped (infinite loop on a generated case, four new findings — D-27 Status); no in-budget mechanism known, #4417 open._
642642

643643
```tsx
644644
const [id, setId] = createSignal(0);

‎packages/signals/scripts/mangle-props.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"_acted": "nt",
44
"_armLane": "B",
55
"_armed": "h",
6+
"_asked": "dn",
67
"_blocked": "fe",
78
"_born": "ro",
89
"_boundRunEffect": "W",
@@ -32,6 +33,7 @@
3233
"_evaluating": "gt",
3334
"_extraConfig": "xe",
3435
"_fallback": "L",
36+
"_fam": "rr",
3537
"_fb": "re",
3638
"_firstChild": "pe",
3739
"_flags": "R",
@@ -82,6 +84,7 @@
8284
"_open": "tt",
8385
"_order": "yt",
8486
"_output": "j",
87+
"_overlaid": "cn",
8588
"_owned": "Mt",
8689
"_owner": "H",
8790
"_parentComputed": "Ke",
@@ -110,6 +113,7 @@
110113
"_runs": "M",
111114
"_scope": "oo",
112115
"_served": "$e",
116+
"_shallow": "It",
113117
"_show": "ne",
114118
"_shown": "Ue",
115119
"_shownError": "Te",
@@ -138,12 +142,14 @@
138142
"_verdictLane": "J",
139143
"_witness": "io",
140144
"_witnessMark": "rt",
145+
"_woke": "Tt",
141146
"_x": "T"
142147
},
143148
"observe": {
144149
"_acted": "nt",
145150
"_armLane": "B",
146151
"_armed": "h",
152+
"_asked": "dn",
147153
"_blocked": "fe",
148154
"_born": "ro",
149155
"_boundRunEffect": "W",
@@ -199,6 +205,7 @@
199205
"_evaluating": "rs",
200206
"_extraConfig": "ct",
201207
"_fallback": "L",
208+
"_fam": "rr",
202209
"_fb": "re",
203210
"_firstChild": "ze",
204211
"_flags": "R",
@@ -251,6 +258,7 @@
251258
"_open": "tt",
252259
"_order": "Zt",
253260
"_output": "j",
261+
"_overlaid": "cn",
254262
"_owned": "ls",
255263
"_owner": "H",
256264
"_parentComputed": "Pt",
@@ -280,6 +288,7 @@
280288
"_runs": "M",
281289
"_scope": "oo",
282290
"_served": "Ut",
291+
"_shallow": "nr",
283292
"_show": "ne",
284293
"_shown": "Nt",
285294
"_shownError": "Te",
@@ -308,6 +317,7 @@
308317
"_verdictLane": "J",
309318
"_witness": "io",
310319
"_witnessMark": "bt",
320+
"_woke": "tr",
311321
"_x": "T"
312322
}
313323
}

‎packages/signals/src/affects-marks.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function repoll(
4848
if (!(sub as any)._type) repoll(sub, seen, readers);
4949
// A derived store's derive: its leaves' readers derive from it too
5050
// (store/projection.ts; a live target's property, has and keys nodes).
51-
const fam = (sub as any).fam;
51+
const fam = (sub as any)._fam;
5252
if (fam)
5353
for (const t of fam.live)
5454
for (const o of [t.n, t.h, { k: t.k, d: t.dk }])
@@ -69,7 +69,7 @@ function marked(el: Marked, seen: Set<Marked>): boolean {
6969
if (c._statusFlags & STATUS_ERROR || seen.has(el)) return false;
7070
seen.add(el);
7171
if (c._config & CONFIG_SLOT_NODE) {
72-
const derive: Marked | null | undefined = (c as any)._host?.fam?.node;
72+
const derive: Marked | null | undefined = (c as any)._host?._fam?.node;
7373
return derive != null && marked(derive, seen);
7474
}
7575
const tail = c._flags & REACTIVE_RECOMPUTING_DEPS ? c._depsTail : undefined;

‎packages/signals/src/boundaries.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,11 @@ export function prune(b: Boundary, pass: boolean): number {
363363
// lane's reader reveals with the lane, this round.) A boundary that
364364
// has not shown content catches it instead: the fallback stays until
365365
// the reader is committed (#3540: what a fresh boundary catches holds
366-
// nothing outside it).
366+
// nothing outside it). Not an error boundary (born `_initialized`):
367+
// what it caught in a hold was that hold's staged error (D-41), and an
368+
// answer landing in the same hold replaces it there — the content
369+
// reveals with the commit, and nothing ever shows the superseded
370+
// error (D-39, #4527).
367371
if (!pass || !b._initialized) continue;
368372
joinFuture(txOf(s));
369373
}
@@ -612,7 +616,8 @@ function createBoundary<T>(
612616
_tree: null!,
613617
_output: null,
614618
_readers: new Map(),
615-
_initialized: false,
619+
// Loading only: an error boundary has no first-content wait (`prune`).
620+
_initialized: type === STATUS_ERROR,
616621
_armed: false,
617622
_armLane: null,
618623
_lane: null,

0 commit comments

Comments
 (0)