JuliaArrays / JuliaArrays/StructArrays.jl

Test failure with `JLArrays`

Open
#274 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
402
Forks
49
PR merge metrics
No merged PRs in 30d

Description

On my laptop, using the master branch, I find

StructJLArray: Error During Test at /home/jishnu/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1326
  Test threw exception
  Expression: #= /home/jishnu/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1326 =# @inferred(backend(sa)) === backend(sa.re) === backend(sa.im) === backend(jl(a.re))
  This object is not a GPU array
  Stacktrace:
    [1] error(s::String)
      @ Base ./error.jl:35
    [2] backend(#unused#::Type)
      @ GPUArraysCore ~/.julia/packages/GPUArraysCore/uOYfN/src/GPUArraysCore.jl:148
    [3] macro expansion
      @ ~/Dropbox/JuliaPackages/StructArrays.jl/src/utils.jl:24 [inlined]
    [4] map_params_as_tuple(f::typeof(backend), #unused#::Type{Tuple{JLArray{Float32, 2}, JLArray{Float32, 2}}})
      @ StructArrays ~/Dropbox/JuliaPackages/StructArrays.jl/src/utils.jl:23
    [5] map_params(f::typeof(backend), #unused#::Type{Tuple{JLArray{Float32, 2}, JLArray{Float32, 2}}})
      @ StructArrays ~/Dropbox/JuliaPackages/StructArrays.jl/src/utils.jl:21
    [6] backend(#unused#::Type{StructArray{ComplexF32, 2, NamedTuple{(:re, :im), Tuple{JLArray{Float32, 2}, JLArray{Float32, 2}}}, Int64}})
      @ StructArrays ~/Dropbox/JuliaPackages/StructArrays.jl/src/StructArrays.jl:35
    [7] backend(x::StructArray{ComplexF32, 2, NamedTuple{(:re, :im), Tuple{JLArray{Float32, 2}, JLArray{Float32, 2}}}, Int64})
      @ GPUArraysCore ~/.julia/packages/GPUArraysCore/uOYfN/src/GPUArraysCore.jl:149
    [8] macro expansion
      @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
    [9] macro expansion
      @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1326 [inlined]
   [10] macro expansion
      @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [11] macro expansion
      @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1321 [inlined]
   [12] macro expansion
      @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [13] top-level scope
      @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1197
StructJLArray: Error During Test at /home/jishnu/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1328
  Test threw exception
  Expression: backend(bcabs(sa)) === backend(sa)
  This object is not a GPU array
  Stacktrace:
   [1] error(s::String)
     @ Base ./error.jl:35
   [2] backend(#unused#::Type)
     @ GPUArraysCore ~/.julia/packages/GPUArraysCore/uOYfN/src/GPUArraysCore.jl:148
   [3] backend(x::JLArray{Float32, 2})
     @ GPUArraysCore ~/.julia/packages/GPUArraysCore/uOYfN/src/GPUArraysCore.jl:149
   [4] macro expansion
     @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
   [5] macro expansion
     @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1328 [inlined]
   [6] macro expansion
     @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [7] macro expansion
     @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1321 [inlined]
   [8] macro expansion
     @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [9] top-level scope
     @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1197
StructJLArray: Test Failed at /home/jishnu/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1329
  Expression: #= /home/jishnu/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1329 =# @inferred(bcmul2(sa)) isa StructArray
   Evaluated: ComplexF32[0.30709246f0 + 0.6511014f0im -1.8564901f0 - 1.3000556f0im … -0.8462754f0 - 0.5361141f0im 1.5579953f0 + 0.15550923f0im; 0.32275695f0 + 0.4069154f0im 0.11791762f0 - 1.5649511f0im … 0.7305909f0 - 0.5229633f0im 1.0536568f0 + 0.64818114f0im; … ; 2.2426426f0 + 0.8221964f0im -1.5194311f0 - 0.81762433f0im … 0.0056423442f0 + 0.4361573f0im 1.6558714f0 - 1.0963109f0im; -0.9230074f0 - 0.43390673f0im -0.6878493f0 + 0.40452865f0im … -3.47714f0 + 1.0572428f0im 0.47390854f0 - 0.21914905f0im] isa StructArray

Stacktrace:
 [1] macro expansion
   @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
 [2] macro expansion
   @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1329 [inlined]
 [3] macro expansion
   @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
 [4] macro expansion
   @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1321 [inlined]
 [5] macro expansion
   @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
 [6] top-level scope
   @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1197
StructJLArray: Error During Test at /home/jishnu/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1330
  Test threw exception
  Expression: backend(bcmul2(sa)) === backend(sa)
  This object is not a GPU array
  Stacktrace:
   [1] error(s::String)
     @ Base ./error.jl:35
   [2] backend(#unused#::Type)
     @ GPUArraysCore ~/.julia/packages/GPUArraysCore/uOYfN/src/GPUArraysCore.jl:148
   [3] backend(x::JLArray{ComplexF32, 2})
     @ GPUArraysCore ~/.julia/packages/GPUArraysCore/uOYfN/src/GPUArraysCore.jl:149
   [4] macro expansion
     @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
   [5] macro expansion
     @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1330 [inlined]
   [6] macro expansion
     @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [7] macro expansion
     @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1321 [inlined]
   [8] macro expansion
     @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [9] top-level scope
     @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1197
StructJLArray: Error During Test at /home/jishnu/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1331
  Test threw exception
  Expression: (sa .+= 1) === sa
  This object is not a GPU array
  Stacktrace:
    [1] error(s::String)
      @ Base ./error.jl:35
    [2] backend(#unused#::Type)
      @ GPUArrays ~/.julia/packages/GPUArrays/Zecv7/src/device/execution.jl:15
    [3] backend(x::StructArray{ComplexF32, 2, NamedTuple{(:re, :im), Tuple{JLArray{Float32, 2}, JLArray{Float32, 2}}}, Int64})
      @ GPUArrays ~/.julia/packages/GPUArrays/Zecv7/src/device/execution.jl:16
    [4] _copyto!
      @ ~/.julia/packages/GPUArrays/Zecv7/src/host/broadcast.jl:73 [inlined]
    [5] materialize!
      @ ~/.julia/packages/GPUArrays/Zecv7/src/host/broadcast.jl:51 [inlined]
    [6] materialize!
      @ ~/Dropbox/JuliaPackages/StructArrays.jl/src/structarray.jl:618 [inlined]
    [7] materialize!(dest::StructArray{ComplexF32, 2, NamedTuple{(:re, :im), Tuple{JLArray{Float32, 2}, JLArray{Float32, 2}}}, Int64}, bc::Base.Broadcast.Broadcasted{StructArrayStyle{JLArrays.JLArrayStyle{2}, 2}, Nothing, typeof(+), Tuple{StructArray{ComplexF32, 2, NamedTuple{(:re, :im), Tuple{JLArray{Float32, 2}, JLArray{Float32, 2}}}, Int64}, Int64}})
      @ Base.Broadcast ./broadcast.jl:881
    [8] macro expansion
      @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
    [9] macro expansion
      @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1331 [inlined]
   [10] macro expansion
      @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [11] macro expansion
      @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1321 [inlined]
   [12] macro expansion
      @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [13] top-level scope
      @ ~/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1197
Test Summary:          | Pass  Fail  Error  Total   Time
broadcast              |  108     1      4    113  24.4s
  style conflict check |   70                  70   3.8s
  ambiguity check      |    5                   5  12.1s
  allocation test      |    2                   2   0.2s
  StructStaticArray    |    4                   4   0.9s
  StructJLArray        |    2     1      4      7   3.4s
  StructSparseArray    |    1                   1   1.3s
ERROR: LoadError: Some tests did not pass: 108 passed, 1 failed, 4 errored, 0 broken.
in expression starting at /home/jishnu/Dropbox/JuliaPackages/StructArrays.jl/test/runtests.jl:1196
ERROR: Package StructArrays errored during testing

julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores
Environment:
  LD_LIBRARY_PATH = :/usr/lib/x86_64-linux-gnu/gtk-3.0/modules
  JULIA_EDITOR = subl

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by running the broadcast tests in test/runtests.jl, focusing on lines 1196-1331 and the StructJLArray cases. Read the reported calls through src/utils.jl and src/StructArrays.jl, alongside the GPUArraysCore and GPUArrays stack frames. Done means the StructJLArray tests pass without the backend errors or StructArray type failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.