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

[WIP] add minimal RNTuple files to probe writing situation #293

Closed
wants to merge 6 commits into from

Conversation

Moelf
Copy link
Member

@Moelf Moelf commented Nov 10, 2023

here are two files written out each contain a single number (but different)

DO NOT conda root-nighly, it hasn't been building properly since 6.27 (Nov 2022)

I'm doing this for now:

$ source  /cvmfs/sft.cern.ch/lcg/views/dev3/latest/x86_64-centos7-gcc11-opt/setup.sh
$ root --version
ROOT Version: 6.31/01
Built for linuxx8664gcc on Nov 10 2023, 23:36:14
From heads/master@v6-31-01-251-gc5048fa
julia> ROOTFile("./test_ntuple_min1.root")["ntuple"]
UnROOT.RNTuple with 1 rows, 1 fields, and metadata:
  header:
    name: "ntuple"
    ntuple_description: ""
    writer_identifier: "ROOT v6.31/01"
    schema:
      RNTupleSchema with 1 top fields
      └─ :one_uint  Leaf{UInt32}(col=1)

  footer:
    cluster_summaries: UnROOT.ClusterSummary[ClusterSummary(num_first_entry=0, num_entries=1)]

julia> LazyTree("./test_ntuple_min1.root", "ntuple")
 Row │ one_uint
     │ UInt32
─────┼────────────
 13435973836

cc. @tamasgal

@Moelf Moelf marked this pull request as draft November 10, 2023 16:06
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

see 4 files with indirect coverage changes

📢 Thoughts on this report? Let us know!

@tamasgal
Copy link
Member

Thanks!

@Moelf
Copy link
Member Author

Moelf commented Nov 10, 2023

without setting kBare, RNTuple will be embedded int a TFile of course

image

@Moelf Moelf force-pushed the rntuple_writing_test branch from 4f2bdf7 to e762633 Compare November 10, 2023 21:34
@Moelf Moelf force-pushed the rntuple_writing_test branch from e762633 to 9e30d59 Compare November 10, 2023 21:41
@Moelf
Copy link
Member Author

Moelf commented Nov 12, 2023

I'm update the file to use https://root.cern/doc/v624/namespaceROOT_1_1Experimental.html#a27e0535a55521c5e8f050fc92840e110

setting the option to kBare:
image

@Moelf
Copy link
Member Author

Moelf commented Nov 12, 2023

idk what they mean by "thin envelope", currently trying to reverse engineering from know header location:

julia> f = UnROOT.MmapStream("./test/samples/RNTuple/test_ntuple_min1.root");

julia> seek(f, 0x92)
UnROOT.MmapStream(UInt8[0x72, 0x6e, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x00, 0x00, 0xf6    0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xe8, 0x9a, 0x3f], 146, 494)

julia> UnROOT._rntuple_read(f, UnROOT.RNTupleHeader)
UnROOT.RNTupleHeader(0x0000000000000000, 0x00000001, "ntuple", "", "ROOT v6.31/01", UnROOT.FieldRecord[parent=00, role=0, name=one_uint                      , type=std::uint32_t                                               repetition=0,], UnROOT.ColumnRecord[type=20, nbits=32, field_id=00, flags=0], UnROOT.AliasRecord[], UnROOT.ExtraTypeInfo[])

judging by the lack of fSeekHeader pointing to 0x92 anywhere in the file, I think kBare does not produce RNTuple anchor at all

@Moelf
Copy link
Member Author

Moelf commented Nov 12, 2023

F8 FF FF FF 00 00 00 00

is a useful pattern. This is what an empty RNTupleListFrame looks like

@Moelf
Copy link
Member Author

Moelf commented Nov 12, 2023

via almost brute force, I also figured out where footer is:

julia> seek(f, 366)
UnROOT.MmapStream(UInt8[0x72, 0x6e, 0x74, 0x75, 0x70, 0x6c, 0x65, 0x00, 0x00, 0xf6    0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xe8, 0x9a, 0x3f], 366, 494)

julia> footer = UnROOT._rntuple_read(f, UnROOT.RNTupleFooter)
UnROOT.RNTupleFooter(0x0000000000000000, 0x47a1a5ae, UnROOT.RNTupleSchemaExtension(UnROOT.FieldRecord[], UnROOT.ColumnRecord[], UnROOT.AliasRecord[], UnROOT.ExtraTypeInfo[]), UnROOT.ColumnGroupRecord[], UnROOT.ClusterSummary[ClusterSummary(num_first_entry=0, num_entries=1)], UnROOT.ClusterGroupRecord[UnROOT.ClusterGroupRecord(0x00000001, UnROOT.EnvLink(0x0000003c, UnROOT.Locator(60, 0x000000000000012e)))], UnROOT.EnvLink[])

julia> position(f)
490 # there are only 4 bytes left after this, probably CRC32 of footer

@Moelf
Copy link
Member Author

Moelf commented Nov 12, 2023

looks like we won't have bare RNTuple in production :(

@Moelf Moelf closed this Jan 16, 2024
@Moelf Moelf deleted the rntuple_writing_test branch May 19, 2024 22:51
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.

2 participants