Skip to content
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

Testing Diagonalization asserts on 1.8 in subtyping #45703

Closed
KristofferC opened this issue Jun 16, 2022 · 2 comments · Fixed by #45771
Closed

Testing Diagonalization asserts on 1.8 in subtyping #45703

KristofferC opened this issue Jun 16, 2022 · 2 comments · Fixed by #45771
Assignees
Labels
domain:types and dispatch Types, subtyping and method dispatch kind:regression Regression in behavior compared to a previous version
Milestone

Comments

@KristofferC
Copy link
Sponsor Member

KristofferC commented Jun 16, 2022

https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/8b2e406_vs_742b9ab/Diagonalizations.primary.log

(jl_2ZlRez) pkg> test Diagonalizations
....

signal (6): Aborted
in expression starting at /home/kc/.julia/packages/Diagonalizations/VKvpN/test/runtests.jl:93
pthread_kill at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
raise at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7fdc5af2171a)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
ijl_subtype_env at /home/kc/julia1.8/src/subtype.c:1878
subtype_tuple_tail at /home/kc/julia1.8/src/subtype.c:1076 [inlined]
subtype_tuple at /home/kc/julia1.8/src/subtype.c:1158 [inlined]
subtype at /home/kc/julia1.8/src/subtype.c:1298
exists_subtype at /home/kc/julia1.8/src/subtype.c:1394
forall_exists_subtype at /home/kc/julia1.8/src/subtype.c:1422
ijl_types_equal at /home/kc/julia1.8/src/subtype.c:1969
jl_specializations_get_linfo_ at /home/kc/julia1.8/src/gf.c:129
#specialize_method#255 at ./compiler/utilities.jl:204
specialize_method at ./compiler/utilities.jl:190 [inlined]
typeinf_edge at ./compiler/typeinfer.jl:823
abstract_call_method at ./compiler/abstractinterpretation.jl:643
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:154
abstract_call_known at ./compiler/abstractinterpretation.jl:1674
...

Also happens for PosDefManifoldML.jl

@KristofferC KristofferC added the kind:regression Regression in behavior compared to a previous version label Jun 16, 2022
@KristofferC KristofferC added this to the 1.8 milestone Jun 16, 2022
@JeffBezanson JeffBezanson self-assigned this Jun 16, 2022
@JeffBezanson JeffBezanson added the domain:types and dispatch Types, subtyping and method dispatch label Jun 16, 2022
@JeffBezanson
Copy link
Sponsor Member

JeffBezanson commented Jun 16, 2022

Reduced:

T = TypeVar(:T,Real)
V = TypeVar(:V,AbstractVector{T})
x = UnionAll(T, UnionAll(V, UnionAll(T, Type{Pair{T, V}})))
y = UnionAll(T, UnionAll(V, Type{Pair{T, V}}))
x <: y

So we have a nested UnionAll using the same TypeVar, which confuses obvious_subtype.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 17, 2022

That confuses me too haha. I suspect this would confused obviously_egal too, since we normally assume == (or egal) implies <:, but here that is false. Neither should really need that case, though it may get worse, as we also could have this, and it is much more unfortunate that we must recurse into check the contents of S here:

T = TypeVar(:T,Real)
V = TypeVar(:V,AbstractVector{T})
S = Type{Pair{T, V}}
x = UnionAll(T, UnionAll(V, UnionAll(T, S)))
y = UnionAll(T, UnionAll(V, S))
x <: y

vtjnash pushed a commit that referenced this issue Jun 27, 2022
When egal objects contain identical typevars with different
environments, the resulting subtyping might not be so obvious.

Fix #45703
KristofferC pushed a commit that referenced this issue Jul 4, 2022
When egal objects contain identical typevars with different
environments, the resulting subtyping might not be so obvious.

Fix #45703

(cherry picked from commit 8ccf2d6)
KristofferC pushed a commit that referenced this issue Jul 4, 2022
When egal objects contain identical typevars with different
environments, the resulting subtyping might not be so obvious.

Fix #45703

(cherry picked from commit 8ccf2d6)
pcjentsch pushed a commit to pcjentsch/julia that referenced this issue Aug 18, 2022
When egal objects contain identical typevars with different
environments, the resulting subtyping might not be so obvious.

Fix JuliaLang#45703
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:types and dispatch Types, subtyping and method dispatch kind:regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants