You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some small follow-ups to stackless compiler (#55972)
1. Adjust the docstring for `Future`, which had its design changed late
in that PR and is now confusing.
2. Add additional assertions validating the API assumptions of the
`Future` API. I found it too easy to accidentally misuse this and cause
hard-to-debug failures. The biggest change is that `isready` accounts
for delayed assignments again, which allows an additional invariant that
incomplete tasks must always have other pending tasks, allowing for
infinite loop detection in the scheduler.
3. A small fix to use the AbstractInterpreter that created the
InferenceState for the callback. We haven't fully defined the semantics
of mixed-interpreter inference stacks, but downstream packages were
using is and this at least makes it mostly work again.
tasks = sv.tasks # allow dropping gc root over the previous call
1196
1207
completed isa Bool ||throw(TypeError(:return, "", Bool, task)) # print the task on failure as part of the error message, instead of just "@ workloop:line"
1197
-
completed ||push!(tasks, task)
1208
+
if!completed
1209
+
@assert (length(tasks) >= prev ||length(sv.callstack) > prevcallstack) "Task did not complete, but also did not create any child tasks"
1210
+
push!(tasks, task)
1211
+
end
1198
1212
# efficient post-order visitor: items pushed are executed in reverse post order such
1199
1213
# that later items are executed before earlier ones, but are fully executed
1200
1214
# (including any dependencies scheduled by them) before going on to the next item
0 commit comments