Skip to content

Commit 0bfc6ec

Browse files
committed
Follow solidjs/solid#4695: latest of a shown guess keeps it until the commit; DV-19 is Solid's
- H-11: an answer is compared with the guess and corrects the graph now, but the screen, the guess's effects and `latest x` of a guess the screen shows keep it until the hold commits (Solid D-22, D-34, decision 3). H-7's "after a correction, the truth" narrowed to a guess the screen never showed. - Interpreter: `latest` of a shown, answer-corrected guess answers the guess until the commit. - S-latest-reask back to `2 / 2`, with the changed-truth variant; DV-19 recorded at four instants (#4689 ruled, not built). - CN-3e message, spec/08 and guide/reference.md back to what holds: both fixes show the guess. - References keep the count under the list's region (right by the spec either way, and not dependent on #4689). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWMbSPnht6GSU1vp8Pe
1 parent 8190e1e commit 0bfc6ec

10 files changed

Lines changed: 73 additions & 69 deletions

File tree

‎compiler/src/check.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3154,7 +3154,7 @@ impl<'a> Checker<'a> {
31543154
"LOADING_ON_OUTSIDE_HOLD",
31553155
"CN-3e",
31563156
format!(
3157-
"`{}` is read here, outside the `loading on({})` region that waits on it: when `{}` changes this read holds the change, so the region's fallback never shows and the old content stays up with no sign of the wait — move the read under the region (it then shows what the region shows, a guess included), or read `latest {}` here (the newest answer: once one lands it replaces a pending guess)",
3157+
"`{}` is read here, outside the `loading on({})` region that waits on it: when `{}` changes this read holds the change, so the region's fallback never shows and the old content stays up with no sign of the wait — move the read under the region, or read `latest {}` here",
31583158
name, on, on, name
31593159
),
31603160
);

‎eval/results/rc21-regrade-2026-11-05/README.md‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,18 @@ The `latest issues` reference's three fuzz holes, replayed:
2121

2222
| seed | hole | cause | owner |
2323
| --- | --- | --- | --- |
24-
| 1 | the tab count shows 3 beside 2 rows, a close in flight | `latest issues` answers the re-asked truth, not the guess, once a list refresh lands under a pending close | the reference: by H-11 an answer that lands corrects the guess for `latest` (DV-19, Solid's position adopted) |
24+
| 1 | the tab count shows 3 beside 2 rows, a close in flight | `latest issues` answers the re-asked truth, not the guess, once a list refresh lands under a pending close | Solid: `latest` should keep a shown guess until its hold commits (solidjs/solid#4689, ruled in #4695 decision 3, not built; DV-19) |
2525
| 11 | an accepted rename's row shows the old title until the refresh lands | the row was not in the list when the rename was sent (`findIndex` -1): nothing was guessed on it | the app; `guide/async.md` §4 now says so |
2626
| 15 | an accepted rename's detail heading shows the old title until the refresh lands | the detail was still loading when the rename was sent: nothing was guessed on it (the row guess held) | the app; the same |
2727

2828
Seed 1 was the reference as the checker suggested it: CN-3e refuses the count effect's read of `issues` outside the
29-
`loading on(filter)` region and suggested `latest issues`. Four references (chain2, chain3, chain4, count) had the
30-
outside read, predating the rule. The spec first called seed 1 Solid's (DV-19, filed as solidjs/solid#4689); Solid
31-
compares a landing answer with the guess, not with the truth the guess was made over, and that position is adopted
32-
(2026-11-05, #4689 expected to be declined): `latest x` is the truth once an answer lands, so it is not the count the
33-
list shows. The references now read the count where the list is read, in a small component under the list's region
34-
(it holds and reveals with the rows), and CN-3e's message says when each fix fits. With that, chain4 has two fuzz
35-
holes, both the app's (seeds 11 and 15), and chain2, chain3 and count pass their own tasks' hidden and overlap tests
36-
(`graded/`).
29+
`loading on(filter)` region and suggests `latest issues`. Four references (chain2, chain3, chain4, count) had the
30+
outside read, predating the rule. By the spec (and Solid's own ruling, #4695 decision 3) `latest issues` answers the
31+
guess the list shows, so that program is right and the hole is Solid's (DV-19, #4689, not built). The references
32+
read the count where the list is read instead, in a small component under the list's region: it holds and reveals
33+
with the rows, it is equally right by the spec, it does not depend on #4689, and it is what 10 of 12 agent desks in
34+
rounds 10 and 11 wrote. With it, chain4 has two fuzz holes, both the app's (seeds 11 and 15), and chain2, chain3 and
35+
count pass their own tasks' hidden and overlap tests (`graded/`).
3736

3837
Reducing seed 15 turned up a second Solid bug, solidjs/solid#4690: with nothing rendering a store, an effect reading it
3938
sees a guess revert at the action's end, before the action's refresh lands, once an outside re-ask has landed under it.
@@ -54,7 +53,7 @@ names ("refresh every question you guessed on"). Nothing in round 4's residue is
5453

5554
## Reference suites on rc.21
5655

57-
Interpreter 114 pass; oracle and compiled 114 pass, 2 recorded divergences (DV-20 at two instants);
56+
Interpreter 114 pass; oracle and compiled 114 pass, 6 recorded divergences (DV-19 at four instants, DV-20 at two);
5857
server render 107 pass, 7 skip (not rerun after the review fixes); types 156 pass; the crate agrees with ref/ on 321/321 programs.
5958

6059
S-store-8 (two actions' guesses on one row; a declined one reverts alone) had failed on the interpreter since the
@@ -63,9 +62,9 @@ the row and the older action's decline found nothing of its own to revert. Guess
6362
(`ref/src/runtime.ts`), as H-11 says; the same-key variant added to S-store-8 passes on all three runners. A new answer that corrects a guess (D-34) marks
6463
the action's entry spent instead of dropping it, so the action's re-ask still holds the corrected guess (D-35): with
6564
the entry dropped, a closed row came back between the write landing and the re-ask (S-latest-reask's variant, `4 / 4`
66-
for `2 / 4`; Solid shows `2 / 4`). With DV-19 adopted, the interpreter corrects on any landing answer that differs from the
67-
guess (before, only on one that changed the truth), and a corrected guess's effects wait for the commit as its views
68-
do.
65+
for `2 / 4`; Solid shows `2 / 4`). The interpreter now follows #4695's D-34: a landing answer is compared with the guess (before,
66+
only one that changed the truth corrected), the correction re-derives the graph, and the screen, the guess's effects
67+
and `latest` of a shown guess keep it until the hold commits.
6968

7069
## Setup
7170

‎guide/reference.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ Expr ::= TypeScript's, without assignment, `this`, `function`, `new` on rea
7676
- A `loading` region shows its fallback instead of holding while it is **armed**: before it first showed content,
7777
and again each time its `on(x)` value changes. Otherwise a change below it holds (H-5). Put a read that waits on
7878
`x` inside the `loading on(x)` region; a read of it outside holds the change (CN-3e).
79-
To report what the region shows, guesses included, read it inside the region (a child component there can hold an
80-
effect). `latest x` outside is the newest answer instead: an answer that lands replaces a pending guess there (H-11).
8179
- `pending? x` is true while a new answer for `x` is out; `latest x` is the value `x` is moving to (R-9). Use them to
8280
show work in progress without a fallback.
8381
- `await e -> v` gives `v` until the first answer, so there is no first-load wait (R-7).

‎ref/oracle/repros/README.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,10 @@ thunk makes, never its return value (RULES-DERIVED D-24, A23) — so it is
384384

385385
---
386386

387-
## DV-19 — `latest()` over a pending guess answers the re-asked truth once a re-ask lands under it — filed as solidjs/solid#4689; Solid's position adopted 2026-11-05
387+
## DV-19 — `latest()` over a pending guess answers the re-asked truth once a re-ask lands under it — filed as solidjs/solid#4689; ruled a bug in #4695 (decision 3), not built
388388

389-
**Rule (as it was).** Spec R-12 and H-7: `latest x` reads past a hold but answers what `x` shows, the guess while its
390-
action is out. **Now:** H-11 compares a landing answer with the guess, so the outside answer is a correction and `latest`
391-
is the truth (S-latest-reask instant 4 `2 / 3`, no divergence). The repro stays as the record of the shape.
389+
**Rule.** Spec H-11 and H-7: `latest x` of a guess the screen shows answers the guess until its hold commits, even after
390+
an answer corrected the graph (Solid D-22, D-34, decision 3 of #4695; S-latest-reask instants 4 and 5).
392391

393392
**Shape.** A keyed `createOptimisticStore` over an async loader; an action guesses a row away and awaits; the store is
394393
refreshed from outside the action and that answer lands while the guess is pending. The same with `createOptimistic`

‎ref/oracle/repros/dv19-latest-reask.mjs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// the guess, while its action is out. After the re-ask lands: store.length 2, latest 2.
55
// Observed on 2.0.0-rc.21 (next @ 2105ffb8): store.length 2, untrack 2, latest 3. Before the re-ask lands, latest is 2.
66
// The signal form (createOptimistic over createSignal(async)) does the same: detail().title "New", latest "Old".
7-
// Found by the timing fuzzer on the chain4 reference desk. Filed as solidjs/solid#4689; Solid's position adopted 2026-11-05
8-
// (spec 05 DV-19, H-11): the outside answer is a correction, so `latest` answering the truth is the spec's frame now.
7+
// Found by the timing fuzzer on the chain4 reference desk. Filed as solidjs/solid#4689; ruled a bug in #4695 (decision 3), not built.
98
import { createRoot, createSignal, createOptimistic, createOptimisticStore, action, refresh, latest, untrack, flush } from "solid-js";
109
const tick = async () => { for (let i = 0; i < 4; i++) { await new Promise(r => setTimeout(r, 0)); flush(); } };
1110
const asks = []; const ask = key => new Promise((res, rej) => asks.push({ key, res, rej }));

‎ref/src/check.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ class Checker {
343343
});
344344
for (const f of found) {
345345
this.line = f.line;
346-
this.err("LOADING_ON_OUTSIDE_HOLD", "CN-3e", `\`${f.name}\` is read here, outside the \`loading on(${f.on})\` region that waits on it: when \`${f.on}\` changes this read holds the change, so the region's fallback never shows and the old content stays up with no sign of the wait — move the read under the region (it then shows what the region shows, a guess included), or read \`latest ${f.name}\` here (the newest answer: once one lands it replaces a pending guess)`);
346+
this.err("LOADING_ON_OUTSIDE_HOLD", "CN-3e", `\`${f.name}\` is read here, outside the \`loading on(${f.on})\` region that waits on it: when \`${f.on}\` changes this read holds the change, so the region's fallback never shows and the old content stays up with no sign of the wait — move the read under the region, or read \`latest ${f.name}\` here`);
347347
}
348348
}
349349

‎ref/src/runtime.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class Node {
7070
deferred = false; lagging = false; // V-16 / D-40: declared lag — re-asks never hold; readers keep the shown answer
7171
question = false; // ST-5: `source x = e` — an equation until written
7272
guess: unknown = undefined; hasGuess = false; guessBy: number | null = null; corrected = false; guessPaths: Path[] = [];
73+
shownGuess: unknown = undefined; guessShown = false; answerCorrected = false; // D-22/D-34 (Solid decision 3, #4695): the guess as the screen last showed it; `latest x` keeps it after an answer corrects the graph, until the hold commits
7374
guessEntries: { path: Path; by: number; value: unknown; spent?: boolean }[] = []; // H-11: each guess with the hold it was made over ("" = the root); `guess` is the truth with the live ones applied in order; `spent`: a new answer corrected it (D-34) — it shows the truth now but still belongs to its action, so the action's re-ask still holds it (D-35) and its end still ends it // guessPaths: the keys guessed ("" = the root; AC-3 path targets) // AC-3 / H-11: a guess over the hold `guessBy`; corrected: the truth differed, display keeps what it showed
7475
quiet = false; refreshBy: number | null = null; refreshInAction = false; // AC-4: a quiet re-ask; its landing belongs to the change that asked (D-31)
7576
affectedBy: number | null = null; // AC-5: declared pending until that change lands
@@ -344,6 +345,7 @@ export class Runtime {
344345
if (this.openChanges.has(this.find(this.instant))) for (const { reader, lb } of this.bornHeldOwn) { lb.caught.push(reader); lb.showingFallback = true; reader.heldOn = null; } // D-27: born held under a fresh boundary → the boundary's
345346
else for (const { lb } of this.bornHeldOwn) { lb.bornCandidates = 0; lb.showingFallback = lb.caught.length > 0; if (!lb.showingFallback) lb.armed = false; }
346347
// Verdicts are final only after the decision (H-9): lane readers re-settle against the decided world, then show ahead (H-7).
348+
for (const n of this.allNodes()) if (n.hasGuess && !n.corrected && !this.heldLanes.has(n)) { n.guessShown = true; n.shownGuess = n.guess; } // D-22: the guess the screen shows now (a held lane's guess is not shown: S-solid-33)
347349
for (const n of this.allNodes()) if (n.lane) { n.state = "clean"; this.markDirty(n); } // re-settle lane nodes; their subscribers are notified too (a dirty node whose subs were not told blocks later invalidation)
348350
this.settle(this.view, [], null);
349351
this.patchLanes(this.view);
@@ -391,7 +393,7 @@ export class Runtime {
391393
if (n.heldOn !== null && this.find(n.heldOn) === g) n.heldOn = null;
392394
if (n.hasGuess && (this.guessedBy(n, g) || (n.guessBy !== null && this.find(n.guessBy) === g))) { // H-11: a guess lives as long as its hold; another action's guesses on the node stay
393395
n.guessEntries = n.guessEntries.filter(e => this.find(e.by) !== g); n.corrected = false;
394-
if (n.guessEntries.length === 0) { n.hasGuess = false; n.guess = undefined; n.guessBy = null; n.guessPaths = []; } else this.rebuildGuess(n);
396+
if (n.guessEntries.length === 0) { n.hasGuess = false; n.guess = undefined; n.guessBy = null; n.guessPaths = []; n.guessShown = false; n.shownGuess = undefined; n.answerCorrected = false; } else this.rebuildGuess(n);
395397
this.notify(n, "");
396398
}
397399
for (const [k, c] of n.heldKeys) if (this.find(c) === g) n.heldKeys.delete(k);
@@ -648,7 +650,7 @@ export class Runtime {
648650
let v: unknown;
649651
try { v = n.compute!(this); } catch (e) { if (e instanceof RuleError) throw e; v = new ErrVal(e); }
650652
this.tracking = prevTracking;
651-
const landed = n.landing && !(v instanceof PendingVal); n.landing = false; // a new answer, even one equal to the truth the guess was made over (DV-19: Solid's position)
653+
const landed = n.landing && !(v instanceof PendingVal); n.landing = false; // a new answer, even one equal to the truth the guess was made over: it is compared with the guess (D-34)
652654
this.subscribe(n);
653655
if (n.deferred && n.answered && v instanceof PendingVal) { n.lagging = true; v = n.value; } // D-40: a declared-lag re-ask keeps showing its last answer
654656
else if (n.deferred) n.lagging = false;
@@ -659,7 +661,7 @@ export class Runtime {
659661
if (!n.hasValue) ch.add(""); else diffPaths(n.value, v, "", ch);
660662
if (ch.size > 0) { if (n.hasValue) { n.prev = n.value; n.hasPrev = true; } n.value = v; n.changed = true; n.changedSinceCommit = true; } // C-2: `pre` is the value before this change
661663
n.hasValue = true;
662-
if (n.hasGuess && !isAbsent(v) && (ch.size > 0 || landed)) { const dg = new Set<Path>(); diffPaths(v, n.guess, "", dg); if (guessedAt(n, dg)) { for (const e of n.guessEntries) if (guessedAt({ guessPaths: [e.path] }, dg)) e.spent = true; if (n.guessEntries.some(e => !e.spent)) this.rebuildGuess(n, v); else n.guess = v; n.corrected = true; } } // D-34: a new answer different from the guess at a guessed key corrects the graph now (`latest x` the truth); equal there confirms silently (the screen keeps the guess's world until the commit)
664+
if (n.hasGuess && !isAbsent(v) && (ch.size > 0 || landed)) { const dg = new Set<Path>(); diffPaths(v, n.guess, "", dg); if (guessedAt(n, dg)) { for (const e of n.guessEntries) if (guessedAt({ guessPaths: [e.path] }, dg)) e.spent = true; if (n.guessEntries.some(e => !e.spent)) this.rebuildGuess(n, v); else n.guess = v; n.corrected = true; n.answerCorrected = true; } } // D-34: a new answer different from the guess at a guessed key corrects the graph now (derivations; `latest x` of a shown guess keeps it, D-22); equal there confirms silently (the screen keeps the guess's world until the commit)
663665
if (!(v instanceof PendingVal)) n.answered = true; // H-12: an error is an answer (a first load ends with it — found by S-ai2-search)
664666
if (n.kind === "eq" && notified && v instanceof PendingVal && !(n.deferred && n.answered) && !n.quiet) n.heldBy = this.instant; // a deferred node's first load holds like any // R-4: a pass this change triggered asked a new question; its pending belongs to this change
665667
if (n.heldBy !== null) n.taint.add(n.heldBy);
@@ -779,6 +781,7 @@ export class Runtime {
779781
const ahead = !!ln?.hasGuess; // DV-10: `latest` of a guess reads ahead of the guess's held lane (Solid #4284)
780782
if (this.tracking) { this.tracking.lane = true; if (ln) this.addLane(ln, !ahead); }
781783
if (this.committedView && ln && ln.hasCommitted) { this.track(ln, ""); return ln.committed; } // D-26: an outsider shows what is on screen
784+
if (ln && e.e.k === "id" && ln.hasGuess && ln.answerCorrected && ln.guessShown && this.frozen(ln)) { this.track(ln, ""); return ln.shownGuess; } // D-22, D-34 (Solid decision 3; DV-19): an answer corrected the graph, but the slot still displays the guess: `latest` keeps it until the hold commits
782785
this.probing++; if (ahead) this.latestOfGuess++; let v: unknown; try { v = this.ev(e.e, region, env); } finally { this.probing--; if (ahead) this.latestOfGuess--; }
783786
if (v instanceof PendingVal && ln && ln.hasCommitted && e.e.k === "id") return ln.committed;
784787
if (v instanceof PendingVal && !this.demandMode) throw new Error("NotReadyError: latest of a value that has never had one"); // R-12: in imperative scope as anywhere, `latest` of a first load throws (Solid S-28, A7)
@@ -1090,7 +1093,7 @@ export class Runtime {
10901093
const dg = new Set<Path>(); diffPaths(truth, n.guess, "", dg);
10911094
if (guessedAt({ guessPaths: mine.map(e => e.path) }, dg)) { // this action's keys differ from the truth at hand: corrected; another action's keys keep their guesses
10921095
n.guessEntries = n.guessEntries.filter(e => this.find(e.by) !== g); this.rebuildGuess(n, truth);
1093-
n.hasGuess = true; n.corrected = true; n.guessBy = g; any = true;
1096+
n.hasGuess = true; n.corrected = true; n.answerCorrected = false; n.guessBy = g; any = true;
10941097
}
10951098
}
10961099
}

0 commit comments

Comments
 (0)