[ntuple] Add RRVecField for type-erased I/O of RVecs#8770
[ntuple] Add RRVecField for type-erased I/O of RVecs#8770eguiraud merged 13 commits intoroot-project:masterfrom
Conversation
|
Starting build on |
DeepCode's analysis on #47e2b3 found:
Top issues
👉 View analysis in DeepCode’s Dashboard | Configure the bot👉 The DeepCode service and API will be deprecated in August, 2021. Here is the information how to migrate. Thank you for using DeepCode 🙏 ❤️ !If you are using our plugins, you might be interested in their successors: Snyk's JetBrains plugin and Snyk's VS Code plugin. |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
jblomer
left a comment
There was a problem hiding this comment.
Awesome! Some comments inline. I marked some std::int32_t instead of int32_t but not all. I think it would be also good to warn in the documentation of RVec that changes to the memory allocation and to the class layout need to be reflected here (perhaps that's already there).
|
Starting build on |
1 similar comment
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
|
Starting build on |
2 similar comments
|
Starting build on |
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
Failing tests: |
|
Starting build on |
|
The only major things left should be the extra tests required by @jblomer and support for |
|
Build failed on mac1014/python3. Warnings:
|
|
Build failed on mac11.0/cxx17. Warnings:
Failing tests: |
|
Starting build on |
|
Build failed on mac11.0/cxx17. Failing tests: |
8d2b81a to
8d3ef0a
Compare
|
Starting build on |
|
Build failed on windows10/cxx14. Errors:
And 365 more |
|
@jblomer about the discussion at #8770 (comment) , I remember that for RVec we said we would not call destructors for collection elements at every entry, but I see that RVectorField does at line 1039? root/tree/ntuple/v7/src/RField.cxx Lines 1036 to 1044 in 7e709f8 Also if the (asking about RVectorField to understand what to do with RRVecField) |
|
Starting build on |
It does so only for the left-over elements when the collection shrinks.
Good point! I created #10520. |
uhm why are leftover elements different from elements that are replaced? if some resource management logic has to be called when an element is removed, it might also have to be called when it is replaced? EDIT: ah, I see now that #10520 basically covers this |
jblomer
left a comment
There was a problem hiding this comment.
Looks good to me, except one tiny comment on the change in the RNTupleModel API
|
Sorry I have to rebase this on top of master again in order to be able to compile the branch with gcc 12.. |
With RVec's redesign, RVec<bool> now behaves consistently with all other RVec<T>'s (it does not inherit vector<bool>'s behavior).
This removes some code duplication and makes it possible for specialized RField<RVec<T>> instances to act as general RRVecField instances for what regards visitor implementations (immediately useful to implement a single RPrintValueVisitor for all RVec fields).
Plus tests for type-erased and non-type-erased value printing.
RNTuple does not explicitly destroy existing values when reading, it only overwrites the bytes.
Co-authored-by: Philippe Canal <[email protected]>
When reading RVecs, we now: - destroy excess elements if size is reduced w.r.t. the previous entry, for consistency with std::vector I/O - generate new values for new elements if size is increased w.r.t. the previous entry -- only if needed instead of unconditionally as before - when reallocating, we call destructors on the old elements and generate the corresponding new elements in the new memory buffer
|
Starting build on |
|
This should be ready to go, with two performance optimizations (marked as TODOs) that are left for future PRs (this one is already terribly large, I think). |
jblomer
left a comment
There was a problem hiding this comment.
Great! I'm looking forward to adjusting the ntuple data source to this.
This PR:
RVec<bool>which is unnecessary now that we have RVec 2.0ntuple->Show+ RVecsChecklist:
This PR fixes #6347 .