Skip to content

Commit 74452b1

Browse files
ryansolidClaude via Cursorcursoragent
committed
fix(signals): a born-held effect re-run as lane work re-stages its value (fuzzer F13)
A `latest(source)` render effect whose mount is withdrawn in an action's tick and restored in the next is born held: its creation value is staged (`_pendingValue` 0) and its first run is the commit's (A29). The action's final write re-runs it as the verdict lane's work, and `recompute`'s lane arm wrote an effect's value into its private `_value` (1) — beside the born-held staging. The lane's seam then committed the node: `commitPendingNode` applied the stale staging (0) over the lane's run and queued the effect's run with it, so the committed truth never showed. A29 creation-time form ("staged into it, committed with it"); `recompute`'s own note: "an effect still carrying an uncommitted staged value re-stages: the commit applies the latest pass, not the born-held one". The lane arm now does the same for an effect carrying a staging; an effect with none keeps writing its private slot for the lane's run. F13 flips from `it.fails` to `it`. No other pin moved. Size: +13 B minified (core floor). Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]>
1 parent a337a2a commit 74452b1

4 files changed

Lines changed: 64 additions & 60 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 born-held render effect re-run as lane work (a `latest()` reader remounted during an action's hold) re-stages its value, so the commit applies the latest pass instead of the stale born-held one (fuzzer F13).

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Status legend: **live** stated and standing · **ruled** carries an explicit rul
7373
| A26 | ruled | `docs/SPEC-ASYNC-SEMANTICS.md:87` | — | action-await-contract.test.ts×2 fuzz-findings-l2.test.ts×1 posture-store-parity.test.ts×2 visibility-oracle-store.states.ts×2 visibility-oracle.states.ts×1 visibility-oracle.test.ts×1 | [ruled 2026-07-17] An ambient transaction window is one flush; parking is flush-driven — (**ruled 2026-07-17**, #2913; **enforcement hardened 2026-08-31**, #3141 — parking is flush-driven, and a trans… |
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… |
76-
| A29 | amended | `docs/SPEC-ASYNC-SEMANTICS.md:95` | boundaries.ts×1 action.ts×1 constants.ts×1 core.ts×8 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 … |
76+
| 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 … |
7777
| 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… |
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… |

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,10 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
620620
// revealed (its reveal shows it), as its staging once it has (the
621621
// next reveal promotes it; the screen keeps the revealed value). An
622622
// effect's value slot is private: the run the lane holds is what
623-
// shows it.
624-
if (isEffect) el._value = value;
625-
else if (lane._shown) el._pendingValue = value;
623+
// shows it — unless the effect was born held, whose first run is the
624+
// commit's (A29): it re-stages, as below.
625+
if (isEffect && el._pendingValue === NOT_PENDING) el._value = value;
626+
else if (isEffect || lane._shown) el._pendingValue = value;
626627
else el._x!._lane = value;
627628
} else if (
628629
create

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

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -529,64 +529,62 @@ describe("fuzz findings on L2 — lanes", () => {
529529
// to every channel. A `latest(source)` reader whose mount is withdrawn in
530530
// the action's tick (adopted, O1) and restored in the next (A34 (1)) is
531531
// born held with its creation value (`_pendingValue` 0); the action's
532-
// final write re-runs it as the verdict lane's work (`_value` = 1), and
533-
// the lane's seam then commits the node (`commitPendingNode`), applying
534-
// the stale born-held staging (0) over the lane's run: the committed truth
535-
// never shows. (A plain `source()` read, or a toggle one tick later, is
536-
// fine.)
537-
it.fails(
538-
"F13: a born-held latest() reader re-mounted during the hold shows the action's final write (A29, A28)",
539-
async () => {
540-
const [source, setSource] = createSignal(0);
541-
const [mounted, setMounted] = createSignal(true);
542-
let resume!: () => void;
543-
let run!: () => Promise<void>;
544-
let child: unknown = "absent";
545-
let dispose!: () => void;
546-
createRoot(d => {
547-
dispose = d;
548-
createRenderEffect(mounted, () => {});
549-
createRenderEffect(
550-
() =>
551-
mounted()
552-
? createRoot(dd => {
553-
createRenderEffect(
554-
() => latest(source),
555-
v => {
556-
child = v;
557-
}
558-
);
559-
onCleanup(() => {
560-
child = "absent";
561-
});
562-
return dd;
563-
})
564-
: undefined,
565-
dd => {
566-
if (dd) onCleanup(dd);
567-
}
568-
);
569-
run = action(function* () {
570-
yield new Promise<void>(r => {
571-
resume = r;
572-
});
573-
setSource(1);
532+
// final write re-runs it as the verdict lane's work. The lane arm wrote an
533+
// effect's run into its private `_value` (1) beside the born-held staging,
534+
// and the lane's seam then committed the node (`commitPendingNode`),
535+
// applying the stale staging (0) and queuing the run with it: the
536+
// committed truth never showed. A lane pass of an effect still carrying a
537+
// staging now re-stages it, as the frame's own pass does.
538+
it("F13: a born-held latest() reader re-mounted during the hold shows the action's final write (A29, A28)", async () => {
539+
const [source, setSource] = createSignal(0);
540+
const [mounted, setMounted] = createSignal(true);
541+
let resume!: () => void;
542+
let run!: () => Promise<void>;
543+
let child: unknown = "absent";
544+
let dispose!: () => void;
545+
createRoot(d => {
546+
dispose = d;
547+
createRenderEffect(mounted, () => {});
548+
createRenderEffect(
549+
() =>
550+
mounted()
551+
? createRoot(dd => {
552+
createRenderEffect(
553+
() => latest(source),
554+
v => {
555+
child = v;
556+
}
557+
);
558+
onCleanup(() => {
559+
child = "absent";
560+
});
561+
return dd;
562+
})
563+
: undefined,
564+
dd => {
565+
if (dd) onCleanup(dd);
566+
}
567+
);
568+
run = action(function* () {
569+
yield new Promise<void>(r => {
570+
resume = r;
574571
});
572+
setSource(1);
575573
});
576-
flush();
577-
expect(child).toBe(0);
578-
const p = run();
579-
setMounted(false); // the action's tick: the unmount rides with it (O1)
580-
await drain();
581-
setMounted(true); // a write to a held node: joins the hold (A34 (1))
582-
await drain();
583-
resume(); // the body ends with the truth: source = 1
584-
await p;
585-
await drain(4);
586-
expect(child).toBe(1);
587-
dispose();
588-
}
589-
);
574+
});
575+
flush();
576+
expect(child).toBe(0);
577+
const p = run();
578+
setMounted(false); // the action's tick: the unmount rides with it (O1)
579+
await drain();
580+
setMounted(true); // a write to a held node: joins the hold (A34 (1))
581+
await drain();
582+
resume(); // the body ends with the truth: source = 1
583+
await p;
584+
await drain(4);
585+
expect(child).toBe(1);
586+
dispose();
587+
});
590588
});
591589

592590
describe("fuzz findings on L2 — verdicts", () => {

0 commit comments

Comments
 (0)