-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[ntuple] improve type name renormalization #19323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e3747e0
to
3153961
Compare
Test Results 21 files 21 suites 3d 10h 5m 26s ⏱️ Results for commit 17d162f. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment + a warning from the compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach looks good to me. We need to add handling of the __1
inline namespace of libc++, and find a solution for the ATLAS DataVector
with suppressed template arguments.
Maybe related: https://its.cern.ch/jira/browse/ROOT-5862 |
3153961
to
b4d5353
Compare
26d39e5
to
147b9e0
Compare
dc663fe
to
17d162f
Compare
const std::string expectedAfter{"AtlasLikeDataVector<CustomStruct>"}; | ||
// Make sure autoloading happened and the rule to suppress the second template argument kicked in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that removing the test of the actual ATLAS issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. don't we need both the original testing and a new test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem observed by ATLAS is tested above. This particular part tests the TypeName()
function only, which in the DataVector case is different from RField<T>::GetTypeName()
. What we test now (after the patch) is that TypeName()
always gives the same result independent of the currently loaded libraries.
It's arguably weak for that purpose and we may drop the TypeName()
part here altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am missing something as I dont see anymore the test for the short name being there ... I am especially thrown off by the comment that is being removed:
Make sure autoloading happened and the rule to suppress the second template argument kicked in
which seems explicitly say that the above call and follow test are exactly for the ATLAS scenario ... and/or where should that comment move to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 21 is the actual test:
ASSERT_NO_THROW(entry.GetPtr<AtlasLikeDataVector<CustomStruct>>("my_field"));
We ask for a shared pointer without the extra template argument, and it works even tough on disk the extra argument is present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am quite confused. If/since new line 24 set the expectation to recording with the long name, then line 21 will work with or without the dictionary (demangled name match the long name).
So unless we also make sure that in the test the 'current' long name does not match the long name when storing the file (I can't recall if we are doing that), then we wouldn't really test the feature ('please ignore the 2nd argument') ... (that is, unless I am still missing something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, you're right! The test didn't make much sense. I added a modified version which I hope makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At which point in the new test is the autoloading of the library triggered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm not sure. I guess by the constructor of ROOT::RField<AtlasLikeDataVector<CustomStruct>>
? But does it matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does in the sense that the previous code/test was checking both before and after the autoloading, ensuring that the autoloading did happen. Without these tests, the test can later be unwittingly updated to no longer test the autoloading at all (for example by explicitly linking the dictionary library) and thus removing the test of 'RNTuple use of a specific time customized by the users will ensure that the user's library is auto-loaded' (and thus increasing the possibility that we unwittingly stop supporting it)
0b8f607
to
f3b60e0
Compare
Add clarifications on type name normalization wrt. - type name resolution of stdlib types - treatment of C style fixed-size arrays. - CV qualifier treatment in template arguments These points follow implicitly from the specification of the supported C++ types but it is useful to add them explicitly to the type name normalization rules. Since in the process also bugs were discovered related to fixed-size arrays, we give this specification a bump in the patch version number.
3b407ac
to
0648fc5
Compare
Add different code path for renormalizing a demangled typeid name. Such type names come from RField<T>::TypeName(). In this case, the compiler has done already most of the normalization work and we don't need to go through ROOT meta. There are some parts ROOT meta does that we need to repeat for this case, e.g. dropping optional template arguments of stdlib containers.
Add different code path for renormalizing a demangled typeid name. Such type names come from
RField<T>::TypeName()
. In this case, the compiler has done already most of the normalization work and we don't need to go through ROOT meta. More importantly, the result does not depend on the state of ROOT Meta, e.g. the set of loaded libraries.There are some parts ROOT meta does that we need to repeat for this case, e.g. dropping optional template arguments of stdlib containers.
Secondly, this PR clarifies and fixes normalization of C style fixed-size arrays.
Together, this makes the new patch version 1.0.0.2 of the spec and the anchor.
This PR fixes #19116