Repository navigation
Commit 9baaba3
* fix(signals): latest() of a memo born in a lane throws NotReady instead of undefined (#4362, #4363, #4376)
A memo whose compute reads latest(s) is re-asked as the write's verdict
lane work, so it becomes a lane derivation. While its first pass is in
flight, nothing is in the lane, and laneValueOf/display fell back to the
committed value, which an uninitialized node does not have:
- latest(m)/isPending(m) served undefined and probed it pending (#4363);
- the lane's end committed that undefined as the node's answer and
cleared STATUS_UNINITIALIZED with the flight still up, which tripped
the flush loop guard for [latest(m), isPending(m)] (#4362);
- in hydration, m2 = fetchC(1 + latest(m1)) asked fetchC(NaN) instead of
adopting the streamed answer (#4376).
laneValueOf/display now return NOT_PENDING for such a node, so every
read throws NotReady (A7; A19 exc. 1) and the lane's end leaves the node
in flight.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): keep a verdict reader's lane routing and own-error recovery (async-gen #119, #1238)
- verdictValue: read the lane value before routing the reader into the
verdict lane, so a node born in the lane with nothing in it yet is read
as any uninitialized node (NotReady) without moving its reader (#1238).
- reruns: a stale reader whose error is its own (thrown by its pass over
the committed value it was served) re-derives at the landing; only an
error from an errored source is skipped (#3945). With #4363 no longer
committing `undefined`, async-gen case 119 reached this stuck error.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* chore: re-measure sizes over next @ 40cde2c, record async-gen improvements
- scripts/size: ledger lines for `signals: + isPending/latest`, the
compiled live page and live + router (+46/+46/+47 B minified over
next); this PR's store-app line re-measured (97,019 B).
- async-gen baseline: 15 recorded failures no longer reproduce (10
undefined-value, 4 final-screen, 1 unhandled-rejection).
- RULES-INDEX regenerated; changeset notes the error recovery.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): re-derive a self-errored stale reader at the lane's end, not in reruns
The verdict reader's own error from a served committed value (async-gen
#119) now re-derives from `dissolveLane` (lane engine only) instead of a
widened `reruns` condition, so the floors pay nothing (0 B; the lane
scenarios +20 B over the previous form). `reruns` is next's again.
Ledger re-measured; async-gen baseline unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): the lane's end re-derives a render effect's own stale error too
The re-enqueue of a self-errored stale reader at the lane's end sat inside
the non-effect branch, so a render effect whose display-ahead pass threw
over a held write's screen value kept its error after the landing (found
by the #4365 thread). It now applies to both. Byte-neutral (0 B minified
in every scenario); floors 0 B.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): an async memo over a verdict memo asks each question once
A memo that reads a verdict memo is a verdict reader (F-6, #4050), and
propagateStatus re-derived every verdict reader when its source went
pending. Re-derived, an async one was served the committed value it had
already derived from (A10) and asked that question again; that flight
held the verdict lane, and the source's held landing re-ran it as lane
work onto the same committed value, a third ask. Only the landing's
re-derive asked the new question.
Now an async memo that is a verdict reader only by reading a verdict
memo (it opened no isPending/latest window of its own: REACTIVE_WINDOW,
set per pass by markVerdictReader) drops CONFIG_VERDICT when that memo
goes pending and takes the plain pending mark: it is pending through the
flight (F-9) and the hold's work until it lands, reading plainly (D-25,
#3884), and asks once at the landing. Sync readers re-derive as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* test(signals): with #4383, isPending of the unresolved m1 holds its Loading, so the unheld latest case asks like the held one
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* docs(signals): regenerate RULES-INDEX
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): an async memo with no verdict window of its own takes no verdict role
#4397 review: with two verdict sources (`m1 = ask(1 + m0() + m0b())` over
`m0 = ask(1 + latest(s) + s())` and `m0b = ask(10 * (latest(t) + t()))`),
the grouped `[isPending(m1), m1()]` reader asked `m1:5` a second time on
stale inputs after both sources landed. m1 lost CONFIG_VERDICT when its
first source went pending, but a pass that threw NotReady at that
source's read picked it back up (F-6, `read`). The settle walk then
re-ran m1 as a verdict reader, and the committed values a hold had moved
past were served to it (A10).
The demotion is now per pass, in `recompute`. An async memo (new
CONFIG_ASYNC: its last answering pass registered a flight) whose pass
opened no isPending/latest window of its own (REACTIVE_WINDOW) does not
become a verdict reader by reading a verdict memo. It waits on its
sources like any derivation (F-9), reads them plainly (D-25), and asks
each question once. The side-effecting clear in `propagateStatus` is
gone, since that path no longer sees such a memo as a verdict reader.
Pinned: two verdict memos into one async memo, grouped and split, with
no question asked twice and equal final screens. A `test.fails` pin
records that the grouped shape still skips the t lane's m1:15/m1:16
asks that split makes: whether a later write merges into an open
transaction or opens its own lane depends on grouping (#4398).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): a grouped reader over a held write shows the lane's answer
A reader that groups isPending with the value over a held write
(`[isPending(m1), m1()]`) never showed m1's lane answer, though a plain
value reader did. Two things kept it out:
- A pass served a held node's committed value (frameRead, a stale reader
of the hold) still kept the node's propagated pending sources, so when
it went pending on another source it never woke when that source
settled. frameRead now drops what the served node propagated onto it
(A15): the landing re-derives it.
- A lane's reveal (reruns on a lane) cleared REACTIVE_FRAME_READ, the
mark the held transaction's landing needed to re-run the reader. Only
the transaction's own reruns clear it now.
CONFIG_ASYNC is worked out once, at the end of each pass, from the pass's
`_inFlight` (registered a flight: async; answered sync: not; pending or
errored without a flight: the last answer's), so a plain sync recompute
does no extra work and handleAsync no longer touches it.
refresh(m0) mid-hold now shows the lane's answer for the refreshed
question in every reader shape. Pins for the held write, an equal
landing, and refresh after and mid-hold cover the value, pair and split
readers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* test(signals): name frameRead in the held-shapes pin comment
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* chore(size): re-record this PR's four sizes over next @ 7ebd4a3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): an async memo over a verdict memo stays a verdict reader (D-25)
Review of #4397: the strict rule (an async memo with no `latest`/`isPending`
window of its own took no verdict role at all) overrode D-25 ("one that
reads a verdict reader's value is ... a verdict reader itself"; "a memo
computes under its own posture"). It caused two regressions against next:
1. Memo-extracted `latest()` (`v = createMemo(() => latest(s))`, `m1` async
over `v()` and `s()`): m1's pass at the write read the transaction's
staging and asked m1:220, the lane re-derived it (m1:120), and the
landing asked m1:220 again. It now asks m1:120 then m1:220, once each,
as the inline form does (D-22, F-9 exc. 2), showing v120 then v220 (F-6).
2. A reader disposed and remounted while the lane answer was in flight:
`[isPending(m1), m1()]` in one effect showed true,4 -> true,5 -> false,6
while `m1()` alone and split showed 4 -> 6. All shapes now show the
screen, then the landing (F-6: grouped holds like a lone read; D-26).
The strict rule is gone. In its place, D-25's "a node whose fetch a hold
is waiting on is that hold's work" (#3884), kept by the verdict engine
(verdict.ts `holdWork`, behind `holdWorkHook`, like `observeFlightHook`):
- A verdict source going pending does not re-derive an async memo with no
window of its own: none of its reads changed, and re-derived it was
served the committed value it had already derived from and asked that
question again (A10). It waits on the source like any derivation (F-9).
Except when its own flight is up outside a lane on a new question of the
source's: that re-run supersedes a flight asked of a value the source
has moved past (a `refresh()` re-ask is the same question).
- A held re-run of such a memo reads plainly, as a pending one already did
(#3884): the write that re-ran it is its hold's.
- Its async posture (CONFIG_ASYNC) is kept at each pass end in verdict.ts,
not computed in core.
Kept from the PR, as review asked: the frame read's drop of a served
flight's pending (A15; now in lanes.ts `laneServed`, behind a hook, run
only for lane work and verdict readers, with no closure), and `reruns`
leaving the stale-reader mark to the transaction at a lane's reveal.
Pins (tests/verdict-memo-flight-no-reask.test.ts): the memo-extracted and
inline forms ask m1:120, m1:220 once and show v110, v120, v220 in every
reader shape (D-22, D-25, F-6); a reader remounted mid-flight shows the
screen, then the landing, grouped as alone or split (F-6, D-26). Both
fail on the previous head.
Size: the floors are +14 B minified over next (was +126). The verdict
scenarios carry the rule: + isPending/latest +339 B. Ledger lines and the
frozen live-server-components floor are re-recorded to the measured sizes
(Size-Exception: floor-caps.json 115,423 -> 115,646 B minified, measured
38,197 B brotli; the maintainer relaxed the size rule for this fix).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* test(signals): pin the remount shapes on what holds whatever the timing
CI ran the "remounted mid-flight, then a write" pin slower than local runs:
the landing's `m1:6` was asked before the remount in the grouped run and
after the write in the lone run, so comparing one shape's asks against
another's compared two timings, not two shapes. Run at a later remount
locally, every shape asks `m1:6` alike, and none diverges.
The pin now states what holds at any timing, per shape: no question asked
twice (F-9), the lane's `m1:5` never shown to a reader mounted mid-hold
(D-26), and the grouped `[isPending(m1), m1()]` ending on the landing like
the lone read (F-6). The no-write case still fails on the strict rule's
head, where the grouped remount showed `true,5`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* test(signals): land the extracted pin's flights by hand, not by timer
CI's coverage run (slower than a plain run) let m1's 10 ms lane flight land
before the pin's 2 ms sleep ended, so the later write came after the
landing and the run asked m1:220 where the pin expects m1:125. The pin
compared two timings, not two behaviours.
m1's flights now land only when the test lands them, so the later write
always comes while the write's flights are up. The pin's expectations are
unchanged (D-25, D-22, F-6, F-9), and it still fails on ee0b535's source in
all three reader shapes (the m1:220, m1:120, m1:220 triple ask).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): only an async memo with no window of its own is hold work (D-25)
Review of #4397: REACTIVE_WINDOW was wiped at the pass tail, and both of
holdWork's consumers (the pass head and propagateStatus) run between
passes, so `own` was CONFIG_ASYNC alone. The rule hit every async verdict
memo, including one that calls latest()/isPending() itself, and changed
screens against next on the canonical F-6 shape: an async memo over
`${isPending(m0)}:${latest(m0)}` never showed the lane's true:2, and one
over latest(m0) read through [isPending(m1), m1()] skipped l1 and showed
true,l1.
CONFIG_ASYNC is now set at the pass end, while the pass's REACTIVE_WINDOW
is still up, only for a pass that registered a flight and opened no window;
a pass that opened one clears it. A memo that asks is a verdict reader
whoever dirties it (D-25, ruled 2026-10-28), unchanged from next. The held
re-run arm applies only to memos that never asked; removing it reasks
m1:5/m1:104/m1:15 in five pins, so it stays, documented against D-25.
Pins: the two own-window shapes, as next shows them (D-25, F-6). The pin
file takes the hand-landed flights from the split prepared for review, so
no pin races a timer. Ledger re-records dropped: the size ledger is
re-recorded once on next after the batch.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* perf(signals): keep D-25's async posture off recompute's hot path
CONFIG_ASYNC is now set where a flight registers (handleAsync) and
cleared by a verdict window (markVerdictReader) or a sync answer, instead
of a holdWork call at every pass's end. The pass-head check is inline.
holdWork only answers propagateStatus.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): an error clears D-25's async posture
A pass that throws a real error answers with no flight of its own, so a
verdict source going pending re-derives the memo instead of holding it on
its pre-error value (F-1). Pinned, held and unheld.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(signals): a stale reader's own error re-derives at any landing, not only a lane's end
With #4383 the lane's end no longer commits `undefined` for a node that has
produced nothing (#4363), so a sync memo that errored before its first
value (async-gen 91501 #1158: m1 = m0 + 1 throws at m0 = 1) stays
uninitialized through the next lane's end. Its next pass, under the
transaction a `latest()` read opened, is "a pass with no value yet":
`stagedScreen` serves it the screen (m0 = 1, not the staged 4) and lists it
as a stale reader to run again at the landing. That pass throws its own
error, and `reruns` skipped every errored reader whose error source is
errored -- its own included -- so it never ran again and the root stayed on
[ROOT-E]. On next the memo had been initialized as `undefined`, so it read
the staging instead and never hit this.
`reruns` now re-derives a reader whose error is its own (A15; D-39: the
landing is the new answer), as #4383 first did (1e270cd). That also covers
the lane's node case, so the `dissolveLane` re-enqueue (3fc3ef1,
15b9419) goes: +11 B minified on the floors, -27 B on the lane scenarios.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
---------
Co-authored-by: Claude <[email protected]>
1 parent f94dcd5 commit 9baaba3
13 files changed
Lines changed: 606 additions & 68 deletions
File tree
- .changeset
- packages
- signals
- docs
- src/core
- tests
- web/test
- async-gen
- harness
- __artifacts__
- hydration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments