Skip to content

Commit b5bd6fb

Browse files
ryansolidClaude via Cursorcursoragent
authored
fix(signals): lane authority — merged hold, reveal-on-flight, INV-11, override supersession with provenance (#3335 #3334 #3330 #3331) (#3370)
Four lane-authority fixes plus their optimistic-store twins and a review re-rule, all pre-existing on next. #3347 re-based directly onto next (landing dispatch is eager, as next's is; the store twins carry the held-adoption born-holding case only — #3336's fold case stays with #3337). #3335 — merged lane hold is per node, not per transaction. laneHeld looked up a lane's pending nodes in its own transaction's _asyncReporters; lanes merge across transactions, so a merged reveal lost the other member's async. waitingTransition(node) finds the live transaction blocked on a node, whichever recorded it. #3334 — a reveal holds on the lane flight it discovers, regardless of stamp. read()'s pending branch showed a stale reader the committed value of a node pending in another transaction (the stamp is bookkeeping, not evidence the inputs are held); handleAsync's settle re-entry entered the lane owner's transaction instead of the waiter's. #3330 — a lane recompute compares against the slot it publishes (INV-11). An OPT-dirty recompute compared against a transaction-staged _pendingValue while publishing to _value and called an identical result unchanged, revealing the override without its derivation. laneReadsCommitted records a reader only when the commit changes what it read. #3331 — own-source arrival supersedes the override, with action provenance (A18). A differing arrival marks the node CONFIG_OVERRIDE_SUPERSEDED: tracked readers see the staged truth (_supersededRead), the lane cascade is demoted and re-derives as held transaction work, the override's downstream flight is inert; untracked reads and the applied frame keep the override to the commit. Equal arrivals confirm silently (the authoritative-observer wake lives in the same hook). The scheduler carries the running action's sequence (`origin`) through each slice and the landing's propagation; an answer from an older action holds silently instead of superseding. Store twins: a held adoption under a live transaction holds on optimistic families too and stages its nodes at the outermost setter exit (stageHeldAdoptions); a key first read under a held adoption is born holding (stageHeldKey); notifyOptimisticWrites judges against the view readers see; the authoritative landing on an override-covered node dispatches to the engine (_landOnOverride). heldFromStale records a reader served another transaction's committed value for that transaction's commit replay. A settle that reverts optimism re-derives its contested effects after the revert. A15 reveal corollary re-ruled: the pending-branch carve-out returns, gated on input visibility (CONFIG_INPUTS_PUBLISHED, a live lane, or an uninitialized node refuse it); recompute drops a stale _gatedSubs recording it is about to apply; a same-value re-prediction renews _overrideStamp. Floor 21,994 -> 22,457 (+463 B; budget 22,500); .size-limit.js caps re-measured against next @ 4935c7d. Spec A15/A17/A18 amendments and the 2026-09-09 re-ruling log; INTERNALS-ASYNC §1–§3/§5; INTERNALS-STORE §3. Closes #3335, closes #3334, closes #3330, closes #3331. Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]>
1 parent 8366e09 commit b5bd6fb

28 files changed

Lines changed: 2625 additions & 142 deletions
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+
Store twins of the lane-authority fixes. An optimistic store's optimistic write after a `yield` now reveals on its lane with its derivations when the action's transaction already holds the same truth (#3330 store twin): adoptions under a live transaction hold on optimistic families too, a held adoption notifies its nodes at write time so the commit promotes silently instead of re-running every subscriber, and a tentative write is judged against the view readers see rather than the swapped-in backing. A derived optimistic store's own truth landing a different value over a tentative edit supersedes the override for the graph now, with action provenance (#3331 store twin): the authoritative landing reaches the engine's supersession, and a tracked reader of a superseded node reads the committed truth once the landing has committed ahead of the override's revert. Surfaced alongside and fixed in core: a reader that first links to a node while another transaction holds a staged write (an effect created during the hold, a store key first read under it) read the committed value but never learned of the commit — such readers now re-derive when the transaction reveals. Plain-store `reconcile` inside an action, and store keys first read under a held adoption, hold like every other write: handlers read committed, `latest()` the staged value, and the reveal comes with the transaction.
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 memo deriving from an optimistic value now reveals together with the override when the override is written after its transaction already staged the same derived result (e.g. `setOptimistic` after an `await` inside an action whose earlier write produced the same value). The lane recompute compared its result against the transaction-held value instead of the value on screen, called it unchanged, and left the derivation stale until the action committed (#3330).
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+
Fix optimistic lanes merged through a shared reader releasing their reveal while one member's async is still in flight (#3335). A lane's hold is a property of each pending async node — looked up in whichever live transaction observed it — not of the merged root's transaction, which after a cross-transaction merge recorded only one member's observations. A memo reading two optimistic values now reveals with both, as it does for plain signals (A15).
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+
An optimistic override is superseded the moment its source recomputes the node with a different value — its own async landing, or a sync recompute driven by an upstream change (`createOptimistic(() => asyncMemo())`): tracked derivations (memos, downstream async) recompute from the arrived truth immediately as held transaction work, instead of waiting for the override's own downstream flight to finish first — so the correction no longer takes two sequential round-trips (#3331). The override remains the displayed value for untracked reads and the applied frame until the transaction commits; `latest()` returns the arrived value and `isPending()` is `true` while they differ. An equal landing confirms silently. Only the override's own question or a newer one supersedes: when two rapid actions overlap on one node, the older action's late answer is held to the commit without moving the graph — a slow source does not leak back in over the user's latest intent.
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+
fix(signals): a reveal of a foreign-held flight shows the committed value unless the flight's inputs are visible; a same-value re-prediction renews the override's provenance
6+
7+
The A15 reveal corollary is re-ruled (review on #3347): a stale (render) reader that lands on a node pending in another transaction shows the node's committed value, does not entangle the two transactions, and re-derives at that transaction's commit — parallel transactions, effects don't entangle. The reveal holds on the flight only when the committed value would tear against the frame: the flight's inputs were published while it was pending (`CONFIG_INPUTS_PUBLISHED`, set by a commit that leaves the node in the air, #3305), the node rides a live lane (optimistic / `latest`, #3334), or the node is uninitialized. An effect recorded for a transaction's commit replay that later recomputes under that transaction drops the stale recording (it is applied by the commit itself). GabbeV's "revealed reader never catches up" and "conditional reader stays hidden" shapes are pinned.
8+
9+
A same-value optimistic write by a newer action now renews the override's provenance stamp on the fast path, so an older action's slow answer no longer supersedes a value the user just re-confirmed (#3331 follow-up).
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 reveal that discovers an async already in flight holds on the flight, whichever transaction the node is stamped with, and completes when the flight lands (#3334; A15 reveal corollary).
6+
7+
- `read()` no longer serves a pending node's committed value to a stale reader just because the node is stamped by another transaction. The stamp is pending-node bookkeeping — the flight's inputs may already be on screen (committed with no observer, #3305; revealed through an optimistic lane, #3334; held only by another reveal waiting on the same flight) — so that value tears the frame. The reader throws, the reveal opens/joins a transition blocked on the flight, and settles as one unit with it.
8+
- Landing a lane-routed async now re-enters the transaction _waiting_ on it (`waitingTransition`) rather than the transaction that owns the lane. Entering the owner made the waiting reveal's stamped recompute merge the owner's still-running action into the reveal, so a `Show` flipped during an optimistic action stayed hidden until the action finished instead of until the data landed.
9+
- `laneHeld` looks the observation up through the same `waitingTransition` helper (#3335).

0 commit comments

Comments
 (0)