-
-
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
Type instability with Base.promote_type
and Static.jl types for Julia v1.10-beta2 and --check-bounds=no
#50985
Comments
I take it this is distinct from (though possibly indirectly related to) the issue discussed in #50239? |
On 1.9 with
On 1.10 with
This might be #48684 cc: @aviatesk I hoped #50561 would improve the situation, but it doesn't seem enough. |
Is this another consequence of the removal of |
Kinda, #48684 replaced special handling of the almost intrinsics. So it's more than just a removal of pure. |
Putting this on the milestone since we will need to fix this in either |
When using Julia v1.10-beta2 with
--check-bounds=no
, using Static.jl types together with native types causes a type instability. In fact, it looks likeBase.promote_type
is not able to infer a concrete type at all anymore and just returnsAny
.MWE (with
julia-1.10-beta2 --check=bounds=no
):The error does not occur if I use Julia v1.10 without
--check-bounds=no
or when using Julia v1.9 (with or without--check-bounds=no
). On those cases, we get the following output for@code_warntype
:The issue first appeared when trying to use
PtrArray
from StrideArrays.jl (see also JuliaSIMD/StrideArrays.jl#78). There, the failure to determine a usable promotion type propagates into a regular array access returning values of typeAny
, making the code unusably slow.Thanks to @ranocha for creating a more minimum MWE. Maybe @vchuravy has an idea how to fix this (since he resolved a similar issue for v1.9 and StaticArrays.jl)?
cc @chriselrod
The text was updated successfully, but these errors were encountered: