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

Loading LoopVectorization.jl makes push! error on julia1.9.0-beta2 #460

Closed
Kolaru opened this issue Jan 17, 2023 · 7 comments · Fixed by #461
Closed

Loading LoopVectorization.jl makes push! error on julia1.9.0-beta2 #460

Kolaru opened this issue Jan 17, 2023 · 7 comments · Fixed by #461

Comments

@Kolaru
Copy link

Kolaru commented Jan 17, 2023

Somehow loading the package makes push! with multiple arguments fail with a BoundsError on the latest julia beta.

Initially reported in Kolaru/MathTeXEngine.jl#97

julia> a = []
Any[]

julia> push!(a, 2, 3, 4)
3-element Vector{Any}:
 2
 3
 4

julia> using LoopVectorization

julia> push!(a, 2, 3, 4)
ERROR: BoundsError: attempt to access Tuple{Int64, Int64, Int64} at index [4]
Stacktrace:
 [1] getindex
   @ .\tuple.jl:29 [inlined]
 [2] push!(::Vector{Any}, ::Any, ::Any, ::Any, ::Any)
   @ Base .\array.jl:1077
 [3] top-level scope
   @ REPL[4]:1

julia> versioninfo()
Julia Version 1.9.0-beta2
Commit 7daffeecb8 (2022-12-29 07:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 4 × Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 4 virtual cores
Environment:
  JULIA_EDITOR = code.cmd

(@v1.9) pkg> st
Status `C:\Users\kolar\.julia\environments\v1.9\Project.toml`
  [bdcacae8] LoopVectorization v0.12.146
@chriselrod
Copy link
Member

chriselrod commented Jan 17, 2023

julia> a = []
Any[]

julia> push!(a, 2, 3, 4)
3-element Vector{Any}:
 2
 3
 4

julia> using LoopVectorization

julia> push!(a, 2, 3, 4)
6-element Vector{Any}:
 2
 3
 4
 2
 3
 4

julia> versioninfo()
Julia Version 1.9.0-beta2.41
Commit e25433c4ef (2023-01-17 07:39 UTC)
Platform Info:
  OS: Linux (x86_64-redhat-linux)
  CPU: 28 × Intel(R) Core(TM) i9-9940X CPU @ 3.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake-avx512)
  Threads: 28 on 28 virtual cores
Environment:
  JULIA_PATH = @.
  JULIA_NUM_THREADS = 28

(lvdev) pkg> st -m LoopVectorization
Status `~/Documents/progwork/julia/env/lvdev/Manifest.toml`
  [bdcacae8] LoopVectorization v0.12.146 `~/.julia/dev/LoopVectorization`

I cannot reproduce.

@chriselrod
Copy link
Member

chriselrod commented Jan 17, 2023

 [2] push!(::Vector{Any}, ::Any, ::Any, ::Any, ::Any)
   @ Base .\array.jl:1077
 [3] top-level scope
   @ REPL[4]:1

is truly bizarre -- why is it calling push! with 4 arguments???

@chriselrod
Copy link
Member

Mind testing if you still see the problem using #461?

@jaakkor2
Copy link
Contributor

https://github.com/JuliaSIMD/LoopVectorization.jl#nogratuitousoverloads fixes it for me on OS: Linux (x86_64-linux-gnu)
CPU: 64 × AMD EPYC 7371 16-Core Processor.

@chriselrod
Copy link
Member

That PR deleted a push!(::LoopSet, ...) method by naming it _push! instead, as there was no reason to use the same name.

Seems like a Julia bug that this should have somehow influenced push!(::Vector{Any}.
Still, no reason to use the name push! over anything else, so I'll issue a new release as soon as that PR merges.

@chriselrod
Copy link
Member

Also JuliaLang/julia#48085

@Kolaru
Copy link
Author

Kolaru commented Jan 17, 2023

#461 Also fixes it for me.

This issue was closed.
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

Successfully merging a pull request may close this issue.

3 participants