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

test broken with Julia master #353

Open
matthias314 opened this issue Jun 23, 2024 · 4 comments
Open

test broken with Julia master #353

matthias314 opened this issue Jun 23, 2024 · 4 comments

Comments

@matthias314
Copy link
Contributor

The test

@test reshape(Fill(2,6), big(2), :) == Fill(2, 2, 3)

fails on Julia master because the left-hand side errors (with FillArrays 1.11.0):

julia> using FillArrays

julia> reshape(Fill(2,6), big(2), :)
ERROR: TypeError: in typeassert, expected Tuple{Vararg{Int64}}, got a value of type Tuple{BigInt}
Stacktrace:
 [1] _reshape_uncolon
   @ ./reshapedarray.jl:135 [inlined]
 [2] reshape(parent::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, dims::Tuple{BigInt, Colon})
   @ FillArrays ~/.julia/packages/FillArrays/eOEVm/src/FillArrays.jl:269
 [3] reshape(::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, ::BigInt, ::Colon)
   @ FillArrays ~/.julia/packages/FillArrays/eOEVm/src/FillArrays.jl:265
 [4] top-level scope
   @ REPL[4]:1

It works, however, with Julia 1.10.4 and 1.11.0-beta1. I don't know if this is an issue for OffsetArrays, for FillArrays or for Julia itself. I simply note that Julia itself doesn't support BigInt arguments for reshape:

julia> reshape(1:2, big(2))
ERROR: MethodError: no method matching reshape(::UnitRange{Int64}, ::BigInt)
The function `reshape` exists, but no method is defined for this combination of argument types.

(tested with Julia 1.10.4, 1.11.0-beta1 and master).

@nsajko
Copy link
Contributor

nsajko commented Aug 15, 2024

This is a FillArrays bug, can someone move the issue to the FillArrays repo? Xref JuliaLang/julia#54261

@matthias314
Copy link
Contributor Author

I can do that. In the meantime, here is another test of the master version that fails on Julia nightly:

mapreduce for OffsetRange: Error During Test at ~/.julia/packages/OffsetArrays/hwmnB/test/runtests.jl:2096
  Got exception outside of a @test
  BoundsError: attempt to access 1-element OffsetArray(::Vector{Int64}, 3:3) with eltype Int64 with indices 3:3 at index [1]
  Stacktrace:
    [1] throw_boundserror(A::OffsetVector{Int64, Vector{Int64}}, I::Tuple{Int64})
      @ Base ./essentials.jl:14
    [2] checkbounds
      @ ./abstractarray.jl:699 [inlined]
    [3] getindex
      @ ~/.julia/packages/OffsetArrays/hwmnB/src/OffsetArrays.jl:437 [inlined]
    [4] _mapreducedim!(f::typeof(identity), op::typeof(+), R::OffsetVector{Int64, Vector{Int64}}, A::OffsetVector{Int64, UnitRange{Int64}})
      @ Base ./reducedim.jl:262
    [5] mapreducedim!(f::Function, op::Function, R::OffsetVector{Int64, Vector{Int64}}, A::OffsetVector{Int64, UnitRange{Int64}})
      @ Base ./reducedim.jl:292
    [6] _mapreduce_dim(f::Function, op::Function, ::Base._InitialValue, A::OffsetVector{Int64, UnitRange{Int64}}, dims::Int64)
      @ Base ./reducedim.jl:339
    [7] #mapreduce#950
      @ ./reducedim.jl:325 [inlined]
    [8] top-level scope
      @ ~/.julia/packages/OffsetArrays/hwmnB/test/runtests.jl:2061
    [9] macro expansion
      @ /tmp/julia-6916eb7420/share/julia/stdlib/v1.12/Test/src/Test.jl:1703 [inlined]
   [10] macro expansion
      @ ~/.julia/packages/OffsetArrays/hwmnB/test/runtests.jl:2097 [inlined]
   [11] macro expansion
      @ /tmp/julia-6916eb7420/share/julia/stdlib/v1.12/Test/src/Test.jl:1703 [inlined]
   [12] macro expansion
      @ ~/.julia/packages/OffsetArrays/hwmnB/test/runtests.jl:2113 [inlined]
   [13] include(fname::String)
      @ Main ./sysimg.jl:38
   [14] top-level scope
      @ none:6
   [15] eval
      @ ./boot.jl:439 [inlined]
   [16] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:290
   [17] _start()
      @ Base ./client.jl:553
Test Summary:               | Pass  Error  Total  Time
reductions                  |   22      1     23  8.1s
  mapreduce for OffsetRange |    2      1      3  2.4s
ERROR: LoadError: Some tests did not pass: 22 passed, 0 failed, 1 errored, 0 broken.
in expression starting at ~/.julia/packages/OffsetArrays/hwmnB/test/runtests.jl:2060
ERROR: Package OffsetArrays errored during testing

@nsajko
Copy link
Contributor

nsajko commented Aug 16, 2024

Probably you want to open a new issue for that bug.

@jishnub
Copy link
Member

jishnub commented Aug 16, 2024

The mapreduce issue a bug in Base, and should be resolved by JuliaLang/julia#55506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants