Skip to content

2.0: a pass that reads latest(s) before s() computes twice on a plain write #4402

Closed

Description

@ryansolid

On next @ 7ebd4a3 (and on #4401), a reader whose compute reads latest(s) before s() computes twice on a single plain synchronous write (no action, no async). Reading s() first computes once (pinned in #4401).

const [s, set] = createSignal(0);
createRenderEffect(() => [latest(s), s()], () => {}); // compute runs twice per set()
set(1); flush();

The same happens inline in JSX or through a memo, and with a memo, render effect or user effect as the reader.

Why it happens. A pass that has read only latest() so far enters the verdict lane on purpose. That is what lets a Show over latest() mount its child once (#3540, boundary-not-born-held-3540 pins mounts [1, 2, 2]). The plain s() read that follows is then lane work, so it is served the screen (D-37) and runs again at the landing.

What was tried in #4401. Neither attempt worked:

A fix needs the verdict lane's seam to treat verdict readers differently from lane work. The rules involved are D-22 (one pass; re-derive once only if the flush parks), D-37, F-10 and the #3540 ruling.

Expected: one compute per plain write whatever the read order, as for [s(), latest(s)].

Activity

  1. ryansolid commented on Oct 29, 2026

    @ryansolid
    MemberAuthor

    Fixed on next by #4393 (81a12d8): the latest-first [latest(s), s()] read now computes once per plain write for render effects, memos and user effects. It ships in the next RC; a pin follows in a tests-only PR.


    Generated by Claude Code

  2. added 2 commits that reference this issue on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions