Skip to content
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

[NFC][ntuple] add clarifying comment in RVariantField #15721

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jblomer
Copy link
Contributor

@jblomer jblomer commented Jun 3, 2024

@jblomer jblomer requested a review from pcanal June 3, 2024 11:12
@jblomer jblomer self-assigned this Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

Test Results

    11 files      11 suites   2d 7h 6m 41s ⏱️
 2 643 tests  2 643 ✅ 0 💤 0 ❌
27 433 runs  27 433 ✅ 0 💤 0 ❌

Results for commit 0cf959e.

@@ -3281,6 +3281,8 @@ ROOT::Experimental::RVariantField::RVariantField(std::string_view fieldName,
fVariantOffset = dm->GetOffset();

const auto tagSize = GetVariantTagSize();
// To calculate the padding, we use the tag size as a substitute for the tag alignment, i.e. the next line
Copy link
Member

Choose a reason for hiding this comment

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

If I understand correctly, we are making the assumption that for the tagtype alignment is (less or) equal to the size. The fact that the test passed on the CI shows that this assumption works on the platform we are testing on (are we testing Power10?) but it is iffy. Similarly the implementation of GetVariantTagSize has similar assumption (it even assumes that the tagtype is independent of the template arguments (I could imagine that to save space, an implementation would choose to use char for small number of argument and int for larger number of arguments or even possible a size_t (since it is the return type of index).

Do we already have a test that probes those assumptions (i.e. check with memcmp that the 1 is in the expect place for a few variant types? If/When we do, we should refer here to the tests (which should also have trivial check of size == alignment for the type we think is being used.

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.

2 participants