Skip to content

Commit 0c93980

Browse files
ryansolidClaude via Cursorcursoragent
committed
fix(signals): an errored pass's unreached reads still hold their flights (fuzzer F4)
A tuple render reader observes `m0`'s flight for `a=1` (the hold on `a=1`). A later `b=1` re-runs it and the pass throws NotReady at `m1` before reaching `m0`. `blockedBy` counts only the reader's reads of its last pass (`s._gen === r._depGen` — O3, #3494: a reader that stopped reading releases the flight), so the unreached `m0` link counted as dropped, the hold on `a=1` landed, and `A=1` showed beside a tuple still derived from `a=0` while `m0`'s flight was in the air. A15: writes whose async work is observed by a shared reader settle as one unit; A30: an errored pass (a throw, NotReady included) keeps its full list. An errored pass did not stop reading — it never got there. `blockedBy` (scheduler.ts) now counts the links past `_depsTail` as live when the reader's pass errored (`r._x._error != null`). The unchanged- pass tails kept for A30 (#3469) are untouched: their pass completed. +16 B minified (core floor). F4 flips from `it.fails` to `it`. No other pin moved. Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]>
1 parent 5478d5a commit 0c93980

4 files changed

Lines changed: 50 additions & 45 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 render reader whose pass errored (NotReady included) before reaching a flight it read last time still holds that flight's transaction: a write no longer shows beside a reader still derived from the previous value while the flight is in the air (fuzzer F4).

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Status legend: **live** stated and standing · **ruled** carries an explicit rul
7474
| A27 | ruled | `docs/SPEC-ASYNC-SEMANTICS.md:273` | — | loading-value.test.ts×2 visibility-oracle.states.ts×18 visibility-oracle.test.ts×1 | [ruled 2026-08-10] The commit-#0 loading window is loading-class and verdict-quiet — (**ruled 2026-08-10**) **The commit-#0 loading window is loading-class and verdict-quiet.** A node born committed v… |
7575
| A28 | ruled, mechanism landed | `docs/SPEC-ASYNC-SEMANTICS.md:71` | constants.ts×1 core.ts×12 lanes.ts×2 scheduler.ts×3 types.ts×1 verdict.ts×2 store.ts×4 | createOptimistic.test.ts×5 fuzz-findings-l2.test.ts×4 held-derivation-not-a-proposal-3612.test.ts×1 latest-held-till-flush.test.ts×1 posture-store-parity.test.ts×5 question-scoped-pending.test.ts×3 snapshot-derived-store-rows.test.ts×1 createOptimisticStore.test.ts×10 optimistic-draft-visibility-3665.test.ts×5 optimistic-list-mutation-matrix.harness.ts×1 optimistic-list-mutation-matrix.test.ts×2 shallow.test.ts×1 woken-transaction-adopts-staged-bump.test.ts×1 treeshake.test.ts×2 verdict-contract.test.ts×1 visibility-oracle-store.states.ts×8 visibility-oracle.states.ts×8 | [ruled, mechanism landed 2026-09-15] A write becomes visible at flush — to every channel — (**ruled 2026-09-08**; supersedes the #2922 mid-tick pull) **A write becomes visible at flush — to every chan… |
7676
| A29 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:95` | boundaries.ts×1 action.ts×1 constants.ts×1 core.ts×9 effect.ts×1 scheduler.ts×3 signals.ts×1 store.ts×1 | adoption-unchanged-key-read-3706.test.ts×9 body-end-supersession-visibility.test.ts×1 born-held.test.ts×3 boundary-not-born-held-3540.test.ts×4 createProjection.draft-lifetime-3585.test.ts×1 direct-commit-readers-posture.test.ts×1 fuzz-findings-l2.test.ts×4 held-conditional-memo.test.ts×1 held-frame-dependencies.test.ts×2 held-truth-lane-only.test.ts×3 l2-contract.test.ts×1 latest-held-till-flush.test.ts×2 mount-over-foreign-hold-3761.test.ts×1 optimistic-read-lane-not-transaction-3698.test.ts×3 posture-born-held-and-observation.test.ts×1 posture-store-parity.test.ts×6 derived-presence-async-3726.test.ts×3 optimistic-untracked-reads-f3-f5.test.ts×1 store-unchanged-read-independent-write-3688.test.ts×1 tick-scoped-pass-transaction.test.ts×2 treeshake.test.ts×3 visibility-oracle-store.states.ts×5 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×9 visibility-oracle.test.ts×1 write-proposals-3494.test.ts×1 | [ruled, amended in place 2026-09-13 (#3408)] A tracked read served a live transaction's staged value enters that transaction — A tracked computation served a node's staged `_pendingValue` — a value a … |
77-
| A30 | ruled | `docs/SPEC-ASYNC-SEMANTICS.md:229` | async.ts×3 attribution.ts×1 constants.ts×1 core.ts×1 effect.ts×1 scheduler.ts×4 | async-landing-deps-3461.test.ts×3 fuzz-findings-l2.test.ts×2 held-conditional-effect.test.ts×1 held-conditional-memo.test.ts×1 held-frame-dependencies.test.ts×2 ispending-in-boundary-on-3528.test.ts×1 lane-frame-deferred-run-3662.test.ts×1 lane-frame-held-lane-3662.test.ts×1 posture-born-held-and-observation.test.ts×1 treeshake.test.ts×2 write-proposals-3494.test.ts×2 zombie-rerun-after-commit-3546.test.ts×2 | [ruled 2026-09-13 (#3410)] A memo's dependencies are the committed frame's until the frame is replaced — A pass that _staged_ its value has not replaced the committed frame, so the committed value sti… |
77+
| A30 | ruled | `docs/SPEC-ASYNC-SEMANTICS.md:229` | async.ts×3 attribution.ts×1 constants.ts×1 core.ts×1 effect.ts×1 scheduler.ts×5 | async-landing-deps-3461.test.ts×3 fuzz-findings-l2.test.ts×2 held-conditional-effect.test.ts×1 held-conditional-memo.test.ts×1 held-frame-dependencies.test.ts×2 ispending-in-boundary-on-3528.test.ts×1 lane-frame-deferred-run-3662.test.ts×1 lane-frame-held-lane-3662.test.ts×1 posture-born-held-and-observation.test.ts×1 treeshake.test.ts×2 write-proposals-3494.test.ts×2 zombie-rerun-after-commit-3546.test.ts×2 | [ruled 2026-09-13 (#3410)] A memo's dependencies are the committed frame's until the frame is replaced — A pass that _staged_ its value has not replaced the committed frame, so the committed value sti… |
7878
| A31 | live | `docs/SPEC-ASYNC-SEMANTICS.md:103` | boundaries.ts×1 core.ts×1 verdict.ts×2 | fuzz-findings-l2.test.ts×5 ispending-combined-atomic-3442.test.ts×1 | [live 2026-09-14 (#3442)] A memo computes under its own lane posture, never its puller's — A memo's value is one shared slot every reader sees, so its pass runs under the lane posture the memo itself … |
7979
| A32 | ruled | `docs/SPEC-ASYNC-SEMANTICS.md:111` | core.ts×4 lanes.ts×1 store.ts×1 | visibility-oracle-store.states.ts×8 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×9 visibility-oracle.test.ts×1 | [ruled 2026-09-14] Children-forbidden readers see the frame, not the graph — `createTrackedEffect` and `onSettled` callbacks are effect-phase code that runs after the frame is decided. They read the f… |
8080
| A33 | ruled | `docs/SPEC-ASYNC-SEMANTICS.md:245` | boundaries.ts×1 scheduler.ts×1 | async-chain-supersession.test.ts×2 boundary-not-born-held-3540.test.ts×2 fuzz-findings-l2.test.ts×2 ispending-in-boundary-on-3528.test.ts×2 loading-reset-collects-forwarded-3459.test.ts×3 | [ruled 2026-09-12 (#3375)] A fallback-caught flight holds no transaction; a Loading reset moves the hold onto the boundary — A `<Loading>` boundary showing its fallback is the display of everything un… |

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ export function merge(t: Transaction, f: Transaction): void {
229229
* one hop of `_subs` is the chain. Reads of the reader's LAST pass only (the
230230
* link's generation is the pass's): a tail kept for A30 — the committed
231231
* frame's dependency, awaiting the run that retires it — is not a read of
232-
* the flight, and a reader that stopped reading releases it (O3, #3494). A
232+
* the flight, and a reader that stopped reading releases it (O3, #3494).
233+
* An errored pass (NotReady included) did not stop: it never got there, and
234+
* its full list stands (A30) — the reads it did not reach still observe. A
233235
* flight nobody renders holds nothing (A29). Only the nodes `t` still owns
234236
* count: one a lane took over since is the lane's to wait on. A guess whose
235237
* own truth is in flight blocks the lane's parent, not the lane — it stands
@@ -314,7 +316,7 @@ function blockedBy(nodes: Signal<any>[], owner: Transaction, own = false): boole
314316
// over a held window, V5/A17). A probe alone does not hold.
315317
if (
316318
((r as any)._type === EFFECT_RENDER || r._flags & REACTIVE_FRAME_READ) &&
317-
s._gen === r._depGen &&
319+
(s._gen === r._depGen || r._x?._error != null) &&
318320
!(r._flags & REACTIVE_DISPOSED) &&
319321
onScreen(r, judge ?? owner)
320322
)

‎packages/signals/tests/fuzz-findings-l2.test.ts‎

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -273,49 +273,47 @@ describe("fuzz findings on L2 — holds and boundaries", () => {
273273
// resolves)"; A30: "an errored pass (a throw, NotReady included) keeps its
274274
// full list". The tuple reader observed m0's flight for `a=1`; a later
275275
// `b=1` re-runs it and the pass throws NotReady at `m1` before reaching
276-
// `m0`. `blockedBy` reads only the pass's reads up to `_depsTail` (the O3
277-
// "stopped reading" rule), so the unreached `m0` counts as dropped, the
278-
// hold on `a=1` lands, and `A=1` shows beside a tuple still derived from
279-
// `a=0` while m0's flight is in the air.
280-
it.fails(
281-
"F4: a NotReady-interrupted pass still observes the flights it did not reach (A15, A30)",
282-
async () => {
283-
const gates = new Map<string, () => void>();
284-
const [a, setA] = createSignal(0);
285-
const [b, setB] = createSignal(0);
286-
let shownA = -1;
287-
let tuple: number[] = [];
288-
let dispose!: () => void;
289-
createRoot(d => {
290-
dispose = d;
291-
const m0 = createMemo(() => gated(gates, `a:${a()}`, a()));
292-
const m1 = createMemo(() => Promise.resolve(b()));
293-
createRenderEffect(a, v => {
294-
shownA = v;
295-
});
296-
createRenderEffect(
297-
() => [b(), m1(), m0()],
298-
t => {
299-
tuple = t;
300-
}
301-
);
276+
// `m0`. `blockedBy` read only the pass's reads up to `_depsTail` (the O3
277+
// "stopped reading" rule), so the unreached `m0` counted as dropped, the
278+
// hold on `a=1` landed, and `A=1` showed beside a tuple still derived
279+
// from `a=0` while m0's flight was in the air. An errored pass did not
280+
// stop reading: its whole list now observes.
281+
it("F4: a NotReady-interrupted pass still observes the flights it did not reach (A15, A30)", async () => {
282+
const gates = new Map<string, () => void>();
283+
const [a, setA] = createSignal(0);
284+
const [b, setB] = createSignal(0);
285+
let shownA = -1;
286+
let tuple: number[] = [];
287+
let dispose!: () => void;
288+
createRoot(d => {
289+
dispose = d;
290+
const m0 = createMemo(() => gated(gates, `a:${a()}`, a()));
291+
const m1 = createMemo(() => Promise.resolve(b()));
292+
createRenderEffect(a, v => {
293+
shownA = v;
302294
});
303-
flush();
304-
gates.get("a:0")!();
305-
await drain();
306-
expect([shownA, tuple]).toEqual([0, [0, 0, 0]]);
307-
setA(1); // m0 flies for a=1, observed by the tuple reader → a=1 held
308-
await drain();
309-
expect([shownA, tuple]).toEqual([0, [0, 0, 0]]);
310-
setB(1); // the reader re-runs and throws at m1, before reading m0
311-
await drain(4);
312-
// a=1 must not show beside a tuple whose m0 still answers a=0.
313-
expect(shownA === 1 ? tuple[2] : 0).toBe(shownA === 1 ? 1 : 0);
314-
dispose();
315-
gates.get("a:1")?.();
316-
await drain();
317-
}
318-
);
295+
createRenderEffect(
296+
() => [b(), m1(), m0()],
297+
t => {
298+
tuple = t;
299+
}
300+
);
301+
});
302+
flush();
303+
gates.get("a:0")!();
304+
await drain();
305+
expect([shownA, tuple]).toEqual([0, [0, 0, 0]]);
306+
setA(1); // m0 flies for a=1, observed by the tuple reader → a=1 held
307+
await drain();
308+
expect([shownA, tuple]).toEqual([0, [0, 0, 0]]);
309+
setB(1); // the reader re-runs and throws at m1, before reading m0
310+
await drain(4);
311+
// a=1 must not show beside a tuple whose m0 still answers a=0.
312+
expect(shownA === 1 ? tuple[2] : 0).toBe(shownA === 1 ? 1 : 0);
313+
dispose();
314+
gates.get("a:1")?.();
315+
await drain();
316+
});
319317
});
320318

321319
describe("fuzz findings on L2 — lanes", () => {

0 commit comments

Comments
 (0)