Skip to content

Conversation

@jblomer
Copy link
Contributor

@jblomer jblomer commented Nov 21, 2025

Custom classes with [U]Long64_t template arguments need to use their
meta-normalized name as type alias. Otherwise, during reconstruction
with the RNTuple normalized name, the streamer info for the
std::[u]int64_t argument will be requested (typically long
instead of long long).

Fixes #20282

@jblomer jblomer self-assigned this Nov 21, 2025
@jblomer jblomer marked this pull request as draft November 22, 2025 00:20
@github-actions
Copy link

github-actions bot commented Nov 22, 2025

Test Results

    22 files      22 suites   3d 21h 1m 18s ⏱️
 3 781 tests  3 779 ✅ 0 💤 2 ❌
81 190 runs  81 188 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit 16a90ef.

♻️ This comment has been updated with latest results.

@jblomer jblomer force-pushed the ntuple-fix-int-templ branch 2 times, most recently from bd12deb to be32af3 Compare November 23, 2025 21:30
@jblomer jblomer marked this pull request as ready for review November 23, 2025 22:44
@jblomer jblomer force-pushed the ntuple-fix-int-templ branch from a676f02 to 16a90ef Compare November 23, 2025 22:45
Custom classes with [U]Long64_t template arguments need to use their
meta-normalized name as type alias. Otherwise, during reconstruction
with the RNTuple normalized name, the streamer info for the
`std::[u]int64_t` argument will be requested (typically `long`
instead of `long long`).
return GetRenormalizedMetaTypeName(metaNormalizedName);
}

bool ROOT::Internal::NeedsMetaNameAsAlias(const std::string &metaNormalizedName, std::string &renormalizedAlias)
Copy link
Member

Choose a reason for hiding this comment

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

This seems similar to (but better than): TClassEdit::GetLong64_Name, isn't it?

EXPECT_TRUE(NeedsMetaNameAsAlias("MyClass<ULong64_t>", renormalizedAlias));
EXPECT_TRUE(NeedsMetaNameAsAlias("std::vector<MyClass<Long64_t> >", renormalizedAlias));
EXPECT_EQ("std::vector<MyClass<Long64_t>>", renormalizedAlias);
EXPECT_FALSE(NeedsMetaNameAsAlias("MyClass<ROOT::RVec<Long64_t>>", renormalizedAlias));
Copy link
Member

Choose a reason for hiding this comment

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

We should also test map, i.e. when the long long is the second or third argument. We should also test when the argument is nested (eg EdmWrapper<map<int, UserStruct<something, Long64_t>>>).

{"std::pair<CustomStruct, DerivedA>", {"DerivedA", "CustomStruct"}, ""},
{"EdmWrapper<long long>", {"EdmWrapper<Long64_t>"}, "EdmWrapper<Long64_t>"},
{"EdmContainer", {"EdmContainer", "EdmWrapper<Long64_t>"}, ""},
{"EdmWrapper<long long>::Inner", {"EdmWrapper<Long64_t>::Inner"}, "EdmWrapper<Long64_t>::Inner"},
Copy link
Member

Choose a reason for hiding this comment

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

Do we also test (besides for std) other combination of class template instance and regular class/namespaces? eg. CL::TP<long long>::CL2, CL::CL2::TP<long long>, etc.

Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

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

Should this be mentioned in "Type Name Normalization" of BinaryFormatSpecification.md?

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.

[ntuple] use meta normalized name for streamer info records

3 participants