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
Sometimes, code that is fundamentally type-stable, doesn't get inferred by the Julia compiler due to heuristic inference bounds. I saw Bounded recursion detected. Call was widened to force convergence. in Cthulhu quite a few times, with nested calls to the same function: this happened to me with HOFs like Base.map or Accessors.modify, sometimes with closures added on top (but not necessarily). Surely many others also encountered such an issue, there are at least a couple of related discussions on discourse.
Would it be feasible to let certain functions opt into a more aggressive inference? I'm not sure what the exact recursion limit is set to for now, but letting function authors increase it by a factor of a few would often be useful. This would help composability, because in reality one doesn't just care about whether the result of a composition is correct, but also how performant the code is.
Also I don't know whether this limit is currently defined per-function, per-method, or per-module, and how easy it is to change it locally. But something along these lines would really help!
This discussion was converted from issue #52239 on November 20, 2023 18:36.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Sometimes, code that is fundamentally type-stable, doesn't get inferred by the Julia compiler due to heuristic inference bounds. I saw
Bounded recursion detected. Call was widened to force convergence.
in Cthulhu quite a few times, with nested calls to the same function: this happened to me with HOFs likeBase.map
orAccessors.modify
, sometimes with closures added on top (but not necessarily). Surely many others also encountered such an issue, there are at least a couple of related discussions on discourse.Would it be feasible to let certain functions opt into a more aggressive inference? I'm not sure what the exact recursion limit is set to for now, but letting function authors increase it by a factor of a few would often be useful. This would help composability, because in reality one doesn't just care about whether the result of a composition is correct, but also how performant the code is.
Also I don't know whether this limit is currently defined per-function, per-method, or per-module, and how easy it is to change it locally. But something along these lines would really help!
Beta Was this translation helpful? Give feedback.
All reactions