-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Simple recursive functions can hang in inference #57873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Introduced in #56880. cc @vtjnash. FWIW, the types involved seem to look something like
Even though the type above looks horrible, the returned type from the function is normal: julia> fnames
3-element Vector{String}:
"/var/folders/tp/2p4x9ygx48sgsdl1ccg1mp_40000gn/T/jl_Y36H2N6PMv"
"/var/folders/tp/2p4x9ygx48sgsdl1ccg1mp_40000gn/T/jl_MzArgrmRYp"
"/var/folders/tp/2p4x9ygx48sgsdl1ccg1mp_40000gn/T/jl_E3EpCFMD01"
julia> dataset = NCDataset(fnames);
julia> typeof(dataset)
CommonDataModel.MFDataset{DeferDataset{NCDataset}, 1, String} So I don't know if inference is going on a wild goose chase or something... |
The following code reduced from a package that hits the time-limit also gets bisected to #56880 so it seems that PR is somewhat problematic: function tt(TY::Type, pref=("",))
println("I am now running...")
ret = String[]
ST = subtypes(TY)
for i in 1:length(ST)
append!(ret, tt(ST[i], (pref..., "")))
end
ret
end
tt(Int)
Removing the 1.11 has no problem with it:
It seems even here as in the first full package example some big types are "imagined" by inference:
|
This might be a dup of #57098 but the MWE in the comment above might still be useful. |
Any update on this? Still many packages that time out in PkgEval. |
Prevent infinite inference when dealing with LimitedAccuracy by declining to cache them. Presence in the cache triggers further compilation to resolve it, so removing infinite work from the cache also prevents infinite work at pre-compile/jit compile time. Fix #57098 Fix #57873 (cherry picked from commit 48bd673)
) Prevent infinite inference when dealing with LimitedAccuracy by declining to cache them. Presence in the cache triggers further compilation to resolve it, so removing infinite work from the cache also prevents infinite work at pre-compile/jit compile time. Fix JuliaLang#57098 Fix JuliaLang#57873
) Prevent infinite inference when dealing with LimitedAccuracy by declining to cache them. Presence in the cache triggers further compilation to resolve it, so removing infinite work from the cache also prevents infinite work at pre-compile/jit compile time. Fix JuliaLang#57098 Fix JuliaLang#57873
Uh oh!
There was an error while loading. Please reload this page.
Edit: See comment #57873 (comment) for most up to date info.
The following code takes a second or so to run on 1.11
On 1.12 it gets stuck in inference for at least more than a minute.
The text was updated successfully, but these errors were encountered: