Repository navigation
Conversation
evaluate never updated curr when it reached a Memoize that already had
a value and the continuation stack was empty, so it looped forever:
val m = Eval.now(1).map { it + 1 }.memoize()
m.value()
Eval.now(0).flatMap { m }.value() // never returns
Treat the cached value as Now(it), as the FlatMap branch already does.
Same fix in SuspendEval.
ptweezy
force-pushed
the
fix/eval-memoize-hang
branch
from
November 5, 2026 16:07
981b7dc to
a2cc386
Compare
This branch has not been deployed
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.
Eval.evaluateloops forever when it reaches aMemoizethat already has a value and no continuations are left, becausecurrnever changes:This sets
curr = Now(it), as theFlatMapbranch already does for a cachedMemoize.SuspendEval.evaluatehas the same bug and fix.Found while checking #4001. The new tests in
EvalTestandSuspendEvalTesthang without the fix. arrow-eval's JVM tests pass; I didn't run the other targets locally.