Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/display-ahead-gate-leaf-reads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/signals": patch
---

A mount a display-ahead gate opens keeps its seat whatever its own first pass reads ahead (S-58′, D-25). A branch leaf that reads `latest(x)` beside a plain `x()` in one grouped effect, under a hand-written gate, attached early with the committed value beside its own ahead read; it is now born held like a plain-only leaf, as it already was under `<Show>` and with one effect per attribute. Neither hop count nor grouping changes the screen. The same mount under a guess lane (the write inside an action on an optimistic signal) was served the committed value of the lane's re-asked node by the lane's stale-reader arm and revealed with it at the action's landing, through `<Show>` as through a hand-written gate; it is now born held on the lane's flight too (S-58″, S-58‴).
2 changes: 2 additions & 0 deletions documentation/plans/optimism-seam-spike-brief.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,3 +543,5 @@ The reads that stay as today: a sync derivation's reads (the display, memo parit
**D-34's `latest` clause (#4689, built 2026-11-07).** `keptGuess` (lanes.ts: the `marked` set a correction re-homes a shown guess into) read by verdict.ts's held arm: `latest` of such a node is its screen value while the hold is blocked, the staging once it lands. A signal and a superseded keyed row keep the displayed guess (seven pins flipped); a folded keyed arrangement still reads the world whole — kept per leaf it tore (#4336's store forms). S-44's frame 7 now matches; its frame 5 (`isPending` true for an outside input change under a guess) is still open. +25 B isPending/latest, 0 core.

**S-58, the gate with any hop count (built 2026-11-08, after #4717 merged; PR 4708 closed).** `keepReaders` (verdict.ts) no longer publishes a probe's held reader mainline when that reader's frame holds a born-held mount (`holdsMount`: a render effect stamped CONFIG_MOUNT_AHEAD, held, uninitialized, not behind a fallback); `mountPending` (lanes.ts) counts a mount under an open action as waiting. Both walk `aheadMounts`, a lane-module list of born-held mounts collected incrementally from the holds' node lists (one look per held node), so a seam without such a mount pays nothing (PR 4720 review). One-hop and zero-hop gates now keep the fallback through the flight like `<Show>` and the compiled ternary; S-53′ flips to standing with it. Runner `gate: "memo" | "cond"` variant; web pin `display-ahead-gate-hops.spec.tsx`. 0 B core, +57 B isPending/latest.

**S-58′, the mount whose own pass reads ahead (built 2026-11-08, the maintainer's table).** The born-held arm for a stamped mount moves ahead of `frameRead`'s verdict branch and `read`'s pending arm skips `observeFlight` for it: a mount a probing pass opened observes the flight on its first pass whatever it read ahead. `[latest(m2), m0()]` and `[latest(m0), m0()]` in one grouped effect now keep the fallback under every gate, as `<Show>` and a split leaf did. −2 B core, +7 B isPending/latest; row S-58 case ′ and the web pin `display-ahead-gate-leaf-reads.spec.tsx`.
34 changes: 33 additions & 1 deletion packages/signals/docs/INTERNALS-ASYNC-STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,39 @@ The findings that used to follow here (§5a–§5h, 2026-07-06 → 2026-07-16) a
#3540 matrix's early fallback (hidden mounts do not keep the branch;
memos never count, only render effects). 0 B on the core floor; +57 B
brotli on the isPending/latest chunk (the list and its scan), caps raised
with ledger lines.
with ledger lines. The same day, the maintainer's table (S-58′): the row
held for a plain-only leaf and broke once the leaf's one grouped effect
also read ahead — `[latest(m2), m0()]`, or `[latest(m0), m0()]` of the
same node — under a hand-written gate: `<Show>` and a split leaf kept
the fallback, the gates attached with the committed `m0` beside the
ahead read. The born-held arm for a stamped mount sat inside core.ts
`frameRead`'s `!verdict` branch, so a mount whose own pass had opened a
window was a verdict reader first and served the screen (A10's pair,
which is a mainline leaf's rule, not a mount's); and `read`'s pending
arm handed such a reader to `observeFlight` the same way. Both now test
the stamp first: a mount a probing pass opened observes the flight on its
first pass whatever it read ahead, and is born held. −2 B brotli on the
core floor (the clause left the big condition), +7 B on the
isPending/latest chunk. Pins: S-58 case ′ (three variants) and
`web/test/display-ahead-gate-leaf-reads.spec.tsx`, the table itself.
Review (#4723): the new arm, ahead of the lane-over return and the
stale-reader path, also fired for lane work reading a held node that is
not pending — the guess's target under a zero-hop gate — and joined the
flush to the hold (D-37). The arm keeps the old lane guard (`!lane ||`
el pending). The row the review asked for (case ′ with the write inside
an action, a guess on `id`) found the same frame on `next` by another
path: under a guess lane the stamped mount's first pass read the lane's
pending node through lanes.ts `laneRead`'s render-effect arm, which
serves lane work the screen (A15's stale reader, D-28) — the mount
initialized with S-46's frame inside the lane's, revealed at the action's
landing, and kept it after the answer (F-1). The plain-only leaf tore the
same way; only the single-memo gate escaped, by re-creating its branch at
the landing. `laneRead` now returns NOT_PENDING for a stamped
uninitialized mount reading a pending node: it waits on the flight
(`read`'s throw) as in a mainline flush. Pins: S-58 cases ″ (the mixed
leaf) and ‴ (the plain-only leaf), each through `<Show>`, both
hand-written gates and a split leaf. 0 B on the core floor; +18 B brotli
on the isPending/latest chunk (guard and lane arm together).
- 2026-11-07: **A question is asked only of the truth** (F-2's producer
clause; F-6's limit). Prompted by GabbeV's `experiment/unified-updates`
(its tests run against `next`, the differing screens tabled as S-51–S-56)
Expand Down
2 changes: 1 addition & 1 deletion packages/signals/docs/RULES-DERIVED.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ True while an input change is held, while `x`'s own flight for a new question is

A pass's posture is decided by its own reads in that pass, never inherited from a creator or a memo it reads (#4544) and never carried into its next run. Each `latest` or `isPending` read sees the hold's world and joins nothing. A plain read of a node this pass also read ahead is the screen's: the two channels of one node agree within a scope, so `[x(), isPending(x)]` shows `[committed, true]` now in either order (A10, S-27). A memo that hoists that pair keeps the screen it had inline (S-52, 2026-11-07): the display, not the probe, is what makes the pair showable. A plain read of any other held value makes the pass the hold's work (D-1): a mixed `on` waits (S-49), and a memo that probed on its last run and probes nothing on this one holds the tick (S-50, both ruled 2026-11-05). Whether a read throws is that read's own: an earlier display-ahead read does not disarm a later plain read's throw (S-39). A branch a display-ahead read gates is not derived from it: a mount under `<Show when={latest(x) > 0}>` is a mainline mount whose plain reads are the screen's — `latest(x)` inside shows ahead at its own site — and a first pass under it that reads the hold's staging is born held (D-1), attaching at the landing, on its fallback inside a `<Loading>` (S-31, S-46). A render effect off a lane that reads what the lane is revealing — mounted mid-hold, or re-run by an unrelated write — shows the committed value and re-derives at the reveal (S-30). What is rendered from a display-ahead read waits for that read's own async, as one reveal (S-29). A display-ahead pass shows; it never asks (F-6's limit, 2026-11-07): the display — a render effect, a compiled binding, a user effect, and the sync derivations feeding them — holds the value it showed beside the verdict, in a render effect or a memo alike (S-52; hoisting the pair into a memo changes no screen), and an async derivation that reads a held value plainly, or `isPending` of one, is the hold's, asking once, of the truth (S-51, #4677; ruled and built 2026-11-07) — a pass that asks is a verdict reader only by a window of its own, never by reading a verdict memo (#4504). A user effect's callback runs at the frame it belongs to, lane or mainline; async in an effect is the author's.

**Status:** standing; S-51, S-52's #4349 shape and S-46's plain row built 2026-11-07, the plain row for every gate shape 2026-11-08 (S-58: `<Show>`, the compiled ternary, a truthiness memo and a branch memo, or one memo that probes and mounts — and S-53′ with it); a mount whose own pass reads another node ahead still attaches early, see §7; S-49, S-50 ruled, not built. Absorbs D-26, D-27, D-28 (2026-11-06). The 2026-10-28 paragraph "a verdict posture outlives the pass that asked" is withdrawn. Mechanism and history: `INTERNALS-ASYNC-STATE.md` §7.
**Status:** standing; S-51, S-52's #4349 shape and S-46's plain row built 2026-11-07, the plain row for every gate shape 2026-11-08 (S-58: `<Show>`, the compiled ternary, a truthiness memo and a branch memo, or one memo that probes and mounts — and S-53′ with it; S-58′ the same day: the mount's own pass reading ahead, of the same node or another, does not change its seat; S-58″/‴: nor does a guess lane — the mount under an action's guess is born held on the lane's flight, not served the screen as lane work is); S-49, S-50 ruled, not built. Absorbs D-26, D-27, D-28 (2026-11-06). The 2026-10-28 paragraph "a verdict posture outlives the pass that asked" is withdrawn. Mechanism and history: `INTERNALS-ASYNC-STATE.md` §7.

### D-26. A `latest()`/optimistic reader mounted or re-run mid-hold shows the committed value and reveals with the lane

Expand Down
Loading
Loading