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

Dangling TBasket not handled properly (offset index type wrong) #265

Open
Moelf opened this issue Jun 27, 2023 · 2 comments
Open

Dangling TBasket not handled properly (offset index type wrong) #265

Moelf opened this issue Jun 27, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Moelf
Copy link
Member

Moelf commented Jun 27, 2023

@tamasgal this is your turf, no rush, and thanks @gojakuch for spotting it.

You can find the test file from this PR:

it's tiny (<500 KB), but it triggers a weird code path:

julia> a = LazyTree("/home/akako/Downloads/nanoAOD_2015_CMS_Open_Data_ttbar.root", "Events");

julia> typeof(a.Electron_pt)
LazyBranch{SubArray{Float32, 1, Vector{Float32}, Tuple{UnitRange{Int64}}, true}, UnROOT.Nooffsetjagg, ArraysOfArrays.VectorOfVectors{Float32, Vector{Float32}, Vector{Int32}, Vector{Tuple{}}}}

julia> eltype(a.Electron_pt)
SubArray{Float32, 1, Vector{Float32}, Tuple{UnitRange{Int64}}, true}

julia> a.Electron_pt[1]
ERROR: MethodError: Cannot `convert` an object of type
  ArraysOfArrays.VectorOfArrays{Float32{},1,0,Array{Float32{},1},Array{UInt32,1},Array{Tuple{},1}} to an object of type
  ArraysOfArrays.VectorOfArrays{Float32{},1,0,Array{Float32{},1},Array{Int32,1},Array{Tuple{},1}}

Closest candidates are:
  convert(::Type{T}, ::LinearAlgebra.Factorization) where T<:AbstractArray
   @ LinearAlgebra ~/Documents/github/dotFiles/homedir/.julia/juliaup/julia-1.9.1+0.x64.linux.gnu/share/julia/stdlib/v1.9/LinearAlgebra/src/factorization.jl:59
  convert(::Type{T}, ::T) where T<:AbstractArray
   @ Base abstractarray.jl:16
  convert(::Type{T}, ::T) where T
   @ Base Base.jl:64

Stacktrace:
 [1] setindex!(A::Vector{ArraysOfArrays.VectorOfVectors{Float32, Vector{Float32}, Vector{Int32}, Vector{Tuple{}}}}, x::ArraysOfArrays.VectorOfVectors{Float32, Vector{Float32}, Vector{UInt32}, Vector{Tuple{}}}, i1::Int64)
   @ Base ./array.jl:969
 [2] _get_buffer_range(ba::LazyBranch{SubArray{Float32, 1, Vector{Float32}, Tuple{UnitRange{Int64}}, true}, UnROOT.Nooffsetjagg, ArraysOfArrays.VectorOfVectors{Float32, Vector{Float32}, Vector{Int32}, Vector{Tuple{}}}}, tid::Int64, #unused#::Nothing)
   @ UnROOT ~/Documents/github/dotFiles/homedir/.julia/dev/UnROOT/src/iteration.jl:202
 [3] _localindex_newbasket!(ba::LazyBranch{SubArray{Float32, 1, Vector{Float32}, Tuple{UnitRange{Int64}}, true}, UnROOT.Nooffsetjagg, ArraysOfArrays.VectorOfVectors{Float32, Vector{Float32}, Vector{Int32}, Vector{Tuple{}}}}, idx::Int64, tid::Int64)
   @ UnROOT ~/Documents/github/dotFiles/homedir/.julia/dev/UnROOT/src/iteration.jl:190

Basically somehow we predicted the type wrong, even though we got the data right, (you can manually show inside _get_buffer_range

@Moelf
Copy link
Member Author

Moelf commented Jul 31, 2023

hitting this again 😿

@tamasgal
Copy link
Member

tamasgal commented Aug 8, 2023

I need more clones...

@tamasgal tamasgal added bug Something isn't working help wanted Extra attention is needed labels Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants