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

[RNTuple] Writing Phase 1 #343

Merged
merged 15 commits into from
Sep 13, 2024
Merged

[RNTuple] Writing Phase 1 #343

merged 15 commits into from
Sep 13, 2024

Conversation

Moelf
Copy link
Member

@Moelf Moelf commented Jun 30, 2024

This implements Phase 1 as outline in #336

julia> using UnROOT

julia> f = tempname()
"/tmp/jl_Vihin4X8H2"

julia> a = Dict("a" => rand(UInt32, 13));

julia> UnROOT.write_rntuple(open(f, "w"), a)

julia> LazyTree(f, "myntuple")
 Row │ a
     │ UInt32
─────┼────────────
 1   │ 4157448934
 2   │ 1517003214
 3   │ 3621726506
 4   │ 1460426740
 5   │ 3377398072
 6   │ 3689650254
 7   │ 1067622026
 8   │ 2595970883
 9   │ 681771139
 10  │ 2811723385
 11  │ 3599332316
 12  │ 418169821
 13  │ 4049611339


julia> LazyTree(f, "myntuple").a == a["a"]
true
  • Check C++ ROOT can read this
julia> using UnROOT

julia> UnROOT.write_rntuple(open("a.root", "w"), Dict("a" => UInt32[0xcececece]))
In [1]: import ROOT

In [3]: df =  ROOT.RDataFrame("myntuple", "a.root")
[ROOT.NTuple] Warning /build/jenkins/workspace/parallel_publishing_full_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/tree/ntuple/v7/src/RPageStorageFile.cxx:289 in ROOT::Experimental::Internal::RPageSourceFile::LoadStructureImpl()::<lambda()>:0: RuntimeWarning: Pre-release format version: RC 2

In [4]: list(df.Take['std::uint32_t']('a'))
Out[4]: [3469659854]
julia> UnROOT.write_rntuple(open("a.root", "w"), Dict("abcd" => UInt32[0xcececece, 0xaebecede]))
In [6]: df =  ROOT.RDataFrame("myntuple", "a.root")

In [7]: list(df.Take['std::uint32_t']('abcd'))
Out[7]: [3469659854, 2931740382]
$ root --version
ROOT Version: 6.33.01
Built for linuxx8664gcc on Jun 28 2024, 23:10:42
From heads/master@v6-31-01-2482-g50ec910e98

Moelf and others added 3 commits May 31, 2024 22:56
* Replace xrootdgo_jll by XRootD.jl
Release for XRootD.jl
Copy link

codecov bot commented Jun 30, 2024

Codecov Report

Attention: Patch coverage is 89.97494% with 40 lines in your changes missing coverage. Please review.

Project coverage is 85.01%. Comparing base (ccd8366) to head (23e3b93).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
src/RNTuple/Writing/TFileWriter.jl 89.76% 39 Missing ⚠️
src/RNTuple/footer.jl 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #343      +/-   ##
==========================================
+ Coverage   84.24%   85.01%   +0.76%     
==========================================
  Files          19       20       +1     
  Lines        2565     2950     +385     
==========================================
+ Hits         2161     2508     +347     
- Misses        404      442      +38     

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

@Moelf Moelf requested review from tamasgal and peremato July 1, 2024 03:12
Copy link
Member

@tamasgal tamasgal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Looking forward to the future of writing ;)

end
end

function rnt_write(io::IO, x::UnROOT.FileHeader32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these legacy flags something which should be propagated from the function call as keyword arguments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case we know FileHeader32 will always be written out "legacy" (i.e. big endian) so we don't take keyword argument here.

Because it doesn't make sense to rnt_write() a FileHeader32 with legacy=false.

Although maybe this should be called bigendian=true|false

Copy link
Member

@peremato peremato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is difficult for me to review the technical changes. What surprises me is that the name "myntuple" for the created RNTuple is implicit.
I have tried to reproduce the C++ reading test but I failed because the ROOT.RDataFrame is not yet provided by ROOT.jl I think.

@Moelf
Copy link
Member Author

Moelf commented Jul 3, 2024

Yeah that's something I still have to figure out. Basically changing that moves too many stuff at the moment so I haven't figured out what bytes to update etc.

add Envelope, FieldRecord, ColumnRecord

fix temp_io and RNTupleHeader without envelope id_length (8 bytes) and checksum (8 bytes)
finish out
phase 1

bump to 0.10.31 (#341)

Release for XRootD.jl

fix compat
add anchor checksum
@Moelf Moelf merged commit fa0a5e3 into main Sep 13, 2024
10 checks passed
@Moelf
Copy link
Member Author

Moelf commented Sep 24, 2024

still works as of:

$ root --version
ROOT Version: 6.33.01
Built for linuxx8664gcc on Sep 23 2024, 23:33:01
From heads/master@v6-31-01-3313-g2f5b71d8d9

@Moelf Moelf deleted the rntuple_writing branch September 29, 2024 11:33
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