-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RDF] Add snapshot with variations #19725
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
Draft
hageboeck
wants to merge
15
commits into
root-project:master
Choose a base branch
from
hageboeck:snapshot_vary
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Due to the deprecation marker, the snapshot documentation is parsed incorrectly in doxygen. Here, the main documentation is moved to the non-template overload, and the other overloads are referring to this one using the full argument list. "See above" typically doesn't work, since doxygen sorts the functions.
When a Define is added to a branch that gets varied, a new column reader was created for every variation and for every slot, irrespective of whether the column gets varied or not. For snapshot with variations, this column would be written for every variation, although it always evaluates to the same value. To prevent this duplication, the column readers that point to the same Define are shared after this commit. The readers are still cloned per slot though, so the Define's value caches remain thread safe. This allows SnapshotWithVariations to detect that columns are identical, so they are not written multiple times. The memory savings amount to 24 bytes per suppressed column reader,so they won't have a notable impact.
In order to not write a column multiple times in a snapshot with variations, the RDefineBase pointer needs to stay invariant when a variation is generated. However, the RJittedDefine was returning the pointer to its member, so it looked like the column was affected by variations. Here, this is changed to returning "this" when no variations are in effect.
Given that snapshots with variations will be enabled via RSnapshotOptions, the snapshot overload for Vary can be removed, and a static_assert can be used to signal the failure.
In order to implement snapshots with systematic variations, it is beneficial to place all members related to output branches into structs. At present, this only constitutes a move from member of SnapshotHelper to member of RBranchData struct. The TTree snapshot helpers are changed accordingly.
It is superseded by RBranchData.
…ests. In roottest, some targets are added to the Ninja build graph. These are compiled as part of the test suite, but this would create race conditions when many builds are started in parallel. Therefore, all these builds were flagged with RUN_SERIAL, significantly reducing the parallelism of roottest. Now, the tests that compile have "RESOURCE_LOCK NINJA_COMPILATION", so only a single test that compiles exectables can run, but it can run in parallel with tests that don't compile.
In addition to correctly specifying the number of CPUs in CMake, the tutorials were also setting a resource lock, which prevented them from running in parallel with other RDF tutorials. Since ROOT honours ROOT_MAX_THREADS, this resource lock can be removed.
Convert the fPreviousNode pointer into a vector of pointers. For now, it will only have a single entry, but this will allow for extending RActionSnapshot to systematic variations later.
Add a new action helper that allows for storing variations of branches alongside the classic snapshot functionality. Branches are only stored if their column readers are different from the nominal column readers. SnapshotWithVariations writes the same types as the input tree. When a branch with a systematic uncertainty doesn't pass a filter, a default-constructed value will be written. Reading this branch, however, might yield invalid values. Therefore, an additional branch with a bitmask is written, which can be used to figure out if the values in a specific column are valid. Later on, a column reader will be provided which will allow for masking the branches whose values are invalid.
This allows for faster vector resizes.
Depending on the type of the action helper (classic or with variations), add column readers for variations to the snapshot action.
This was referenced Aug 22, 2025
Test Results 20 files 20 suites 3d 4h 57m 25s ⏱️ For more details on these failures, see this check. Results for commit 4701fcc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note:
This PR is split into several smaller parts to simplify the review. Many of the commits will disappear once it gets rebased.
When this happens, the description will be extended and it will come out of draft mode.