Skip to content

Commit 75a1be8

Browse files
committed
2 parents d6b4715 + 1445197 commit 75a1be8

7 files changed

Lines changed: 525 additions & 11 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+
`isPending()` read untracked inside a pass reads what the pass's plain read does in a normal flush — the flush's staging — so a pass never settles on the old value beside the new one. Inside a hold it still reads the committed value, but it is final in the hold's frame (never `true` beside the fresh value), and the pass re-derives on the landed world before the hold's held runs show, so the hold ends with one frame — whether the pass was re-run while the hold was up, first read the held node in a later flush, or probed only in the flush that staged the write. A probe of a first value staged in the current flush (a narrowed `<Show>`/`<Match>` accessor in its landing flush) reads that value instead of `undefined` (#4648).

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Status legend: **live** stated and standing · **ruled** carries an explicit rul
5959
| A12 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:199` | — | createOptimistic.test.ts×2 spec-async-semantics.test.ts×1 | [ruled, amended in place] Resting optimistic nodes report pending like a plain memo — A resting optimistic node reports pending via exactly the causes a plain async memo does (A19) — a reverting optim… |
6060
| A13 | ruled | `docs/SPEC-ASYNC-SEMANTICS.md:207` | — | spec-async-semantics.test.ts×7 | [ruled 2026-07-06 (promoted from B1)] Resting optimistic ≡ plain async memo at every checkpoint — (was B1) A resting optimistic node (no active override) is observationally identical to a plain async … |
6161
| A14 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:215` | — | spec-async-semantics.test.ts×1 | [ruled, amended in place 2026-07-06 (promoted from B2)] Companion nodes get child lanes that do not merge with the owner — (was B2) `isPending`/`latest` companion nodes get child lanes that do not mer… |
62-
| A15 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:251` | async.ts×2 constants.ts×1 core.ts×4 effect.ts×1 lanes.ts×6 scheduler.ts×17 seat.ts×1 verdict.ts×4 store.ts×1 | async-chain-supersession.test.ts×1 boundary-output-frame-reader.test.ts×1 create-deferred-3710.test.ts×2 first-observer-stale-reader.test.ts×1 fuzz-findings-l2.test.ts×17 held-restore.test.ts×1 hold-recovers-landing-reruns-4469.test.ts×1 l2-contract.test.ts×7 l2-fuzz-existing-rules.test.ts×2 lane-contract.test.ts×1 lane-hold-on-observation.test.ts×1 lane-outside-view.test.ts×1 lane-pass-stamped-effect-3662.test.ts×1 latest-memo-inline-parity.test.ts×1 latest-stale-branch-hold-4661.test.ts×1 latest-uninitialized-over-latest-4362.test.ts×1 loading-fallback-in-flush-3540.test.ts×4 mount-over-foreign-hold-3761.test.ts×2 optimistic-lane-seam-loop-4643.test.ts×1 overlapping-flights.test.ts×3 posture-born-held-and-observation.test.ts×4 posture-store-parity.test.ts×2 reveal-carve-out.test.ts×2 shared-effect-no-entangle.test.ts×1 show-stale-child-in-action-4137.test.ts×1 spec-async-semantics.test.ts×2 stale-read-uninitialized-cross-transition.test.ts×1 superseded-source-blocks-3462.test.ts×2 tick-scoped-pass-transaction.test.ts×1 tracked-effect-staged-dep-4606-4607.test.ts×1 treeshake.test.ts×4 unread-derive-midflight-mount-4491.test.ts×1 verdict-memo-flight-no-reask.test.ts×1 verdict-memo-held-branch-4544.test.ts×1 verdict-shortcut-pending-source-liveness.test.ts×1 visibility-oracle-store.states.ts×6 visibility-oracle.states.ts×7 visibility-oracle.test.ts×1 write-proposals-3494.test.ts×1 | [ruled, amended in place 2026-07-06 (promoted from B3)] Transition entanglement is graph-driven; lanes settle as one reveal — (was B3) Transition entanglement is graph-driven: writes whose async work … |
62+
| A15 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:251` | async.ts×2 constants.ts×1 core.ts×4 effect.ts×1 lanes.ts×6 scheduler.ts×18 seat.ts×1 verdict.ts×5 store.ts×1 | async-chain-supersession.test.ts×1 boundary-output-frame-reader.test.ts×1 create-deferred-3710.test.ts×2 first-observer-stale-reader.test.ts×1 fuzz-findings-l2.test.ts×17 held-restore.test.ts×1 hold-recovers-landing-reruns-4469.test.ts×1 l2-contract.test.ts×7 l2-fuzz-existing-rules.test.ts×2 lane-contract.test.ts×1 lane-hold-on-observation.test.ts×1 lane-outside-view.test.ts×1 lane-pass-stamped-effect-3662.test.ts×1 latest-memo-inline-parity.test.ts×1 latest-stale-branch-hold-4661.test.ts×1 latest-uninitialized-over-latest-4362.test.ts×1 loading-fallback-in-flush-3540.test.ts×4 mount-over-foreign-hold-3761.test.ts×2 optimistic-lane-seam-loop-4643.test.ts×1 overlapping-flights.test.ts×3 posture-born-held-and-observation.test.ts×4 posture-store-parity.test.ts×2 reveal-carve-out.test.ts×2 shared-effect-no-entangle.test.ts×1 show-stale-child-in-action-4137.test.ts×1 spec-async-semantics.test.ts×2 stale-read-uninitialized-cross-transition.test.ts×1 superseded-source-blocks-3462.test.ts×2 tick-scoped-pass-transaction.test.ts×1 tracked-effect-staged-dep-4606-4607.test.ts×1 treeshake.test.ts×4 unread-derive-midflight-mount-4491.test.ts×1 verdict-memo-flight-no-reask.test.ts×1 verdict-memo-held-branch-4544.test.ts×1 verdict-probe-committed-4648.test.ts×2 verdict-shortcut-pending-source-liveness.test.ts×1 visibility-oracle-store.states.ts×6 visibility-oracle.states.ts×7 visibility-oracle.test.ts×1 write-proposals-3494.test.ts×1 | [ruled, amended in place 2026-07-06 (promoted from B3)] Transition entanglement is graph-driven; lanes settle as one reveal — (was B3) Transition entanglement is graph-driven: writes whose async work … |
6363
| A16 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:223` | scheduler.ts×1 | caught-reactive-read-diagnostic.test.ts×1 latest-uninitialized-over-latest-4362.test.ts×2 spec-async-semantics.test.ts×1 strict-read-pending-store.test.ts×2 uninitialized-visibility.test.ts×1 visibility-oracle-store.states.ts×2 visibility-oracle.states.ts×2 visibility-oracle.test.ts×1 | [ruled, amended in place 2026-07-06 (promoted from B5)] `isPending` never throws in untracked contexts — (was B5) `isPending` never throws in untracked contexts — thunks that throw real errors or read… |
6464
| A17 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:71` | async.ts×3 constants.ts×1 lanes.ts×7 scheduler.ts×2 seat.ts×1 verdict.ts×1 map.ts×1 optimistic.ts×2 store.ts×3 | create-deferred-3710.test.ts×1 fuzz-findings-l2.test.ts×6 lane-uninitialized-landing-3648.test.ts×5 optimistic-over-held-row-3796.test.ts×1 optimistic-read-lane-not-transaction-3698.test.ts×2 optimistic-undefined-override.test.ts×1 posture-store-parity.test.ts×1 refresh-await.test.ts×1 reveal-gating-contract.test.ts×3 spec-async-semantics.test.ts×10 createOptimisticStore.test.ts×2 kanban-a17-fixture.test.ts×3 optimistic-list-mutation-matrix.test.ts×1 optimistic-maparray-index-frame-f1.test.ts×1 optimistic-untracked-reads-f3-f5.test.ts×1 signal-store-twins-qd.test.ts×1 treeshake.test.ts×1 until.test.ts×1 visibility-oracle-store.states.ts×24 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×20 visibility-oracle.test.ts×1 | [ruled, amended in place 2026-07-06 (promoted from C4)] An active override is the displayed value until its transaction commits, and the graph's value until its own source answers — **Statement (curre… |
6565
| A18 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:81` | action.ts×1 async.ts×2 core.ts×3 lanes.ts×8 scheduler.ts×2 types.ts×1 verdict.ts×1 map.ts×1 optimistic.ts×1 projection.ts×1 | body-end-supersession-visibility.test.ts×4 createOptimistic.test.ts×3 l2-fuzz-existing-rules.test.ts×2 lane-contract.test.ts×1 lane-frame-deferred-run-3662.test.ts×1 lane-outside-view.test.ts×1 lane-uninitialized-landing-3648.test.ts×5 optimistic-move-duplicate-3548.test.ts×2 optimistic-read-lane-not-transaction-3698.test.ts×4 posture-store-parity.test.ts×5 spec-async-semantics.test.ts×5 flight-owned-transaction.test.ts×1 lane-authority-twins.test.ts×1 optimistic-list-mutation-matrix.test.ts×1 optimistic-untracked-reads-f3-f5.test.ts×1 signal-store-twins-qd.test.ts×1 unchanged-presence-no-hold-3743.test.ts×2 superseded-before-first-commit.test.ts×4 visibility-oracle-store.states.ts×8 visibility-oracle-store.test.ts×1 visibility-oracle.states.ts×17 visibility-oracle.test.ts×1 | [ruled, amended in place 2026-07-07 (promoted from B4)] An override lives exactly as long as its own transaction; a newer truth from the source supersedes it in the graph immediately, on screen at com… |

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,8 +1263,11 @@ export function reruns(u: Transaction): unknown {
12631263
// A memo re-deriving its own error holds the release as an effect
12641264
// does (`land`): run first, the held runs showed that error beside a
12651265
// frame about to replace it (#4407; #4284: the grouping never changes
1266-
// the screen).
1267-
frame ||= (r as any)._type || s === r;
1266+
// the screen). So does a memo the landing holds (CONFIG_HELD: its
1267+
// staged value is in this frame): the held runs read it, so shown
1268+
// first they showed the stale pass the re-derivation replaces — one
1269+
// frame reveals the change (F-1, A15; #4648).
1270+
frame ||= (r as any)._type || s === r || r._config & CONFIG_HELD;
12681271
// A lane's reveal leaves the mark to the transaction: a reader that
12691272
// also read a held node as committed (`staleReader`) still observes
12701273
// that flight until it re-runs — cleared here, the transaction landed

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

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,16 @@ function quietPending(el: Computed<any>): boolean {
258258
* `isPending` asks whether the latest view is final). A member of a held
259259
* frame with neither is final. A24: pending iff a value change is in
260260
* flight — a staging equal to what is displayed changes nothing when it
261-
* lands: final now (maintainer, 2026-10-02). */
262-
function heldNotFinal(owner: Computed<any>): boolean {
261+
* lands: final now (maintainer, 2026-10-02). Asked of a node with a
262+
* committed value only (`verdictValue`'s held arm): a first landing never
263+
* gets here. Truthy when not final. */
264+
function heldNotFinal(owner: Computed<any>): unknown {
263265
if ((owner._statusFlags & STATUS_PENDING) !== 0 && !quietPending(owner)) return true;
264266
return (
265267
owner._pendingValue !== NOT_PENDING &&
266268
!latestActive &&
267269
!owner._x!._reask &&
268-
!(owner._statusFlags & STATUS_UNINITIALIZED) &&
269-
(!!owner._x!._shownError ||
270+
(owner._x!._shownError ||
270271
!owner._equals ||
271272
!owner._equals(owner._value as any, owner._pendingValue as any))
272273
);
@@ -585,12 +586,41 @@ function verdictValue(el: Signal<any> | Computed<any>, c: Computed<any> | null):
585586
return el._value;
586587
}
587588
if (tracked) verdictRead(c!, t);
588-
if (probing && heldNotFinal(owner)) probeFound = true;
589+
// #4648: a pass the hold holds (it read the frame's staging) is the
590+
// hold's work, shown at the landing: its probe is final there, never
591+
// `true` beside the fresh value its plain read saw (D-23), in either
592+
// read order. What the probe read is the committed value (maintainer,
593+
// #4662: "during the hold, reads outside latest() get the committed
594+
// value"), so the pass is a stale reader of it and re-derives on the
595+
// landed world (A15, F-1). Not an async memo (`_q`, a flight asked):
596+
// its re-run would ask the hold's question again (F-9).
597+
if (probing)
598+
if (c?._config! & CONFIG_HELD) {
599+
// In the flush that lands the hold (nothing blocks it now: the
600+
// pass is the hold's own work, D-25), the probe reads the landed
601+
// world and the pass is final in the landing frame (F-1). If a
602+
// later node blocks the hold again, the seam re-runs it, held, on
603+
// the committed value (`watchVerdict`; ruling on #4662).
604+
if (el._pendingValue !== NOT_PENDING && !blocked(t)) {
605+
watchVerdict(c!);
606+
if (__TEST__) shadowActual(SLOT_P);
607+
return staged(el);
608+
}
609+
if (!c!._x!._q) staleReader(c!, t);
610+
} else {
611+
if (heldNotFinal(owner)) probeFound = true;
612+
// A pass that first reads the held node in this flush is not held
613+
// yet, in either read order: if the flush parks with it, it runs
614+
// again next round, held, and its probe is final there (D-23). Not
615+
// an async memo or a first pass (it may be async): F-9.
616+
if (owned && !tracked && !c!._x?._q && !(c!._statusFlags & STATUS_UNINITIALIZED))
617+
watchVerdict(c!);
618+
}
589619
if (latestActive && el._pendingValue !== NOT_PENDING) {
590620
// An action body reading another transaction's proposal derives
591621
// from it: the two settle as one (A15; posture C, 2026-09-15). An
592622
// untracked read elsewhere has no transaction to entangle.
593-
if (!tracked && flushTransaction && !globalQueue._running) joinFuture(txOf(el));
623+
if (!tracked && flushTransaction && !globalQueue._running) joinFuture(t);
594624
if (__TEST__) shadowActual(SLOT_P);
595625
return heldLatest(el, tracked ? c : null);
596626
}
@@ -635,10 +665,14 @@ function verdictValue(el: Signal<any> | Computed<any>, c: Computed<any> | null):
635665
// flips if that flush parks (#3078). (The write's own fan-out ran before
636666
// the reader existed; nothing else would re-derive it.)
637667
else if (tracked && probing) watchVerdict(c!);
638-
if (latestActive) {
668+
if (latestActive || uninitialized || (owned && !tracked)) {
639669
// A28: an unflushed write is not what `latest` serves; a tracked
640670
// reader derived from the flushed world runs again in the carrying
641-
// flush.
671+
// flush. A probe in a pass reads as its plain read does (#4648): a
672+
// first value staged this flush has no committed value (D-23 exc. 1,
673+
// F-9), and an untracked read sees the flush's staging — the staging
674+
// flush is a normal flush, not the hold (F-10, D-24; ruled 2026-11-03).
675+
// If the flush parks, what the pass read is the hold's frame.
642676
if (globalQueue._running) {
643677
if (__TEST__) shadowActual(SLOT_P);
644678
return staged(el);

0 commit comments

Comments
 (0)