From 006b7f7d69b9e1abc2e428f1dfc206cdf867caf9 Mon Sep 17 00:00:00 2001 From: Moelf Date: Thu, 14 Nov 2024 17:15:34 -0500 Subject: [PATCH] at least now it writes --- src/RNTuple/Writing/Stubs.jl | 12 ++++++------ src/RNTuple/Writing/TFileWriter.jl | 2 +- test/RNTupleWriting/lowlevel.jl | 24 ++++++++++++------------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/RNTuple/Writing/Stubs.jl b/src/RNTuple/Writing/Stubs.jl index 447a8163..5ccc2fca 100644 --- a/src/RNTuple/Writing/Stubs.jl +++ b/src/RNTuple/Writing/Stubs.jl @@ -32,12 +32,12 @@ const rnt_header = UnROOT.RNTupleHeader(zero(UInt64), "myntuple", "", "ROOT v6.3 ], [UnROOT.ColumnRecord(0x08, 0x20, zero(UInt32), 0x00, 0x00, 0),], UnROOT.AliasRecord[], UnROOT.ExtraTypeInfo[]) -const RBlob2 = UnROOT.RBlob(0x002e, 0x0004, 0x00000004, WRITE_TIME, 0x0022, 0x0001, 0x01D0, 100, "RBlob", "", "") +const RBlob2 = UnROOT.RBlob(0x002e, 0x0004, 0x00000004, WRITE_TIME, 0x0022, 0x0001, 0x01D1, 100, "RBlob", "", "") const page1 = [ 0xCE, 0xCE, 0xCE, 0xCE, ] -const RBlob3 = UnROOT.RBlob(0x009E, 0x0004, 0x0000007C, WRITE_TIME, 0x0022, 0x0001, 0x01FE, 100, "RBlob", "", "") +const RBlob3 = UnROOT.RBlob(0x009E, 0x0004, 0x0000007C, WRITE_TIME, 0x0022, 0x0001, 0x01FF, 100, "RBlob", "", "") const cluster_summary = UnROOT.Write_RNTupleListFrame([UnROOT.ClusterSummary(0, 1)]) const nested_page_locations = UnROOT.RNTuplePageTopList([ @@ -49,16 +49,16 @@ UnROOT.RNTuplePageTopList([ ]) const pagelink = UnROOT.PageLink(HEADER_CHECKSUM, cluster_summary.payload, nested_page_locations) -const RBlob4 = UnROOT.RBlob(0x00C2, 0x0004, 0x000000A0, WRITE_TIME, 0x0022, 0x0001, 0x029c, 100, "RBlob", "", "") +const RBlob4 = UnROOT.RBlob(0x00B6, 0x0004, 0x00000094, WRITE_TIME, 0x0022, 0x0001, 0x029D, 100, "RBlob", "", "") const rnt_footer = UnROOT.RNTupleFooter(0, HEADER_CHECKSUM, UnROOT.RNTupleSchemaExtension([], [], [], []), [ UnROOT.ClusterGroupRecord(0, 1, 1, UnROOT.EnvLink(0x000000000000007c, UnROOT.Locator(124, 0x0000000000000221, ))), ]) const tkey32_anchor = UnROOT.TKey32(128, 4, 78, WRITE_TIME, 50, 1, 851, 100, "ROOT::RNTuple", "myntuple", "") # these 6 bytes are between tkey32_anchor and the actual anchor -const magic_6bytes = [0x40, 0x00, 0x00, 0x42, 0x00, 0x06] +const magic_6bytes = [0x40, 0x00, 0x00, 0x42, 0x00, 0x02] -const rnt_anchor = UnROOT.ROOT_3a3a_RNTuple(0x0000, 0x0002, 0x0000, 0x0000, 0x0000000000000116, 0x00000000000000ba, 0x00000000000000ba, 0x00000000000002be, 0x00000000000000a0, 0x00000000000000a0, 0x0000000040000000, 0xdc495fd01479af1b) -const tkey32_TDirectory = UnROOT.TKey32(121, 4, 68, WRITE_TIME, 53, 1, 0x000003ec, 100, "", "test_ntuple_minimal.root", "") +const rnt_anchor = UnROOT.ROOT_3a3a_RNTuple(0x0001, 0x0000, 0x0000, 0x0000, 0x0000000000000116, 0x00000000000000ba, 0x00000000000000ba, 0x00000000000002be, 0x00000000000000a0, 0x00000000000000a0, 0x0000000040000000, 0xdc495fd01479af1b) +const tkey32_TDirectory = UnROOT.TKey32(0x006B, 4, 0x0036, WRITE_TIME, 53, 1, 0x000003d3, 100, "", "test_ntuple_minimal.root", "") # 1 key, and it is the RNTuple Anchor const n_keys = [ 0x00, 0x00, 0x00, 0x01, diff --git a/src/RNTuple/Writing/TFileWriter.jl b/src/RNTuple/Writing/TFileWriter.jl index 03cd28a1..28746de2 100644 --- a/src/RNTuple/Writing/TFileWriter.jl +++ b/src/RNTuple/Writing/TFileWriter.jl @@ -604,7 +604,7 @@ function write_rntuple(file::IO, table; file_name="test_ntuple_minimal.root", rn rntAnchor_update[:fLenFooter] = rnt_footer_obs.len tkey32_anchor_position = position(file) - tkey32_anchor = UnROOT.TKey32(0x0000008E, 4, typemin(Int32), Stubs.WRITE_TIME, 50, 1, tkey32_anchor_position, 100, "ROOT::RNTuple", rntuple_name, "") + tkey32_anchor = UnROOT.TKey32(0x00000080, 4, typemin(Int32), Stubs.WRITE_TIME, 50, 1, tkey32_anchor_position, 100, "ROOT::RNTuple", rntuple_name, "") tkey32_anchor_obs1 = rnt_write_observe(file, tkey32_anchor) tkey32_anchor_update = Dict{Symbol, Any}() magic_6bytes_obs = rnt_write_observe(file, Stubs.magic_6bytes) diff --git a/test/RNTupleWriting/lowlevel.jl b/test/RNTupleWriting/lowlevel.jl index 74830219..ec79984d 100644 --- a/test/RNTupleWriting/lowlevel.jl +++ b/test/RNTupleWriting/lowlevel.jl @@ -110,14 +110,14 @@ test_io(UnROOT.Stubs.rnt_header, dummy_rnt_header; envelope=true) dummy_RBlob2 = [ 0x00, 0x00, 0x00, 0x2E, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, WRITE_TIME_ary..., 0x00, 0x22, - 0x00, 0x01, 0x00, 0x00, 0x01, 0xD0, 0x00, 0x00, 0x00, 0x64, 0x05, 0x52, 0x42, 0x6C, 0x6F, 0x62, + 0x00, 0x01, 0x00, 0x00, 0x01, 0xD1, 0x00, 0x00, 0x00, 0x64, 0x05, 0x52, 0x42, 0x6C, 0x6F, 0x62, 0x00, 0x00, ] test_io(UnROOT.Stubs.RBlob2, dummy_RBlob2) dummy_RBlob3 = [ 0x00, 0x00, 0x00, 0x9E, 0x00, 0x04, 0x00, 0x00, 0x00, 0x7C, WRITE_TIME_ary..., 0x00, 0x22, - 0x00, 0x01, 0x00, 0x00, 0x01, 0xFE, 0x00, 0x00, 0x00, 0x64, 0x05, 0x52, 0x42, 0x6C, 0x6F, 0x62, + 0x00, 0x01, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x64, 0x05, 0x52, 0x42, 0x6C, 0x6F, 0x62, 0x00, 0x00, ] test_io(UnROOT.Stubs.RBlob3, dummy_RBlob3) @@ -158,8 +158,8 @@ dummy_pagelink = [dummy_pagelink; reinterpret(UInt8, [xxh3_64(dummy_pagelink)])] test_io(UnROOT.Stubs.pagelink, dummy_pagelink) dummy_RBlob4 = [ - 0x00, 0x00, 0x00, 0xC2, 0x00, 0x04, 0x00, 0x00, 0x00, 0xA0, WRITE_TIME_ary..., 0x00, 0x22, - 0x00, 0x01, 0x00, 0x00, 0x02, 0x9C, 0x00, 0x00, 0x00, 0x64, 0x05, 0x52, 0x42, 0x6C, 0x6F, 0x62, + 0x00, 0x00, 0x00, 0xB6, 0x00, 0x04, 0x00, 0x00, 0x00, 0x94, WRITE_TIME_ary..., 0x00, 0x22, + 0x00, 0x01, 0x00, 0x00, 0x02, 0x9D, 0x00, 0x00, 0x00, 0x64, 0x05, 0x52, 0x42, 0x6C, 0x6F, 0x62, 0x00, 0x00, ] test_io(UnROOT.Stubs.RBlob4, dummy_RBlob4) @@ -186,25 +186,25 @@ dummy_tkey32_anchor = [ ] dummy_rnt_anchor = [ - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x16, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xBE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x53, 0x5E, 0xC4, 0x57, 0xE7, 0x3C, 0x95, 0xEF, + 0xc5, 0xe5, 0xfd, 0xe2, 0xa7, 0xda, 0xcc, 0xc3 ] test_io(UnROOT.Stubs.rnt_anchor, dummy_rnt_anchor) dummy_tkey32_TDirectory = [ - 0x00, 0x00, 0x00, 0x79, 0x00, 0x04, 0x00, 0x00, 0x00, 0x44, WRITE_TIME_ary..., 0x00, 0x35, - 0x00, 0x01, 0x00, 0x00, 0x03, 0xEC, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x74, 0x65, 0x73, 0x74, - 0x5F, 0x6E, 0x74, 0x75, 0x70, 0x6C, 0x65, 0x5F, 0x6D, 0x69, 0x6E, 0x69, 0x6D, 0x61, 0x6C, 0x2E, - 0x72, 0x6F, 0x6F, 0x74, 0x00, + 0x00, 0x00, 0x00, 0x6B, 0x00, 0x04, 0x00, 0x00, 0x00, 0x36, 0x76, 0xDB, 0x50, 0x93, 0x00, 0x35, + 0x00, 0x01, 0x00, 0x00, 0x03, 0xD3, 0x00, 0x00, 0x00, 0x64, 0x00, 0x18, 0x74, 0x65, 0x73, 0x74, + 0x5F, 0x6E, 0x74, 0x75, 0x70, 0x6C, 0x65, 0x5F, 0x6D, 0x69, 0x6E, 0x69, 0x6D, 0x61, 0x6C, 0x2E, + 0x72, 0x6F, 0x6F, 0x74, 0x00 ] test_io(UnROOT.Stubs.tkey32_TDirectory, dummy_tkey32_TDirectory) dummy_tkey32_TStreamerInfo = [ - 0x00, 0x00, 0x01, 0x94, 0x00, 0x04, 0x00, 0x00, 0x04, 0xF4, WRITE_TIME_ary..., 0x00, 0x40, - 0x00, 0x01, 0x00, 0x00, 0x04, 0x65, 0x00, 0x00, 0x00, 0x64, 0x05, 0x54, 0x4C, 0x69, 0x73, 0x74, + 0x00, 0x00, 0x01, 0x8D, 0x00, 0x04, 0x00, 0x00, 0x04, 0xE6, WRITE_TIME_ary..., 0x00, 0x40, + 0x00, 0x01, 0x00, 0x00, 0x04, 0x3e, 0x00, 0x00, 0x00, 0x64, 0x05, 0x54, 0x4C, 0x69, 0x73, 0x74, 0x0C, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6D, 0x65, 0x72, 0x49, 0x6E, 0x66, 0x6F, 0x12, 0x44, 0x6F, 0x75, 0x62, 0x6C, 0x79, 0x20, 0x6C, 0x69, 0x6E, 0x6B, 0x65, 0x64, 0x20, 0x6C, 0x69, 0x73, 0x74, ]