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
We attempted extracting the method of f where Cassette sets the method_for_inference_limit_heuristics field. But because of the catch-all overdub method, we do not have access to even the type of f since the method signature is all any.
Also there may not be a suitable method for f: e.g. when defining how Duals work using overdub, we're actually trying to substitute for this method some overdubbed action which does not exist.
One thought I had is maybe the inference logic can do with just the types of the variables that a function is called with, but this may require lots of surgery to Core.Compiler.
We should keep in mind what CI.method_for_inference_limit_heuristics is for.
Given an actual callgraph from a program:
f:
g:
h:
m:
Inference uses the call graph to detect call cycles, and limit inferences. We want to retain the structure of the graph when we overdub it.
The graph above get's turned into:
overdub:
overdub:
overdub:
overdub:
So instead of having a callgraph without a cycle, we now have a cycle (and now self-recursion rules kick in). CI.method_for_inference_limit_heuristics communicates the original call-graph, but as Shashi noted if you implement a overdub for all f and use recurse you now introduce cycles again...
Good ✅
Not good ❌
cc @vchuravy
The text was updated successfully, but these errors were encountered: