[rntuple] Read the extra type information's content - #132
Open
sathabbott wants to merge 2 commits into
Open
sathabbott wants to merge 2 commits into
sathabbott wants to merge 2 commits into
Conversation
docs/design.md promises that where a builtin Python type captures a ROOT
type, the deserialized member is that builtin: bytes for strings. RNTuple
strings were RString wrappers instead.
Add CountedString, a MemberSerDe for a string stored as its length (in a
given struct format) followed by that many bytes, read as plain bytes. An
RNTuple string is Annotated[bytes, CountedString("<I")], exported from
rntuple.schema as RNTupleString, and the eight RNTuple string members (the
header's name, description and library; a field's name, type name, type
alias and description; extra type information's type name) use it.
RString is removed.
This is the RNTuple row of nsmith-#68. The TString, std::string and char* rows
stay open there; char* (nsmith-#20) can use CountedString(">i").
Part of nsmith-#68
Assisted-by: claude-code:claude-opus-5-5
ExtraTypeInformation ended at its type name. ROOT's serializer writes one more string, the content (RNTupleSerialize.cxx:389-391; root-io-spec ERRATA 9), so its length and bytes were left in the record frame's _unknown. For content identifier 0 that content is the streamed TList of TStreamerInfo that streamed (role 0x04) fields need. Add fContent, an RNTuple string like the type name. Fixes nsmith-#118 Assisted-by: claude-code:claude-opus-5-5
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
==========================================
+ Coverage 91.82% 91.87% +0.04%
==========================================
Files 37 37
Lines 2962 2965 +3
==========================================
+ Hits 2720 2724 +4
+ Misses 242 241 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #118. Depends on #127 (the content is an RNTuple string, plain
bytes); until #127 merges, this PR also shows its commit.ExtraTypeInformationgainsfContent, a length-prefixed string after the type name. ROOT's serializer writes type version, type name and content, both strings (RNTupleSerialize.cxx:389-391, root-io-spec ERRATA 9). The document doesn't say the content is a string, and rootfilespec left its 4-byte length and its bytes in the record frame's_unknown. For content identifier 0 the content is the ROOT-streamedTListofTStreamerInfothat streamed (role0x04) fields need. ROOT writes that record in the footer's schema extension (ERRATA 10), whichSchemaDescriptionalready combines.Test:
rntuple/streamed.root. The header's list is empty; the footer's one record has content ID 0, type version 0, an empty type name, and a 438-byte content. The content starts40 00 01 b2 ff ff ff ffthenTList(the fixture'scase.tomlassertions) and namesRNStreamedInner, and_unknownis empty. Full suite:358 passed, 53 skipped, 46 xfailed(on top of #127).Not done here: decoding the content into the
TList. The content opens with a class tag (ff ff ff ff+TList), so it needs the object-slot reader. That's a small follow-up if you want it: a helper onExtraTypeInformation, or on the RNTuple, returning the streamer infos.Assisted-by: claude-code:claude-opus-5-5