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

abstractarray cat3v inferred test #50550

Closed
vtjnash opened this issue Jul 14, 2023 · 7 comments · Fixed by #50751 or #50753
Closed

abstractarray cat3v inferred test #50550

vtjnash opened this issue Jul 14, 2023 · 7 comments · Fixed by #50751 or #50753
Assignees
Labels
ci Continuous integration

Comments

@vtjnash
Copy link
Member

vtjnash commented Jul 14, 2023

The global RNG seed was 0x2fa9baa4eecda6ff6ae4a326ff42a832.

Error in testset abstractarray:
Error During Test at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-x64-4.0/build/default-macmini-x64-4-0/julialang/julia-master/julia-22502b8753/share/julia/test/abstractarray.jl:762
  Test threw exception
  Expression: #= /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-x64-4.0/build/default-macmini-x64-4-0/julialang/julia-master/julia-22502b8753/share/julia/test/abstractarray.jl:762 =# @inferred(cat3v(As)) == zeros(2, 2, 2)
  return type Array{Float64, 3} does not match inferred return type Array{_A, 3} where _A
  Stacktrace:
   [1] error(s::String)
     @ Base ./error.jl:35
   [2] macro expansion
     @ Main.Test82Main_abstractarray /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-x64-4.0/build/default-macmini-x64-4-0/julialang/julia-master/julia-22502b8753/share/julia/stdlib/v1.11/Test/src/Test.jl:669 [inlined]
   [3] test_cat(::Type{Main.Test82Main_abstractarray.TestAbstractArray})
     @ Main.Test82Main_abstractarray /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-x64-4.0/build/default-macmini-x64-4-0/julialang/julia-master/julia-22502b8753/share/julia/test/abstractarray.jl:762
ERROR: LoadError: Test run finished with errors
in expression starting at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-macmini-x64-4.0/build/default-macmini-x64-4-0/julialang/julia-master/julia-22502b8753/share/julia/test/runtests.jl:95

https://buildkite.com/julialang/julia-master/builds/25873#018950e3-eedd-41e0-8a96-bbd23fe9154e

@vtjnash vtjnash added the ci Continuous integration label Jul 14, 2023
@giordano
Copy link
Contributor

Related to #49322?

@Keno
Copy link
Member

Keno commented Jul 14, 2023

This reproduces with the sequence of tests on that worker:

$ JULIA_CPU_THREADS=1 ./usr/bin/julia test/runtests.jl LinearAlgebra/special LinearAlgebra/lapack LinearAlgebra/pinv compiler/effects compiler/codegen compiler/EscapeAnalysis/interprocedural strings/util char triplequote intrinsics hashing tuple abstractarray

Running parallel tests with:
  nworkers() = 1
  nthreads() = 1
  Sys.CPU_THREADS = 1
  Sys.total_memory() = 503.822 GiB
  Sys.free_memory() = 388.686 GiB

Test                                (Worker) | Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)
LinearAlgebra/special                    (1) |        started at 2023-07-14T14:38:20.077
LinearAlgebra/special                    (1) |   169.28 |   2.72 |  1.6 |   13233.10 |   856.03
LinearAlgebra/lapack                     (1) |        started at 2023-07-14T14:41:09.453
LinearAlgebra/lapack                     (1) |    55.06 |   1.09 |  2.0 |    3033.09 |  1205.91
LinearAlgebra/pinv                       (1) |        started at 2023-07-14T14:42:04.512
LinearAlgebra/pinv                       (1) |    10.89 |   0.37 |  3.4 |     978.34 |  1248.11
compiler/effects                         (1) |        started at 2023-07-14T14:42:15.400
compiler/effects                         (1) |     2.21 |   0.02 |  1.0 |     184.84 |  1258.30
compiler/codegen                         (1) |        started at 2023-07-14T14:42:17.606
compiler/codegen                         (1) |     4.80 |   0.95 | 19.9 |     158.77 |  1258.50
compiler/EscapeAnalysis/interprocedural  (1) |        started at 2023-07-14T14:42:22.409
compiler/EscapeAnalysis/interprocedural  (1) |     8.77 |   0.19 |  2.1 |     487.50 |  1258.50
strings/util                             (1) |        started at 2023-07-14T14:42:31.181
strings/util                             (1) |     7.32 |   0.21 |  2.9 |     585.67 |  1327.54
char                                     (1) |        started at 2023-07-14T14:42:38.504
char                                     (1) |     1.91 |   0.04 |  2.1 |     109.52 |  1327.54
triplequote                              (1) |        started at 2023-07-14T14:42:40.420
triplequote                              (1) |     0.03 |   0.00 |  0.0 |       1.20 |  1327.54
intrinsics                               (1) |        started at 2023-07-14T14:42:40.450
intrinsics                               (1) |     1.92 |   0.05 |  2.4 |     121.24 |  1327.54
hashing                                  (1) |        started at 2023-07-14T14:42:42.373
hashing                                  (1) |    14.40 |   0.37 |  2.6 |    3145.29 |  3354.50
tuple                                    (1) |        started at 2023-07-14T14:42:56.779
tuple                                    (1) |     6.58 |   0.22 |  3.3 |     578.72 |  3354.55
abstractarray                            (1) |        started at 2023-07-14T14:43:03.359
abstractarray                            (1) |         failed at 2023-07-14T14:44:31.316
Error During Test at /home/keno/julia/test/abstractarray.jl:762
  Test threw exception
  Expression: #= /home/keno/julia/test/abstractarray.jl:762 =# @inferred(cat3v(As)) == zeros(2, 2, 2)
  return type Array{Float64, 3} does not match inferred return type Array{_A, 3} where _A
  Stacktrace:
   [1] error(s::String)
     @ Base ./error.jl:35
   [2] macro expansion
     @ Main.Test98Main_abstractarray ~/julia/usr/share/julia/stdlib/v1.11/Test/src/Test.jl:669 [inlined]
   [3] test_cat(::Type{Main.Test98Main_abstractarray.TestAbstractArray})
     @ Main.Test98Main_abstractarray ~/julia/test/abstractarray.jl:762

@Keno
Copy link
Member

Keno commented Jul 14, 2023

Reproduces with just hashing:

JULIA_CPU_THREADS=1 ./usr/bin/julia test/runtests.jl hashing abstractarray
Running parallel tests with:
  nworkers() = 1
  nthreads() = 1
  Sys.CPU_THREADS = 1
  Sys.total_memory() = 503.822 GiB
  Sys.free_memory() = 387.623 GiB

Test      (Worker) | Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)
hashing        (1) |        started at 2023-07-14T15:00:14.741
hashing        (1) |    13.55 |   0.23 |  1.7 |    3221.62 |  2492.21
abstractarray  (1) |        started at 2023-07-14T15:00:28.385
abstractarray  (1) |         failed at 2023-07-14T15:01:54.298
Error During Test at /home/keno/julia/test/abstractarray.jl:762
  Test threw exception
  Expression: #= /home/keno/julia/test/abstractarray.jl:762 =# @inferred(cat3v(As)) == zeros(2, 2, 2)
  return type Array{Float64, 3} does not match inferred return type Array{_A, 3} where _A
  Stacktrace:
   [1] error(s::String)
     @ Base ./error.jl:35
   [2] macro expansion
     @ Main.Test35Main_abstractarray ~/julia/usr/share/julia/stdlib/v1.11/Test/src/Test.jl:669 [inlined]
   [3] test_cat(::Type{Main.Test35Main_abstractarray.TestAbstractArray})
     @ Main.Test35Main_abstractarray ~/julia/test/abstractarray.jl:762

@Keno
Copy link
Member

Keno commented Jul 14, 2023

The issue is using SparseArrays, which adds extra cat methods, that cause failure to infer. #49322 does look like the likely culprit, so assigning this back to @vtjnash for now.

@vtjnash
Copy link
Member Author

vtjnash commented Jul 14, 2023

Seems to come from the type-piracy of SparseArrays:

julia> using SparseArrays
julia> cat3v(As) = cat(As...; dims=Val(3))
julia> @inferred(cat3v([zeros(2, 2) for _ = 1:2]))
ERROR: return type Array{Float64, 3} does not match inferred return type Array{_A, 3} where _A

@vtjnash
Copy link
Member Author

vtjnash commented Jul 14, 2023

We probably should just remove SparseArrays from that test file, since we removed SparseArrays from Base

@NHDaly
Copy link
Member

NHDaly commented Jul 30, 2023

We talked this week about disabling this test. Is that still how we want to proceed? I'm not familiar enough to say if it's a good test or not.

vtjnash added a commit that referenced this issue Aug 1, 2023
These tests now belong in SparseArrays, since it is removed from Base.
Since SparseArrays does some piracy, that can break or distort later
tests.

Fix #50550
vtjnash added a commit to JuliaSparse/SparseArrays.jl that referenced this issue Aug 1, 2023
Ensures that Union{} is not part of the output possibilities after type-piracy of Base.cat methods.

Refs JuliaLang/julia#50550
vtjnash added a commit to JuliaSparse/SparseArrays.jl that referenced this issue Aug 1, 2023
Ensures that Union{} is not part of the output possibilities after type-piracy of Base.cat methods.

Refs JuliaLang/julia#50550
vtjnash added a commit to JuliaSparse/SparseArrays.jl that referenced this issue Aug 1, 2023
Ensures that Union{} is not part of the output possibilities after type-piracy of Base.cat methods.

Refs JuliaLang/julia#50550
vtjnash added a commit that referenced this issue Aug 1, 2023
These cannot be reached, but they would imply this function might return
Bottom, which it cannot.

Fix #50550
vtjnash added a commit that referenced this issue Aug 1, 2023
These cannot be reached, but they would imply this function might return
Bottom, which it cannot.

Fix #50550
vtjnash added a commit to JuliaSparse/SparseArrays.jl that referenced this issue Aug 1, 2023
Ensures that Union{} is not part of the output possibilities after type-piracy of Base.cat methods.

Refs JuliaLang/julia#50550
aviatesk pushed a commit that referenced this issue Aug 2, 2023
)

These cannot be reached, but they would imply this function might return
Bottom, which it cannot.

Fix #50550
vtjnash added a commit that referenced this issue Aug 10, 2023
These tests now belong in SparseArrays, since it is removed from Base.
Since SparseArrays does some piracy, that can break or distort later
tests.

Refs #50550
JeffBezanson pushed a commit that referenced this issue Aug 24, 2023
)

These cannot be reached, but they would imply this function might return
Bottom, which it cannot.

Fix #50550

(cherry picked from commit edff86a)
matbesancon pushed a commit to matbesancon/SparseArrays.jl that referenced this issue Sep 3, 2023
Ensures that Union{} is not part of the output possibilities after type-piracy of Base.cat methods.

Refs JuliaLang/julia#50550
vtjnash added a commit to JuliaSparse/SparseArrays.jl that referenced this issue Sep 5, 2023
Ensures that Union{} is not part of the output possibilities after type-piracy of Base.cat methods.

Refs JuliaLang/julia#50550

(cherry picked from commit c402d09)
nalimilan pushed a commit that referenced this issue Nov 5, 2023
)

These cannot be reached, but they would imply this function might return
Bottom, which it cannot.

Fix #50550

(cherry picked from commit edff86a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration
Projects
None yet
4 participants