Skip to content

Deprecate Snapshot template #19201

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

Merged

Conversation

vepadulano
Copy link
Member

@vepadulano vepadulano commented Jun 26, 2025

No description provided.

@vepadulano vepadulano requested a review from hageboeck June 26, 2025 16:25
@vepadulano vepadulano self-assigned this Jun 26, 2025
@vepadulano vepadulano force-pushed the rdf-deprecate-snapshot-template branch 3 times, most recently from f4415b9 to 2b8c62e Compare June 26, 2025 17:02
@vepadulano vepadulano force-pushed the rdf-deprecate-snapshot-template branch 2 times, most recently from 356cfd7 to abcfca9 Compare June 26, 2025 19:46
@pcanal
Copy link
Member

pcanal commented Jun 26, 2025

Is this ready for review? The commit starts with WIP.

@vepadulano vepadulano force-pushed the rdf-deprecate-snapshot-template branch from abcfca9 to 7920e07 Compare June 26, 2025 20:39
@vepadulano
Copy link
Member Author

Thank you @pcanal , the changes are indeed ready for review, the commit message has been updated accordingly.

@vepadulano vepadulano changed the title Deprecate template Snapshot overload Deprecate Snapshot template Jun 26, 2025
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. Ideally the move of the function from the headers to the source would have been done in a separate commit (as is, it is hard to tell if anything changed in those functions).

Copy link
Member

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

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

This is really great! 🚀

I added small things that might slightly improve performance and have a question on the deprecation strategy, but I didn't see any dealbreakers.

Copy link
Contributor

@martamaja10 martamaja10 left a comment

Choose a reason for hiding this comment

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

Nice job! Thank you Vincenzo!

* ROOT::Internal::RDF::AddSizeBranches was never considering the possibility of a
column being a leaf coming from an in-memory struct stored via a leaflist (i.e.
`struct A { int a; int b;}` stored via `Branch("br", &br, "a/I:b/I")`). In such
cases, there is no extra size branch to add so the function now skips this type
of column

* The bufSize and splitLevel arguments to various Branch calls were
not considering the related values of the input branch if it exists.

* A specific scenario with a Redefine changing the type of the column to
Snapshot from a C-style array stored with a leaflist to a ROOT::RVec was still
storing the value as C-style array in the output TTree. Now, when a column value
is coming from a define, the CreateCStyleArrayBranch path is never taken, as it
is not allowed to create C-style array columns from defines.

* The case of an input TTree branch containing unsplit objects of polymorphic
types was not considered in SetBranchesHelper and is now added.
Now that Snapshot does not require knowledge about column types at compile-time,
we can deprecate the Snapshot template overload. The deprecation starts now,
targeting complete removal of the overload in version 6.40. All the
functionality connected to that overload is removed from the codebase.
* Move all definitions (except trivial ones) to implementation file
* Remove many includes
* Fix many places which were relying on parasitic includes
@vepadulano vepadulano force-pushed the rdf-deprecate-snapshot-template branch from 7920e07 to c238d99 Compare June 27, 2025 10:04
@vepadulano
Copy link
Member Author

Thank you all for the reviews! I have split the changes in multiple commits to make the history clearer

@hageboeck
Copy link
Member

@vepadulano I forgot one thing: This very much deserves to be in the release notes for 6.38!

@vepadulano vepadulano merged commit 8c6b1c1 into root-project:master Jun 27, 2025
24 checks passed
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.

4 participants