Skip to content

Conversation

Copy link

Copilot AI commented Oct 29, 2025

ROOT files with embedded baskets (from premature closure) fail with EOF errors. Embedded baskets have fNbytes <= fKeylen and use inline data layout that differs from normal recovered baskets.

Changes

Type safety improvement (src/io.jl):

  • Add explicit Int() conversion when reading string lengths to match uproot5's NumPy 2.0 compatibility fix

Code documentation (src/bootstrap.jl):

  • Add embedded basket detection check (fNbytes <= fKeylen)
  • Document that embedded baskets use inline data requiring different handling

Test documentation (test/issues.jl):

  • Add test documenting known limitation with embedded basket files

Current Status

Files with embedded baskets still fail - full support requires understanding ROOT's inline data layout and handling preamble byte count expectations. Users should reprocess such files through ROOT to normalize basket format, or use uproot (Python) which has full support.

Example

# Normal files work
f = ROOTFile("normal_file.root")
tree = f["Events"]  #

# Embedded basket files fail (documented)
f = ROOTFile("file_with_embedded_baskets.root")  
tree = f["Events"]  # EOFError

Reference: uproot5 commit b9a2a02, TBasket.py lines 252-287

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • eospublic.cern.ch
    • Triggering command: `/usr/local/julia1.11.7/bin/julia -C native -J/usr/local/julia1.11.7/lib/julia/sys.so -g1 --threads=1 --code-coverage=none --color=auto --check-bounds=yes --warn-overwrite=yes --depwarn=yes --inline=yes --startup-file=no --track-allocation=none --eval append!(empty!(Base.DEPOT_PATH), ["/home/REDACTED/.julia", "/usr/local/julia1.11.7/local/share/julia", "/usr/local/julia1.11.7/share/julia"])
      append!(empty!(Base.DL_LOAD_PATH), String[])

cd("/home/REDACTED/work/UnROOT.jl/UnROOT.jl/test")
append!(empty!(ARGS), String[])
include("/home/REDACTED/work/UnROOT.jl/UnROOT.jl/test/runtests.jl")` (dns block)

  • https://api.github.com/repos/FluxML/MacroTools.jl/tarball/1e0228a030642014fe5cfe68c2c0a818f9e3f522
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JLTastet/LorentzVectors.jl/tarball/da81cd93228bfa12d8d9dd8aaab61f48e5f74441
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaArrays/ArraysOfArrays.jl/tarball/8e64c97ac7bffbd3327d8ddadf8dad26b87a2664
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaArrays/StaticArrays.jl/tarball/b8693004b385c842357406e3af647701fe783f98
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaArrays/StaticArraysCore.jl/tarball/6ab403037779dae8c514bad259f32a447262455a
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaArrays/StructArrays.jl/tarball/a2c37d815bf00575332b7bd0389f771cb7987214
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/JSON_C_jll.jl/tarball/cb4df6e9ccf7f6742db61fb03fff8dd3de212159
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Libiconv_jll.jl/tarball/be484f5c92fad0bd8acfef35fe017900b0b73809
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Libuuid_jll.jl/tarball/2a7a12fc0a4e7fb773450d17975322aa77142106
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Lz4_jll.jl/tarball/191686b1ac1ea9c89fc52e996ad15d1d241d1e33
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/OpenSSL_jll.jl/tarball/f19301ae653233bc88b1810ae908194f07f8db9d
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/XML2_jll.jl/tarball/c217bad8fccb3bbfef7d7902326eacfbd0d702ad
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/XRootD_cxxwrap_jll.jl/tarball/9c4139647512fc5c5f01513192054232e51527f7
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/XRootD_jll.jl/tarball/c89d3f0867e154d642d88de8b933643c122c46d8
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/XZ_jll.jl/tarball/fee71455b0aaa3440dfdd54a9a36ccef829be7d4
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Zstd_jll.jl/tarball/446b23e73536f84e8037f5dce465e92275f6a308
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/libcxxwrap_julia_jll.jl/tarball/a32eb6e089fdcc8d1ca311ce822e3bf71ff095b4
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/libdeflate_jll.jl/tarball/1211842946e3a3871889f94df9cb17596e0c9edf
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/libxcrypt_legacy_jll.jl/tarball/3815a384f6f3cbde4e64fd23fad35f09b83cb2a8
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaCollections/AbstractTrees.jl/tarball/2d9c9a55f9c93e8887ad391fbae72f8ef55e1177
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaCollections/DataStructures.jl/tarball/6c72198e6a101cccdd4c9731d3985e904ba26037
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaCollections/IterTools.jl/tarball/42d5f897009e7ff2cf88db414a389e5ed1bdd023
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaCollections/LRUCache.jl/tarball/5519b95a490ff5fe629c4a7aa3b3dfc9160498b3
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaCollections/SortingAlgorithms.jl/tarball/64d974c2e6fdf07f8155b5b2ca2ffa9069b608d9
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaData/DataFrames.jl/tarball/d8928e9169ff76c6281f39a659f9bca3a573f24c
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/InvertedIndices.jl/tarball/6da3c4316095de0f5ee2ebd875df8721e7e0bdbe
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/Missings.jl/tarball/ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaData/PooledArrays.jl/tarball/36d8b4b899628fb92c2749eb488d884a926614d3
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/SentinelArrays.jl/tarball/712fb0231ee6f9120e005ccd56297abbc053e7e0
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaDocs/DocStringExtensions.jl/tarball/7442a5dfe1ebb773c29cc2962a8980f47221d76c
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaFunctional/CompositionsBase.jl/tarball/802bb88cd69dfd1509f6670416bd4434015693ad
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaHEP/XRootD.jl/tarball/0f4370208ed663be95040c91364bf13fef216e10
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaIO/CodecLz4.jl/tarball/d58afcd2833601636b48ee8cbeb2edcb086522c2
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaIO/CodecXz.jl/tarball/47cee2085962dad41ca9ec811e37694d7445531f
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaIO/CodecZlib.jl/tarball/962834c22b66e32aa10f7611c08c8ca4e20749a9
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaIO/CodecZstd.jl/tarball/d0073f473757f0d39ac9707f1eb03b431573cbd8
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaIO/TranscodingStreams.jl/tarball/0c45878dcfdcfa8480052b6ab162cdd138781742
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaInterop/CxxWrap.jl/tarball/7949f37f8ff543ce7e55b4bc5021697dee6fe1e3
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaLang/Compat.jl/tarball/9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaLang/MbedTLS.jl/tarball/c067a280ddc25f196b5e7df3877c6b226d390aaf
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaLogging/LoggingExtras.jl/tarball/f00544d95982ea270145636c181ceda21c4e2575
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaMath/Calculus.jl/tarball/9cb23bbb1127eefb022b022481466c0f1127d430
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaMath/InverseFunctions.jl/tarball/a779299d77cd080bf77b97535acecd73e1c5e5cb
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaMath/IrrationalConstants.jl/tarball/b2d91fe939cae05960e760110b328288867b5758
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaObjects/Accessors.jl/tarball/3b86719127f50670efe356bc11073d84b4ed7a5d
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaObjects/ConstructionBase.jl/tarball/b4b092499347b18a015186eae3042f72267106cb
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaPackaging/JLLWrappers.jl/tarball/0533e564aae234aff59ab625543145446d8b6ec2
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/0f27480397253da18fe2c12a4ba4eb9eb208bf3d
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaPackaging/Scratch.jl/tarball/9b81b8393e50b7d4e6d0a9f14e192294d3b7c109
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaPackaging/SimpleBufferStream.jl/tarball/f305871d2f381d21527c770d4788c06c097c9bc1
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaPhysics/Measurements.jl/tarball/cb47f69a1cab9dcec7ff4a5d6e163410d6905866
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaServices/ConcurrentUtilities.jl/tarball/d9d26935a0bcffc87d2613ce14c527c99fc543fd
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaServices/ExceptionUnwrapping.jl/tarball/d36f682e590a83d63d1c7dbd287573764682d12a
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaStats/LogExpFunctions.jl/tarball/13ca9e2586b89836fd20cccf56e57e2b9ae7f38f
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaStats/StatsAPI.jl/tarball/9d72a13a3f4dd3795a195ac5a44d7d6ff5f552ff
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaStats/StatsBase.jl/tarball/a136f98cefaf3e2924a66bd75173d1c891ab7453
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaStrings/InlineStrings.jl/tarball/8f3d257792a522b4601c24a577954b0a8cd7334d
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaStrings/LaTeXStrings.jl/tarball/dda21b8cbd6a6c40d9d02a73230f9d70fed6918c
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaTesting/Aqua.jl/tarball/d57fd255a8932b6509baf43284c416fc44d0b903
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaTesting/ExprTools.jl/tarball/27415f162e6028e81c72b82ef756bf321213b6ec
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaTesting/Mocking.jl/tarball/2c140d60d7cb82badf06d8783800d0bcd1a7daa2
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaTime/TZJData.jl/tarball/72df96b3a595b7aab1e101eb07d2a435963a97e2
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaTime/TimeZones.jl/tarball/06f4f1f3e8ff09e42e59b043a747332e88e01aba
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaWeb/HTTP.jl/tarball/5e6fe50ae7f23d171f44e311c2960294aaa0beb5
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaWeb/OpenSSL.jl/tarball/f1a7e086c677df53e064e0fdd2c9d0b0833e3f6e
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaWeb/URIs.jl/tarball/bef26fb046d031353ef97a82e3fdb6afe7f21b1a
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/KristofferC/Crayons.jl/tarball/249fe38abf76d48563e2f4556bebd215aa317e15
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/LilithHafner/AliasTables.jl/tarball/9876e1e164b144ca45e9e3198d0b689cadfed9ff
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/LilithHafner/PtrArrays.jl/tarball/1d36ef11a9aaf1e8b74dacc6a731dd1de8fd493d
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/Moelf/FHist.jl/tarball/55febd23e52d3e8d24370388026b0ea990a086bd
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/Moelf/XXHashNative.jl/tarball/ac784c5d0933069ec315c80c44eb149170336b1c
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/apache/arrow-julia/tarball/404265cd8128a2515a81d5eae16de90fdef05101
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/apache/arrow-julia/tarball/a3ae633a80f26751041e8c17c091c9e910d5537d
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/francescoalemanno/BayesHistogram.jl/tarball/5d5dda960067751bc1534aba765f771325044501
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/fredrikekre/EnumX.jl/tarball/bddad79635af6aec424f53ed8aad5d7555dc6f00
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/jakobnissen/LibDeflate.jl/tarball/080e33cfc2ffd98bd6aa4cacdd71ee594eb6c4b8
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/jmert/BitFlags.jl/tarball/0691e34b3bb8be9307330f88d1a3c3f25466c24d
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/marius311/Memoization.jl/tarball/7dbf904fa6c4447bd1f1d316886bfbe29feacf45
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/mauro3/Parameters.jl/tarball/34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/mauro3/UnPack.jl/tarball/387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/rafaqz/Mixers.jl/tarball/58ec7ac60dad6e8ca4553225251dfd380e3930dd
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/rfourquet/BitIntegers.jl/tarball/f98cfeaba814d9746617822032d50a31c9926604
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/ronisbr/PrettyTables.jl/tarball/1101cd475833706e4d0e7b122218257178f48f34
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/ronisbr/StringManipulation.jl/tarball/725421ae8e530ec29bcbdddbe91ff8053421d023
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/simonster/Reexport.jl/tarball/45e428421666073eab6f2da5c9d310d99bb12f9b
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • pkg.julialang.org
    • Triggering command: julia --project=. -e using Pkg; Pkg.instantiate() (dns block)
    • Triggering command: julia --project=. -e using Pkg; Pkg.test() (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>EOF when trying to open a file</issue_title>
<issue_description>Hi, I have a fairly simple ROOT file produced from Geant4 output (should not really matter I guess):[

MuonSimulationData.zip

I am able to read it with uproot (and directly with ROOT reader) and its structure is:

--- TTree Structure for 'muons' ---
Branch: "px" | ROOT Type: double
Branch: "py" | ROOT Type: double
Branch: "pz" | ROOT Type: double
Branch: "energy" | ROOT Type: double
Branch: "x" | ROOT Type: double
Branch: "y" | ROOT Type: double
Branch: "z" | ROOT Type: double
Branch: "particleID" | ROOT Type: int32_t
---------------------------------------

However, with UnROOT.jl I get:

julia> data, offsets = UnROOT.array(f, "muons"; raw=true)
ERROR: EOFError: read end of file
Stacktrace:
  [1] peek
    @ ./iobuffer.jl:422 [inlined]
  [2] read
    @ ./iobuffer.jl:432 [inlined]
  [3] readtype
    @ ~/.julia/packages/UnROOT/1hmtA/src/io.jl:23 [inlined]
  [4] readobjany!(io::IOBuffer, tkey::UnROOT.TKey32, refs::Dict{Int32, Any})
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/streamers.jl:199
  [5] unpack(io::IOBuffer, tkey::UnROOT.TKey32, refs::Dict{Int32, Any}, T::Type{UnROOT.TObjArray})
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/streamers.jl:334
  [6] UnROOT.TTree(io::UnROOT.MmapStream, tkey::UnROOT.TKey32, refs::Dict{Int32, Any}; top::Bool)
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/bootstrap.jl:1187
  [7] UnROOT.TTree(io::UnROOT.MmapStream, tkey::UnROOT.TKey32, refs::Dict{Int32, Any})
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/bootstrap.jl:1153
  [8] _getindex(f::ROOTFile, s::String)
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/root.jl:178
  [9] JuliaHEP/UnROOT.jl#140
    @ ~/.julia/packages/UnROOT/1hmtA/src/root.jl:163 [inlined]
 [10] get!(default::UnROOT.var"#140#141"{ROOTFile, String}, h::Dict{Any, Any}, key::String)
    @ Base ./dict.jl:458
 [11] getindex
    @ ~/.julia/packages/UnROOT/1hmtA/src/root.jl:162 [inlined]
 [12] array(f::ROOTFile, path::String; raw::Bool)
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/iteration.jl:21
 [13] top-level scope
    @ REPL[25]:1

julia> 

I tried using the LazyTree but with no success either:

julia> struct MuonEntry
           px::Float64
           py::Float64
           pz::Float64
           energy::Float64
           x::Float64
           y::Float64
           z::Float64
           particleID::Int32
       end

julia> lazy_tree = LazyTree(
               f, 
               "muons"; 
               T=MuonEntry, # Explicitly tell UnROOT to treat each entry as a MuonEntry
               dtype=MuonEntry
           )
ERROR: EOFError: read end of file
Stacktrace:
  [1] peek
    @ ./iobuffer.jl:422 [inlined]
  [2] read
    @ ./iobuffer.jl:432 [inlined]
  [3] readtype
    @ ~/.julia/packages/UnROOT/1hmtA/src/io.jl:23 [inlined]
  [4] readobjany!(io::IOBuffer, tkey::UnROOT.TKey32, refs::Dict{Int32, Any})
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/streamers.jl:199
  [5] unpack(io::IOBuffer, tkey::UnROOT.TKey32, refs::Dict{Int32, Any}, T::Type{UnROOT.TObjArray})
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/streamers.jl:334
  [6] UnROOT.TTree(io::UnROOT.MmapStream, tkey::UnROOT.TKey32, refs::Dict{Int32, Any}; top::Bool)
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/bootstrap.jl:1187
  [7] UnROOT.TTree(io::UnROOT.MmapStream, tkey::UnROOT.TKey32, refs::Dict{Int32, Any})
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/bootstrap.jl:1153
  [8] _getindex(f::ROOTFile, s::String)
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/root.jl:178
  [9] JuliaHEP/UnROOT.jl#140
    @ ~/.julia/packages/UnROOT/1hmtA/src/root.jl:163 [inlined]
 [10] get!(default::UnROOT.var"#140#141"{ROOTFile, String}, h::Dict{Any, Any}, key::String)
    @ Base ./dict.jl:458
 [11] getindex
    @ ~/.julia/packages/UnROOT/1hmtA/src/root.jl:162 [inlined]
 [12] LazyTree(f::ROOTFile, s::String; kwargs::@Kwargs{T::DataType, dtype::DataType})
    @ UnROOT ~/.julia/packages/UnROOT/1hmtA/src/iteration.jl:476
 [13] top-level scope
    @ REPL[24]:1

</issue_description>

<agent_instructions>when necessary, check how https://github.com/scikit-hep/uproot5/ handles this for reference</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@Moelf > T=MuonEntry, # Explicitly tell UnROOT to treat each entry as a MuonEntry

this seems like a hallucination btw</comment_new>
<comment_new>@tamasgal
Hm, looks like fun... It's about recovered baskets which are still a bit foggy

julia> ENV["JULIA_DEBUG"] = UnROOT
UnROOT

julia> f["muons"]
┌ Debug: Retrieving muons ('TTree')
└ @ UnROOT ~/Dev/UnROOT.jl/src/root.jl:175
┌ Debug: Compression type: UInt8[0x5a, 0x4c]
└ @ UnROOT ~/Dev/UnROOT.jl/src/types.jl:154
┌ Debug: Compressed/...

</details>

- Fixes JuliaHEP/UnROOT.jl#389

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

@tamasgal
Copy link
Member

wtf 😆

@tamasgal
Copy link
Member

If this somehow works out or at least leads to the right direction, I will definitely be amazed. On the other hand, it requires a major rework of how baskets are managed, spanning across a couple of fairly complex function. I think the chances are extremely low that something useful comes out but let's see 😉

@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.74%. Comparing base (310d987) to head (e0a4822).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #391      +/-   ##
==========================================
- Coverage   84.08%   83.74%   -0.34%     
==========================================
  Files          21       21              
  Lines        3097     3100       +3     
==========================================
- Hits         2604     2596       -8     
- Misses        493      504      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI changed the title [WIP] Fix EOF error when opening files with UnROOT.jl Add Int conversion for string lengths, document embedded basket limitation Oct 29, 2025
Copilot AI requested a review from Moelf October 29, 2025 17:30
@Moelf
Copy link
Member

Moelf commented Oct 29, 2025

nah, this looks too stupid of a fix to just work right?

@tamasgal
Copy link
Member

Yes it's on the wrong track. I figured that when I parse 90 bytes less of the TBranch_8 using a hardcoded seek, I get much further in the parsing. I think the issue is two-fold.

@tamasgal
Copy link
Member

Maybe it would help if I commit my additions and add a failing test with the sample file 😉 But I have no idea how this works here...

@tamasgal
Copy link
Member

tamasgal commented Oct 29, 2025

It was 19 bytes: #389 (comment)

I was also confused by those 19 bytes because I could not figure out where it could come from. 18 bytes + speedbump maybe? No idea 🙈 If I recall correctly it was right after parsing the leaves

fields[:fLeaves] = unpack(io, tkey, refs, TObjArray)
where I had to manually backseek 19 bytes in order to be able to parse further. That hints to a bug in the TObjArray deserialisation logic, but I was stuck.

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 this pull request may close these issues.

3 participants