-
-
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
fix some cases of diagonal subtyping when a var also appears invariantly #34272
Conversation
@nanosoldier |
Your test job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
GeometryTypes package is an interesting case:
So we have |
Yeah, that's one of the trickiest cases. It's hard to say what we even want |
Right. It's not obvious whether that only means the values for T are required to be the same (because the Tuple itself is invariant), or whether for soundness it must mean that T is also concrete. I'm leaning towards the former interpretation, but maybe it's better if it is the latter (as done here). |
Note: I think that case is described in #26175 (comment), where we see it's currently undecidable given |
Ok, I may have found a version of this that fixes #31824 too, without needing to change any |
@nanosoldier |
I did a bunch of Nanosoldier development changing the report repo layout, so I had to restart your job: |
Your test job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
Hmm, the correct commit is listed at the top of the report, but in the versioninfo output in the logs it looks like it actually ran with the wrong commit. And indeed GeometryTypes passes locally but failed with the same error in the pkgeval run. |
The commit is always going to be different, because we build the merge commit (which doesn't really exist) instead of the head of this pull request. It's possible that some caching is happening though, and that the previous merge commit was used. I'll have a look. EDIT: yes, that's what happening:
|
Trying a more fine-grained run first, as suggested by the report (the system is now busy doing releast-1.4 builds): @nanosoldier |
Your test job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
Ok, IncrementalInference and Sched failures seem to be intermittent, and MbedTLS also crashes on other branches, so this looks OK so far. |
@nanosoldier |
Your test job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
Starting to look good! QuantumAlgebra has an unreachable instruction to investigate; that's about it. |
40298e3
to
7d5db30
Compare
Fixed! Also double-checked that all the other failing packages pass locally. |
@@ -136,6 +136,35 @@ function test_diagonal() | |||
@test issub(Tuple{Tuple{T, T}} where T>:Int, Tuple{Tuple{T, T} where T>:Int}) | |||
@test issub(Vector{Tuple{T, T} where Number<:T<:Number}, | |||
Vector{Tuple{Number, Number}}) | |||
|
|||
@test !issub(Type{Tuple{T,Any} where T}, Type{Tuple{T,T}} where T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused...
julia> Type{Tuple{T, Any} where T} <: Type{Tuple{Any,Any}} <: Type{Tuple{T, T}} where T
true
julia> Type{Tuple{T, Any} where T} <: Type{Tuple{T, T}} where T
false
In fact, we have
julia> Type{Tuple{T, Any} where T} == Type{Tuple{Any,Any}}
true
which looks right to me, as (Tuple{T, Any} where T) == Tuple{Any,Any}
, noting the covariance of T
here. But Type{Tuple{Any,Any}} <: Type{Tuple{T, T}} where T
also looks fine: LHS and RHS become equal for one specific choice of T
on the RHS, namely Any
. And T
does not fall under the diagonal rule. (It would if the where
were inside the Type{}
.) So that would leave me with the conclusion that Type{Tuple{T, Any} where T} <: Type{Tuple{T, T}} where T
should hold. Yet here, we test for the opposite. Wrong test or wrong reasoning? (Note that as it is now, this violates transitivity, so there must be a bug somewhere.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same violation of transitivity can be observed for this simpler case, BTW:
julia> Ref{Tuple{T} where T} <: Ref{Tuple{Any}} <: Ref{Tuple{T}} where T
true
julia> Ref{Tuple{T} where T} <: Ref{Tuple{T}} where T
false
I'd guess we have an issue for this somewhere, but couldn't find one at a quick glance.
This is a part of #31833 that seems to be pretty non-breaking.
fix #26108, fix #26716