Skip to content

[rntuple] Read the extra type information's content - #132

Open
sathabbott wants to merge 2 commits into
nsmith-:mainfrom
sathabbott:fix/118-extra-type-info-content
Open

sathabbott wants to merge 2 commits into
nsmith-:mainfrom
sathabbott:fix/118-extra-type-info-content

Conversation

@sathabbott

Copy link
Copy Markdown
Collaborator

🤖 AI generated content

Fixes #118. Depends on #127 (the content is an RNTuple string, plain bytes); until #127 merges, this PR also shows its commit.

ExtraTypeInformation gains fContent, 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-streamed TList of TStreamerInfo that streamed (role 0x04) fields need. ROOT writes that record in the footer's schema extension (ERRATA 10), which SchemaDescription already 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 starts 40 00 01 b2 ff ff ff ff then TList (the fixture's case.toml assertions) and names RNStreamedInner, and _unknown is 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 on ExtraTypeInformation, or on the RNTuple, returning the streamer infos.

Assisted-by: claude-code:claude-opus-5-5

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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (3f43287) to head (59a26ed).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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.
📢 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.

This branch has not been deployed

No deployments
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.

[rntuple] ExtraTypeInformation does not read its content (the streamer info of streamed fields)

2 participants