-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Inference regression on 1.7-RC2 and master (relative to 1.6.3) #42839
Comments
Tested on fresh master (c054dbc) just now, persists. |
It might be worth noting that this (though naughty) works:
|
It is perhaps worth noting that the internal tuple_type_tail function was deprecated and is not supported anymore (in favor of ntuple and fieldtype typically) |
A bisect might be useful here. |
Thanks for letting me know! I was aware of tuple_type_head's deprecation to |
For the deprecation, do you mean we should replace it with something like this?: julia> T = NTuple{8, Int8}; Tuple(fieldtype(T,i) for i in 2:fieldcount(T))
(Int8, Int8, Int8, Int8, Int8, Int8, Int8) Or if that's not what you mean, can you expand on what we should replace it with? Thanks EDIT: oh, whoops, also this isn't even computing the same thing, so ignore this. |
Usually now we try to avoid forming the tuple of types, by using |
Kicked one off 🍿, will report back. |
Bisect points to
|
Cross ref: #42835 and my comment on 42835 issue at discourse It seems this is also caused by
Then we get:
With this strategy you can infer arbitrarily large tuple, the following code infers
But if you skip over some number (>=3) then inference fails:
Contrasted to In Julia 1.6.1, the inference of arbitrarily large tuple succeeds in any order of evaluation. I guess the patch that @Sacha0 quotes strengthens recursion detection and causes Julia stops to make progress with |
I don't exactly see how the case that @Sacha0 posted in the OP on this issue should be affected by the change that #40379 (pointed to by bisect) was meant to make. It seems that #40379 was trying to fix #40336, where inference itself could get stuck in a loop because it wasn't detecting that But the code in @Sacha0's original post doesn't seem to ever introduce Do you think that PR accidentally now catches other patterns as being an increase in complexity that it didn't mean to? |
I checked on master, and this infers concretely again. Although I will note that Base.tuple_type_tail is deprecated, since it can lead to problems with correctness (#42839 (comment)). |
@NHDaly (🙏) and I reduced the following out of a regression on Julia 1.7-RC2. Happily, on Julia 1.6.3:
While on 1.7-RC2:
And on several day old master:
The text was updated successfully, but these errors were encountered: