-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Failing offsetarrays test #28101
Comments
Unfortunately that very much looks like something that #27845 could have caused. Maybe something has changed since the PR CI ran. I can't look into it so maybe we should revert for now. |
Just tried locally though and the tests pass. |
Worth noting: The differing value on the LHS is always (well, in these four cases at least) larger than on the RHS. So it might pick up a wrong initial value which, only with a certain chance, is too large. E.g. a value from another column. |
julia> A = OffsetArray(reshape(16:-1:1, (4, 4)), (-3,5))
OffsetArray{Int64,2,Base.ReshapedArray{Int64,2,StepRange{Int64,Int64},Tuple{}}} with indices -2:1×6:9:
16 12 8 4
15 11 7 3
14 10 6 2
13 9 5 1
julia> @test maximum(A, dims=1) == OffsetArray(maximum(parent(A), dims=1), A.offsets)
Test Failed at REPL[9]:1
Expression: maximum(A, dims=1) == OffsetArray(maximum(parent(A), dims=1), A.offsets)
Evaluated: [16 13 13 13] == [16 12 8 4]
ERROR: There was an error during testing |
Thanks. It's the wrong slice I'm using. Let's revert and I'll come up with something better. |
There seems to be something weird about views of OffsetArrays which is the root cause of this issue here. julia> A = OffsetArray(reshape(16:-1:1, (4, 4)), (-3,5))
OffsetArray{Int64,2,Base.ReshapedArray{Int64,2,StepRange{Int64,Int64},Tuple{}}} with indices -2:1×6:9:
16 12 8 4
15 11 7 3
14 10 6 2
13 9 5 1
julia> idx = (Base.Slice(-2:-2), Base.Slice(6:9))
(Base.Slice(-2:-2), Base.Slice(6:9))
julia> A[idx...]
OffsetArray{Int64,2,Array{Int64,2}} with indices -2:-2×6:9:
16 12 8 4
julia> view(A, idx...)
view(::OffsetArray{Int64,2,Base.ReshapedArray{Int64,2,StepRange{Int64,Int64},Tuple{}}}, :, :) with eltype Int64 with indices -2:-2×6:9:
16 15 14 13
julia> view(A, idx[1].indices, idx[2].indices)
1×4 view(::OffsetArray{Int64,2,Base.ReshapedArray{Int64,2,StepRange{Int64,Int64},Tuple{}}}, -2:-2, 6:9) with eltype Int64:
16 12 8 4 |
This is due to Views exploit the latter for performance. That's what you're running into here. Looks like this problem is more urgent than I had thought. I'll see what I can do here. |
https://freebsdci.julialang.org/#/builders/1/builds/11271 (master):
https://freebsdci.julialang.org/#builders/1/builds/11275 (#28079):
https://freebsdci.julialang.org/#/builders/1/builds/11274 (#28099):
https://travis-ci.org/JuliaLang/julia/jobs/403462714 (master):
The text was updated successfully, but these errors were encountered: