Skip to content

Commit 5755ddd

Browse files
ryansolidclaude
andauthored
fix(signals): a pass that asks reads ahead on the screen as a sync pass does (S-51, #4778) (#4826)
* fix(signals): a pass that asks reads ahead on the screen as a sync pass does (S-51, #4778) S-51 re-ruled 2026-11-12: an async derivation that reads a held value beside latest()/isPending()/a guess answers the screen's question for the display and the landed world's for the frame. The 2026-11-07 producer clause (the asker guard) is withdrawn. - verdict.ts: asker arms, askerJoins and readBy removed. R5 moved here from lanes.ts behind the verdict engine's hooks (r5, adoptParked), so a bundle without isPending/latest carries none of it. - Park-block: the frame flight the seam parks is the hold's question; the hold waits on it while a reader on screen does (F-2). - Re-ask: a later frame write supersedes a parked question; the reader's pass is the frame's again and asks at once (F-2, F-9). - Adoption for memos over a re-derived sync verdict memo; a sync verdict memo's value staged this flush reads plainly for a memo reader (D-22). - store.ts: a pending verdict-only derive's flights are read as the memo's reader would (D-30, S-46). - Rules: F-2, F-6, D-25 amended; S-51 and S-52 rulings rewritten; the generator's truth-asks oracle (it encoded the clause) removed. - Tests: async-reads-ahead-matrix (192 rows), async-reads-ahead-second-write (36 rows); five S-51 era pins restored to their pre-clause expectations. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_0117BoWPriDziUDpTcqtewbK * fix(signals): the marked derive pass leaves only a verdict lane; restore the #4375 hydration asks The derive pass that reads plainly (#4491) left its pass lane whatever it was: a guess's lane too, so a projection chain under two guesses showed the old rows at the fetch's landing (web projection-chain-two-guesses-4762). A derivation of a guess is that lane's (F-6). The hydrated #4375 spec's asks return to their pre-clause expectation (the screen's question beside the frame's, each once). Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_0117BoWPriDziUDpTcqtewbK * chore(size): raise the four isPending/latest caps for #4826 Growth accepted by the maintainer 2026-11-12. From size job 131576088944 (head cd27cbc over next 4de85c2): measured + 10 B rounded up to 0.01 KB, recorded minified = measured. - signals: + isPending/latest: 12.54 -> 12.78 KB, minified 34,737 -> 35,388 - page: live server components (frozen floor, Size-Exception in the PR body): 40.61 -> 40.85 KB, minified 122,153 -> 122,820 - page: compiled live server components: 44.67 -> 44.85 KB, minified 130,192 -> 130,859 - page: live + router: 50.41 -> 50.60 KB, minified 147,964 -> 148,630 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_0117BoWPriDziUDpTcqtewbK * fix(signals): isPending in a re-asked pass swallows its thunk's error; edge pins (#4826 review) isPending's short-circuit for a pass a second write re-runs as the frame's (`reask`) ran the thunk outside the probe's try/catch: a thunk that throws escaped the verdict and halted the reactive system. The plain pass now goes through the same catch (a verdict never throws what its thunk throws; a NotReady still propagates inside an owner), with probing off. tests/async-reads-ahead-edges.test.ts pins it, and two confirmations from the review: the landing's re-derivation of a verdict memo nothing on screen reads (sync, or async with a flight that never answers) holds no frame (F-2), and a sync memo over a sync verdict memo reads as the window inline would with and without a hold (D-22). Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_0117BoWPriDziUDpTcqtewbK --------- Co-authored-by: Claude <[email protected]>
1 parent 4de85c2 commit 5755ddd

30 files changed

Lines changed: 1231 additions & 454 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@solidjs/signals": patch
3+
---
4+
5+
A pass that asks and reads ahead runs on the screen as a sync pass does (S-51 re-ruled 2026-11-12; F-2, F-6, D-25, #4778). An async memo that reads a held value beside `latest()`, `isPending()` or a guess of it now answers the screen's question for the display — `0/true`, `0/1` beside the screen's `id` — and the landed world's question for the frame, so the write never shows beside another question's answer. The 2026-11-07 producer clause ("a question is asked only of the truth") is withdrawn: under it `isPending(id)` read `true` beside an async label computed from `false`, and a wrapped async reader (`memo(() => asyncMemo())`) behaved differently from an inline one.
6+
7+
The hold waits for the answer to its own question. The request the frame's pass sent is the hold's question; the hold waits on it while a reader on screen does, whatever the screen's pass came to (before, a faster screen answer could land the write ahead of its data). A second write while that request is up supersedes it: the reader asks the new question at once instead of at the landing, and never ends on the first write's answer (on `next`, `async(source(), memo(latest(source)))` did). A window extracted into a memo reads as inline for an async reader over it, in either read order.
8+
9+
A derived store whose derive reads such a memo shows what the memo form shows (D-30).

‎packages/signals/docs/INTERNALS-ASYNC-STATE.md‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,62 @@ The findings that used to follow here (§5a–§5h, 2026-07-06 → 2026-07-16) a
325325

326326
## 7. Decision log
327327

328+
- 2026-11-12b: **A pass that asks reads ahead on the screen (C)** (S-51
329+
re-ruled; F-2's producer clause and F-6's limit of 2026-11-07 replaced;
330+
#4677, #4778). The producer clause made a pass that asks the hold's:
331+
`isPending`/`latest` meant one thing in a render effect or a sync memo
332+
and another in an async memo, and a memo between the read and the async
333+
changed the answer again (#4778, patched the same morning by `readBy`).
334+
Ruled: one meaning. An async pass that reads ahead runs on the screen as
335+
a sync pass does; the lane gets the screen's question, the hold the
336+
frame's. Removed: `askerJoins` and its hook, the asker arms of
337+
`frameRead`, `read` and `verdictValue`, `laneDirty`'s display skip, the
338+
posture line's CONFIG_ASYNC case, `readBy`, the seat table's V0/Vp0 rows,
339+
and the generator's `truth-asks` oracle (it encoded the clause). What
340+
replaces "asks once, of the truth" is R5 for async readers, extended:
341+
- **Park-block** (verdict.ts `park`, `parkUp`; lanes.ts `lanesBlocked`): the frame
342+
flight the seam parks is the hold's question, so the hold waits on it
343+
while a reader on screen waits on it (judged as `blockedBy` judges a
344+
frame reader: a render effect pending or served the screen, a boundary
345+
showing content; a memo's stale read is no screen, #4504). Without it
346+
a lane pass that settled first left the hold nothing to wait on and
347+
the write landed ahead of its answer (#3884). `isPending` of a lane
348+
node counts a parked flight of its hold (`verdictValue`).
349+
- **Re-ask** (verdict.ts `reask`, `leave`, `seat`, `left`;
350+
core.ts `recompute`'s head, `laneAdoptHook(el, 2)`): a later frame
351+
write reaching a parked reader, or a lane derivation it reads,
352+
supersedes the parked question. The reader's pass is the frame's again
353+
— out of the lane with the lane members it reads, windows answered for
354+
the hold's world (`markVerdictReader`) — and the seam parks the new
355+
flight and re-derives for the lane. Before this, on `next`,
356+
`data = async(source(), memo(latest(source)))` asked the first write's
357+
question only and ended on its answer beside the second write.
358+
- **Adoption at the heap visit** (`adoptParked(r, 1)`, `armed`, `arm`;
359+
`GlobalQueue._update`): the landing arms a parked reader, and the memos
360+
over a sync verdict memo it re-derives; armed, the reader adopts the
361+
parked flight at its turn even though that memo's flip dirtied it. The
362+
memo-extracted forms ask as few times as inline.
363+
- **A verdict memo's answer for this frame** (verdict.ts `holdStaging`,
364+
D-22): a memo reading a sync verdict memo's value staged this flush
365+
reads it plainly. Served the screen because another pass's pending had
366+
opened the hold first, an async reader asked the question it already
367+
had the answer to, and the landing showed that answer beside the write.
368+
- `reruns` holds the release for every re-derivation (`frame = 1`): a
369+
memo over a re-derived verdict memo may ask.
370+
- Store form (D-30): `pullFamily` reads a pending verdict-only derive's
371+
flights as the memo's reader would, so a branch mounted ahead is born
372+
held on them (S-46); the marked derive pass leaves its lane seat
373+
(#4491).
374+
Pins: `tests/async-reads-ahead-matrix.test.ts` (192 rows: shape × kind ×
375+
holder × order of answers), `tests/async-reads-ahead-second-write.test.ts`,
376+
the rewritten #4778 pin; five pins reverted to their pre-2026-11-07
377+
screens (`verdict-memo-flight-no-reask`, #4393, #4402, #4504, #4491), two
378+
request orders updated. Costs, stated in S-51: the screen's question is
379+
asked beside the frame's; the lane's reveal, a sibling `isPending` hole
380+
included, waits for it; a mixed plain-read-plus-extracted-window reader
381+
that runs after another pass opened the hold asks the screen's question
382+
twice (pinned in the matrix as today's cost). The entry below is
383+
superseded where it speaks of an async derivation and of `readBy`.
328384
- 2026-11-12: **A memo's posture follows its readers** (#4776, #4778;
329385
D-25, S-51; one version per node, #3905 out of scope). Before, a memo
330386
that inherited a verdict posture (it read `latest`/`isPending` through a

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ True while an input change is held, while `x`'s own flight for a new question is
162162

163163
**From:** F-6, F-1, F-3. **Rows:** S-27, S-29, S-30, S-31, S-39, S-40, S-46, S-49, S-50, S-51, S-52, S-58, S-60. **Pins also:** `tests/ispending-combined-atomic-3442.test.ts`, `web/test/display-ahead-show-child-shapes-4806.spec.tsx`, `tests/verdict-memo-held-branch-4544.test.ts`, `tests/latest-memo-inline-parity.test.ts`, `tests/lane-render-effect-grouping-4284.test.ts`, `tests/display-ahead-plain-write-content.test.ts`.
164164

165-
A pass's posture is decided by its own reads in that pass, never inherited from a creator or a memo it reads (#4544) and never carried into its next run. A sync memo's posture also follows its readers (ruled 2026-11-12, #4776, #4778; one version per node, #3905 out of scope): a memo that reads a verdict memo and probes nothing itself is display while only the display reads it, and reads held values as the screen, as the same reads inline do; once a pass of a hold's own work reads it — a pass born into the hold, a member of a frame a held pass built (the branch the hold opened), or an async derivation (S-51) — it is that hold's work for the rest of the hold, served the hold's writes, and re-derives at once. An async derivation's read makes a memo that probes in its own body the hold's too: its probe is answered in the hold's world, so the async asks once, of the truth, and the display behind that memo shows the hold's answer, not the ahead one. Each `latest` or `isPending` read sees the hold's world and joins nothing. A plain read of a node this pass also read ahead is the screen's: the two channels of one node agree within a scope, so `[x(), isPending(x)]` shows `[committed, true]` now in either order (A10, S-27). A memo that hoists that pair keeps the screen it had inline (S-52, 2026-11-07): the display, not the probe, is what makes the pair showable. A plain read of any other held value makes the pass the hold's work (D-1): a mixed `on` waits (S-49), and a memo that probed on its last run and probes nothing on this one holds the tick (S-50, both ruled 2026-11-05). Whether a read throws is that read's own: an earlier display-ahead read does not disarm a later plain read's throw (S-39). A branch a display-ahead read gates is not derived from it: a mount under `<Show when={latest(x) > 0}>` is a mainline mount whose plain reads are the screen's — `latest(x)` inside shows ahead at its own site — and a first pass under it that reads the hold's staging is born held (D-1), attaching at the landing, on its fallback inside a `<Loading>` (S-31, S-46). The content's shape never changes that seat (ruled 2026-11-12, #4806): text the gate's own pass reads plainly for the first time — `{id()}` as the child, the compiled `{latest(id) > 0 ? id() : …}` — is the mount too, and its verdict lane reveals with the landing, as for a born-held element; this narrows the display sentence above, which covers a value the display pass already read on its last run. A render effect off a lane that reads what the lane is revealing — mounted mid-hold, or re-run by an unrelated write — shows the committed value and re-derives at the reveal (S-30). What is rendered from a display-ahead read waits for that read's own async, as one reveal (S-29). A display-ahead pass shows; it never asks (F-6's limit, 2026-11-07): the display — a render effect, a compiled binding, a user effect, and the sync derivations feeding them — holds the value it showed beside the verdict, in a render effect or a memo alike (S-52; hoisting the pair into a memo changes no screen), and an async derivation that reads a held value plainly, or `isPending` of one, is the hold's, asking once, of the truth (S-51, #4677; ruled and built 2026-11-07) — a pass that asks is a verdict reader only by a window of its own, never by reading a verdict memo (#4504). A user effect's callback runs at the frame it belongs to, lane or mainline; async in an effect is the author's.
165+
A pass's posture is decided by its own reads in that pass, never inherited from a creator or a memo it reads (#4544) and never carried into its next run. A sync memo's posture also follows its readers (ruled 2026-11-12, #4776, #4778; one version per node, #3905 out of scope): a memo that reads a verdict memo and probes nothing itself is display while only the display reads it, and reads held values as the screen, as the same reads inline do; once a pass of a hold's own work reads it — a pass born into the hold, or a member of a frame a held pass built (the branch the hold opened) — it is that hold's work for the rest of the hold, served the hold's writes, and re-derives at once. An async derivation's read is not such a pass (re-ruled 2026-11-12, S-51): it is display like any other reader, and a memo that probes in its own body stays the screen's whoever reads it. Each `latest` or `isPending` read sees the hold's world and joins nothing. A plain read of a node this pass also read ahead is the screen's: the two channels of one node agree within a scope, so `[x(), isPending(x)]` shows `[committed, true]` now in either order (A10, S-27). A memo that hoists that pair keeps the screen it had inline (S-52, 2026-11-07): the display, not the probe, is what makes the pair showable. A plain read of any other held value makes the pass the hold's work (D-1): a mixed `on` waits (S-49), and a memo that probed on its last run and probes nothing on this one holds the tick (S-50, both ruled 2026-11-05). Whether a read throws is that read's own: an earlier display-ahead read does not disarm a later plain read's throw (S-39). A branch a display-ahead read gates is not derived from it: a mount under `<Show when={latest(x) > 0}>` is a mainline mount whose plain reads are the screen's — `latest(x)` inside shows ahead at its own site — and a first pass under it that reads the hold's staging is born held (D-1), attaching at the landing, on its fallback inside a `<Loading>` (S-31, S-46). The content's shape never changes that seat (ruled 2026-11-12, #4806): text the gate's own pass reads plainly for the first time — `{id()}` as the child, the compiled `{latest(id) > 0 ? id() : …}` — is the mount too, and its verdict lane reveals with the landing, as for a born-held element; this narrows the display sentence above, which covers a value the display pass already read on its last run. A render effect off a lane that reads what the lane is revealing — mounted mid-hold, or re-run by an unrelated write — shows the committed value and re-derives at the reveal (S-30). What is rendered from a display-ahead read waits for that read's own async, as one reveal (S-29). The display — a render effect, a compiled binding, a user effect, and the derivations feeding them — holds the value it showed beside the verdict, in a render effect or a memo alike (S-52; hoisting the pair into a memo changes no screen). A pass that asks is display too (S-51, re-ruled 2026-11-12, replacing the 2026-11-07 producer clause; #4677, #4778): it reads ahead on the screen, by a window of its own or by reading a verdict memo, and asks the screen's question for the lane. The frame's question is the hold's (F-2): the pass that opens the hold asks it, the hold waits on that flight while a reader on screen does and the landing adopts it; a later write that supersedes it has the reader ask the new one at once; a pass that ran after another's pending had opened the hold asks it at the landing, and the landing's frame waits for the answer (F-1). A sync verdict memo's value staged in a flush is its window's answer for that frame, and a memo reading it in that flush reads it plainly, whichever pass opened the hold (D-22: extracted, the window reads as inline). A derived store's reader reads through it as its memo's reader would (D-30), a branch mounted ahead included (S-46). A user effect's callback runs at the frame it belongs to, lane or mainline; async in an effect is the author's.
166166

167-
**Status:** standing; S-51, S-52's #4349 shape and S-46's plain row built 2026-11-07, the plain row for every gate shape 2026-11-08 (S-58: `<Show>`, the compiled ternary, a truthiness memo and a branch memo, or one memo that probes and mounts — and S-53′ with it; S-58′ the same day: the mount's own pass reading ahead, of the same node or another, does not change its seat; S-58″/‴: nor does a guess lane — the mount under an action's guess is born held on the lane's flight, not served the screen as lane work is); S-49, S-50 ruled, not built. Absorbs D-26, D-27, D-28 (2026-11-06). The 2026-10-28 paragraph "a verdict posture outlives the pass that asked" is withdrawn. Mechanism and history: `INTERNALS-ASYNC-STATE.md` §7.
167+
**Status:** standing; S-51 re-ruled and rebuilt 2026-11-12; S-52's #4349 shape and S-46's plain row built 2026-11-07, the plain row for every gate shape 2026-11-08 (S-58: `<Show>`, the compiled ternary, a truthiness memo and a branch memo, or one memo that probes and mounts — and S-53′ with it; S-58′ the same day: the mount's own pass reading ahead, of the same node or another, does not change its seat; S-58″/‴: nor does a guess lane — the mount under an action's guess is born held on the lane's flight, not served the screen as lane work is); S-49, S-50 ruled, not built. Absorbs D-26, D-27, D-28 (2026-11-06). The 2026-10-28 paragraph "a verdict posture outlives the pass that asked" is withdrawn. Mechanism and history: `INTERNALS-ASYNC-STATE.md` §7.
168168

169169
### D-26. A `latest()`/optimistic reader mounted or re-run mid-hold shows the committed value and reveals with the lane
170170

0 commit comments

Comments
 (0)