Skip to content

[ntuple] Fix attribute writing with RMiniFile - #23075

Open
silverweed wants to merge 2 commits into
root-project:masterfrom
silverweed:ntuple_attr_recreate_fix
Open

[ntuple] Fix attribute writing with RMiniFile #23075
silverweed wants to merge 2 commits into
root-project:masterfrom
silverweed:ntuple_attr_recreate_fix

Conversation

@silverweed

Copy link
Copy Markdown
Contributor

WriteTFileNTupleKey was making 2 mistakes:

  • incorrectly writing the TFile's epilogue even for Hidden clones
    (which led to files containing 1 extra StreamerInfo/FreeList/KeysList
    per attribute set);
  • writing the wrong anchor location for attribute RNTuples.

This was not caught by tests because we never actually added tests for
attribute writing through RMiniFile.

WriteTFileNTupleKey was doing 2 mistakes:
- incorrectly writing the TFile's epilogue even for Hidden clones
  (which led to files containing 1 extra StreamerInfo/FreeList/KeysList
  per attribute set);
- writing the wrong anchor location for attribute RNTuples.

This was not caught by tests because we never actually added tests for
attribute writing through RMiniFile.
@silverweed
silverweed requested review from enirolf and hahnjo August 13, 2026 14:44
@silverweed silverweed self-assigned this Aug 13, 2026
@silverweed
silverweed requested a review from jblomer as a code owner August 13, 2026 14:44
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 15h 26m 18s ⏱️
 3 859 tests  3 857 ✅  0 💤 2 ❌
78 618 runs  78 574 ✅ 41 💤 3 ❌

For more details on these failures, see this check.

Results for commit a055390.

♻️ This comment has been updated with latest results.

@jblomer jblomer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Perhaps check or add a comment to prevent the use of the minifile with only hidden ntuples (I think we need a main one to produce a correct file).

Comment thread tree/ntuple/test/ntuple_attributes.cxx Outdated
Comment on lines +514 to +516
// The first 3 RBlobs we're gonna find are, in order: the main RNTuple header, MyAttrSet1's header
// and MyAttrSet2's header.
const auto headerSeek = key.fSeekKey + key.fKeyLen;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That looks a bit brittle to me in the long term. Can we identify the header blobs through their offsets in the corresponding anchors?

@silverweed

silverweed commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Perhaps check or add a comment to prevent the use of the minifile with only hidden ntuples (I think we need a main one to produce a correct file).

This should be already mandated by the current public API (you cannot Recreate a RMiniFileWriter which is hidden through public methods: only Append to one or Clone one); though it doesn't hurt to point that out (where is it best to do it? In the private ctor perhaps?)

@silverweed
silverweed force-pushed the ntuple_attr_recreate_fix branch from 8aafc73 to a055390 Compare August 14, 2026 14:11
@jblomer

jblomer commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Perhaps check or add a comment to prevent the use of the minifile with only hidden ntuples (I think we need a main one to produce a correct file).

This should be already mandated by the current public API (you cannot Recreate a RMiniFileWriter which is hidden through public methods: only Append to one or Clone one); though it doesn't hurt to point that out (where is it best to do it? In the private ctor perhaps?)

Private constructor sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants