Skip to content

Conversation

hageboeck
Copy link
Member

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 a static_assert, since snapshot will be activated in RSnapshotOptions.

This is part 2 of the work in #19725.

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.
Copy link

Test Results

    21 files      21 suites   3d 12h 21m 58s ⏱️
 3 558 tests  3 419 ✅  0 💤 139 ❌
72 971 runs  72 812 ✅ 17 💤 142 ❌

For more details on these failures, see this check.

Results for commit 387c01b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant