Skip to content

Commit 904f342

Browse files
authored
Merge branch 'next' into claude/project-thread-x1ore2-4556
2 parents db5b261 + 2c9a1e3 commit 904f342

22 files changed

Lines changed: 665 additions & 191 deletions

‎.changeset/floor-shared-walks.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@solidjs/signals": patch
3+
"@solidjs/web": patch
4+
---
5+
6+
Shrink the compiled and hand-written floors: the dependent walks, dependency clearing, status writes, effect-run queueing, flatten's thunk walk and the delegated-event parent hop share their code (no behavior change).
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 memo on the observation lifecycle (unowned, or `lazy: true`) that blocked on an async source is no longer released before the retry its source's landing queued (#4474). The settle walk re-enqueues the blocked reader and, finding it unobserved, released it on the spot: the release pulled the retry back out of the heap, so the memo never computed the landing and woke later with no value — `latest()` of it returned `undefined` beside `isPending() === true`. The release now waits for that pass (`REACTIVE_RELEASE_AFTER`): the retry runs once, as the owned twin's does, and the node is released at the pass's tail if it is still unobserved and settled. #2934's contract is kept (no perpetual recompute — one pass, then the release), #3078's untouched (reads revive; a dormant memo dirtied in the same tick is still reclaimed before the heap). Laziness is never observable (D-22).
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+
fix(signals): a re-parked node drops pending sources its pass no longer reaches, so a `<Loading>` whose first answer was superseded while a sibling refetched reveals once both settle (#4541)

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,7 @@ An armed boundary catches a lane the same way it catches a transition (D-12, D-1
182182

183183
`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 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).
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. **Fixed 2026-10-31 at the release (#4474).** The memo was not lazy but unowned — a memo on the observation lifecycle (unowned, or `lazy: true`) computes eagerly and, blocked on an uninitialized async source, is re-enqueued by that source's landing like any dependent; the settle walk queued its retry and then, finding it unobserved, released it (`async.ts`: `releaseIfSettledUnobserved` → `unobserved` pulled the retry back out of the heap), so the node never computed the landing and woke later with no value. Now the release waits for the pass the walk queued (REACTIVE_RELEASE_AFTER): the retry runs — once, as the owned twin's does — and `recompute`'s tail releases the node if it is still unobserved and settled (#2934's no-perpetual-recompute contract kept; #3078's read-revives and pre-heap reclaim untouched). Both read orders read as ruled through the existing paths (`tests/latest-unread-identity-memo-4474.test.ts`, `web/test/latest-unread-identity-memo-4474.spec.tsx`, `tests/released-memo-retry-runs-4474.test.ts`). A fix at the wake was built first and parked on 2026-10-31 (reference branch `fix/core-batch-4474-4417`, commit `ed85ca2a3`: +186 B brotli on the core floor and a generator regression, 91501 #15992) — history, not the mechanism. Consequence worth knowing: a settle's one retry is a compute — an unobserved async memo over a landing source starts the one flight its owned twin starts, then is released at that flight's landing.
188186

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

0 commit comments

Comments
 (0)