Skip to content

Commit b0bad02

Browse files
ryansolidClaude via Cursor
andauthored
fix(signals): two crash-class bugs from the semantic fuzzer — a lane node in a held frame stays the lane's; a verdict reader revealing an orphan flight holds it (#3798)
* fix(signals): a lane's node inside a held frame stays the lane's (fuzzer F7a/F7b) `holdFrame` holds a parked pass's frame with the transaction (ruling A). It re-listed a lane's node found there — a verdict reader created in the frame, broken out into the holder's verdict lane (display-ahead, L2 rule 6), or a derivation of a guess — on the frame's transaction, still carrying its lane value (CONFIG_OVERRIDE). At the landing `dissolveLane` no longer found the node (its `_transaction` was the transaction's) and `land` nulled the transaction: a lane node with no lane, and the landing's re-derivation tripped over it (`laneRead` → `txOf(null)` → TypeError, REACTIVITY_HALTED). The shapes: a `Loading` whose content reads `latest(x)`, unmounted and remounted while `x` is held by an action (F7a); a memo of `isPending(() => x())` mounted in the tick of the write it probes, its mount toggled off and on while the write is held (F7b). The remounting gate's write joins the hold (A34 (1)), so its new frame is held with it — and the verdict-lane nodes inside it were taken along. `holdFrame` now skips a child listed on a lane, as the seam's own hold loop already does for this flush's stagings: lane work never makes its node transaction work (A15, #3698), and a lane pass's frame is the lane's, revealed and retired at its seam. The lane's end (`dissolveLane` at the parent's landing) commits the node as before. Every other `holdNode` site (the seam loop, the store's three) already excluded lane work; this was the one that did not. F7a and F7b flip from `it.fails` to `it`. No other pin moved. Co-authored-by: Claude via Cursor <[email protected]> * fix(signals): a verdict reader revealing a flight nobody holds registers it with the frame (fuzzer F12) A verdict reader (`latest`/`isPending` in its pass) that plainly reads a pending node is served the committed value and `observeFlight`s it: the frame holds, the reader is the holder's verdict lane's, and it re-derives at the landing (REACTIVE_FRAME_READ — a blocker of the hold through the flight's subscribers, `blockedBy`). That hold is on the flight's node: a reader served committed never goes pending, so the transaction waits only through the node it holds. A flight that went pending this flush is queued for the seam to hold; one in the air from before and held by nobody was not — the transaction opened with no entry, landed at its own seam, and its `_reruns` re-derived the reader into the same observation, every flush ("Potential Infinite Loop Detected"). The fuzzer's shape (F12): an action whose body ends with `setSource(1)`, `setShow(true)` adopted in the action's tick (O1), a reader of `[latest(source), node()]` over an async memo of `latest(source)`. At the body's end the memo re-asks as the action's verdict lane's work (the proposal) while the reader, a stale reader of the held `show`, shows "hidden"; nothing displays the flight, the action lands (A29: a flight nobody renders holds nothing), `dissolveLane` commits the memo beneath its flight, and the landing's rerun reveals the orphan flight to the verdict reader. Reduced: any memo re-asked unobserved (its inputs commit, #3305) then revealed to a `latest()` reader did the same. `observeFlight` now queues the flight's node for the seam when nobody holds it, as if it had gone pending here (A15 first observer, #3458: "the observation registers it, and the transaction waits on the flight it now shows a reader of"); the seam applies its own hold rules (a loading source is nobody's frame, A34 (2), `holdFrame`). The landing then resumes that transaction through `setSignal`'s join and the reader re-derives once. The display follows the existing rules: a reveal that read a staging stays the frame's and waits with the flight (rule 3, A15 reveal corollary — the reduced pin asserts `"hidden"` → `[1,1]`); a verdict reader with nothing staged shows the screen ahead (rule 6). F12 flips from `it.fails` to `it`; a reduced pin without the action or lane is added beside it. No other pin moved. Co-authored-by: Claude via Cursor <[email protected]> * chore(size): raise three caps for the fuzzer F7/F12 fixes (Size-Exception) Raises only the caps the two fixes push over, each set to measured + 10 B rounded up to 0.01 KB, with dated ledger notes in scenarios.js: - signals: + isPending/latest 9.45 -> 9.47 KB (9,456 B; was 6 B over) - page: base server components 44.78 -> 44.84 KB (44,829 B; was 49 B over) - page: live server components 48.45 -> 48.47 KB (48,454 B; was 4 B over) Attributable delta is +33 B minified in signals (holdFrame lane gate +16, observeFlight first-observer hold +17); the brotli deltas are layout over the shifted stream (page base moves +67 B br on +16 B minified). All other caps hold; no cap is loosened beyond measured + 10 B. Size-Exception: fuzzer F7/F12 crash-class fixes — `+ isPending/latest` 9.45 -> 9.47 KB (9,456 B), `page: base` 44.78 -> 44.84 KB (44,829 B), `page: live` 48.45 -> 48.47 KB (48,454 B); +33 B minified in signals, brotli layout. Accepted by the maintainer (2026-10-05). Co-authored-by: Claude via Cursor <[email protected]> --------- Co-authored-by: Claude via Cursor <[email protected]>
1 parent 6f77b1b commit b0bad02

9 files changed

Lines changed: 929 additions & 21 deletions

File tree

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 lane's node inside a held frame stays the lane's: `holdFrame` no longer re-lists a verdict reader (or a derivation of a guess) created under a held pass on the frame's transaction, where the landing nulled its transaction with its lane value still on and the next read of it crashed (`laneRead` → `txOf(null)`, `REACTIVITY_HALTED`) — a `Loading` over `latest(x)`, or a memo of `isPending(() => x())`, unmounted and remounted while `x` is held (fuzzer F7a/F7b; A15 #3698: lane work never makes its node transaction work).
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 verdict reader that reveals a flight nobody holds registers it with the frame (A15 first observer, #3458): `observeFlight` holds the flight's node in the frame's transaction, so the transaction waits for the landing instead of holding nothing, landing at its own seam and re-deriving the reader into the same observation every flush ("Potential Infinite Loop Detected") — an action whose body-end write re-asks an async memo as its verdict lane's work, revealed to a `latest()` reader the action adopted (fuzzer F12), or any memo re-asked unobserved and then revealed to a reader using `latest()`/`isPending()`.

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

Lines changed: 13 additions & 13 deletions
Large diffs are not rendered by default.

‎packages/signals/src/core/core.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ export function read<T>(el: Signal<T> | Computed<T>): T {
16841684
if (passLane !== null) committed = true;
16851685
else if (c !== null && c._config & CONFIG_VERDICT) {
16861686
committed = true;
1687-
GlobalQueue._observeFlight!(c as Computed<any>);
1687+
GlobalQueue._observeFlight!(c as Computed<any>, owner);
16881688
}
16891689
}
16901690
if (owner._statusFlags & STATUS_PENDING && !committed) {

‎packages/signals/src/core/scheduler.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,19 @@ export function list(n: Signal<any>, t: Transaction): void {
394394
/** Hold the (uncommitted) frame under a held pass: every computed in the
395395
* live child chain, recursively. Plain owners are walked through, not held
396396
* — nothing reads or re-passes them. Once per park, over the parked frames
397-
* only; recomputes pay nothing for it. */
397+
* only; recomputes pay nothing for it. A lane's node in the frame (listed on
398+
* a lane: a verdict reader broken out of this very hold — display-ahead — or
399+
* a derivation of a guess, CONFIG_OVERRIDE; a lane pass's effect) is the
400+
* lane's, as the seam's own loop has it: "lane work never makes its node
401+
* transaction work" (A15, #3698). Re-listed here it would carry the lane's
402+
* value on the transaction's list, where the landing nulls its transaction
403+
* and `dissolveLane` no longer finds it — a lane node with no lane, which the
404+
* next read of it trips over (`laneRead` → `txOf`). Its frame is the lane's
405+
* too (ruling A: a lane pass's children are the lane's), revealed and
406+
* retired at the lane's seam. */
398407
function holdFrame(owner: Owner, t: Transaction): void {
399408
for (let c = owner._firstChild; c !== null; c = c._nextSibling) {
409+
if ((c as Computed<any>)._x?._transaction?._lane) continue;
400410
if ((c as Computed<any>)._fn !== undefined && !(c._config & CONFIG_HELD))
401411
holdNode(c as unknown as Signal<any>, t);
402412
holdFrame(c, t);
@@ -619,7 +629,7 @@ export class GlobalQueue implements IQueue {
619629
declare static _lanesBlocked: ((t: Transaction) => boolean) | undefined;
620630
declare static _verdictLane: ((t: Transaction) => Transaction) | undefined;
621631
// Verdicts (verdict.ts).
622-
declare static _observeFlight: ((c: Computed<any>) => void) | undefined;
632+
declare static _observeFlight: ((c: Computed<any>, el: Computed<any>) => void) | undefined;
623633
// Observe tier (attribution.ts): the guesses of `t`'s lanes (lanes.ts).
624634
declare static _laneGuesses: ((t: Transaction) => Signal<any>[]) | undefined;
625635
/** Store (store/store.ts): fold the pending backings whose container

‎packages/signals/src/core/verdict.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import {
4949
GlobalQueue,
5050
joinFuture,
5151
passLane,
52+
queuePendingNode,
5253
setPassLane,
5354
stagedReaders,
5455
staleReader,
@@ -85,10 +86,21 @@ function route(c: Computed<any>, t: Transaction): void {
8586
* none has, as the throw would have had it), the reader is that
8687
* transaction's verdict lane's (shown now, with the flight's verdict), and
8788
* re-derives at the landing (REACTIVE_FRAME_READ — which is also what makes
88-
* it a blocker of the hold, `blockedBy`; a probe alone is neither). */
89-
function observeFlight(c: Computed<any>): void {
89+
* it a blocker of the hold, `blockedBy`; a probe alone is neither). The
90+
* hold is on the flight: a reader served committed never goes pending, so
91+
* the transaction waits on it only through the flight's node — one that
92+
* went pending this flush is queued for the seam to hold; one in the air
93+
* from before, held by nobody (a lane's derivation whose lane dissolved at
94+
* its parent's landing with the flight still up; a flight nothing displayed,
95+
* #3305), is registered by this, its first observer (A15, #3458): queued for
96+
* the seam as if it had gone pending here, so the transaction has an entry
97+
* for what it now shows a reader of. Held by nothing, it landed at this very
98+
* seam and its `_reruns` re-derived the reader into the same observation,
99+
* every flush (fuzzer F12). */
100+
function observeFlight(c: Computed<any>, el: Computed<any>): void {
90101
if (!globalQueue._running) return;
91102
joinFuture(null);
103+
if (!(el._config & CONFIG_HELD)) queuePendingNode(el);
92104
verdictRead(c, flushTransaction!, true);
93105
}
94106

0 commit comments

Comments
 (0)