Repository navigation
Conversation
A keyed memo whose key had to re-run (on its first read, or after a key input changed) replayed its key reads into the enclosing frame even when the caller had paused tracking with Retree.untracked, so the outer selector or effect subscribed to them. Validated hits already skipped the replay. The check now lives in replayDependencyComparisonAccesses, so every replay honors it. Claude-Session: https://claude.ai/code/session_01Us9f7SPLJUYScpdDnA8oM4
ryanbliss
added this pull request to stack #128
October 8, 2026 21:18
ryanbliss
added a commit
that referenced
this pull request
Oct 8, 2026
A keyed memo whose key had to re-run (on its first read, or after a key input changed) replayed its key reads into the enclosing frame even when the caller had paused tracking with Retree.untracked, so the outer selector or effect subscribed to them. Validated hits already skipped the replay. The check now lives in replayDependencyComparisonAccesses, so every replay honors it. Claude-Session: https://claude.ai/code/session_01Us9f7SPLJUYScpdDnA8oM4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #122. Stacked on #125.
When a keyed memo had to re-run its key,
runKeyedMemocalledreplayDependencyComparisonAccesseswithout a guard. That happens on a memo's first read, and also after one of its key inputs changes. So even when the caller had paused tracking withRetree.untracked, the outer selector or effect inherited the key's reads. Validated hits went throughreplayTrappedMemo, which already checkedisDependencyTrackingActive().The check now lives in
replayDependencyComparisonAccesses, so every replay honors it.runFrameresets the pause depth for nested frames, so a memo's own key frame still tracks its reads for gating.Intended side effect: a keyed memo read inside another memo's body (which also pauses tracking) no longer replays its key into the enclosing frame on a cold run. That matches the warm path and
runMemoBody's design.Performance: the check stays the cheap
isDependencyTrackingActive()exit outside any frame. Review measured warm memo hits in a 2M-read loop at the same speed as before this change.Tests
it.eachinmemo.spec.tscovers a cold memo underRetree.selectandRetree.effect, and a stale memo (key input changed) underRetree.select. All three fail without the fix.npm run test(withNODE_PATHunset, see Keep the query baseline from owning cached results (#117) #124), core typecheck andnpm run doctorall pass.