-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RDF] Prepare for snapshot with variations 2 #19726
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
[RDF] Prepare for snapshot with variations 2 #19726
Conversation
Test Results 20 files 20 suites 3d 17h 8m 6s ⏱️ For more details on these failures, see this check. Results for commit 7893f1f. ♻️ 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.
LGTM overall but I'm hesitant in mentioning that there will be an implementation that can be activated via RSnapshotOptions in this PR since the implementation is not given at the same time
Co-authored-by: Vincenzo Eduardo Padulano <v.e.padulano@gmail.com>
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.
2a39f69
to
7893f1f
Compare
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.
Thanks!
Next to cleaning up a few white spaces and moving a docstring to the right place, two changes are necessary to implement snapshot with variations. These affect column readers for systematic variations:
Previously, each variation got its own column reader, even if the underlying
Define
was the same (because a column isn't affected by variations). In this case, SnapshotWithVariations would write the column again and again, since it doesn't have a way to check if the column is affected by variations.Here, column readers are reused if a column is identical to nominal, and this will be detected by snapshot to write the column only once. This goes both for Jitted as well as compiled defines.
Lastly, an exception for variations of snapshot could be removed and replaced with aThis will go into a later PR as per Vincenzo's comment.static_assert
, since snapshot will be activated in RSnapshotOptions.This is part 2 of the work in #19725.