Skip to content

Add tests for std::optional and std::unique_ptr #44

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
merged 2 commits into from
May 7, 2025

Conversation

hahnjo
Copy link
Member

@hahnjo hahnjo commented Apr 30, 2025


I think that it's not really needed to test all [Split]Index{32,64} column types for these; let me know if you disagree.

@hahnjo hahnjo added this to the 1.0 milestone Apr 30, 2025
@hahnjo hahnjo requested review from pcanal, silverweed and enirolf April 30, 2025 15:51
@hahnjo hahnjo self-assigned this Apr 30, 2025
@pcanal
Copy link
Member

pcanal commented Apr 30, 2025

I think that it's not really needed to test all [Split]Index{32,64}

I agree that the index would be unexpected here but we should test at least one of Split[U]Int{16,32,64}

@hahnjo
Copy link
Member Author

hahnjo commented May 1, 2025

I think that it's not really needed to test all [Split]Index{32,64}

I agree that the index would be unexpected here but we should test at least one of Split[U]Int{16,32,64}

All fundamental column types are tested in types.fundamental, so I think we don't need to exercise them here. The selection of Int32, String, and Vector is to have one fundamental type and two "collection" fields. From the optional's point of view, there is no difference between Int32 and SplitInt32.

The reason we might want to consider [Split]Index{32,64} is that it's the primary column type of the RNullableField to encode if there is an element or not. But I think we are exhaustively testing it for vector and soon set and map.

@pcanal
Copy link
Member

pcanal commented May 1, 2025

From the optional's point of view, there is no difference between Int32 and SplitInt32.

The question, though, is: do we test that assumption? (the assumption might be accurate (and guarantee to stay that way) for our implementation, it may not be for an alternate implementation).

@hahnjo
Copy link
Member Author

hahnjo commented May 2, 2025

From the optional's point of view, there is no difference between Int32 and SplitInt32.

The question, though, is: do we test that assumption? (the assumption might be accurate (and guarantee to stay that way) for our implementation, it may not be for an alternate implementation).

No, as discussed in January: We don't want to (and cannot) test all combinations of all fields and all column types. Note also that the goal of the validation suite is not to provide extensive unit tests for all possible implementation issues, it is specifically about the binary format.

@hahnjo hahnjo force-pushed the optional-unique_ptr branch from fe23979 to 850210c Compare May 2, 2025 08:45
@hahnjo hahnjo added the types label May 2, 2025
@hahnjo hahnjo force-pushed the optional-unique_ptr branch from 850210c to a438fe6 Compare May 2, 2025 13:31
@hahnjo
Copy link
Member Author

hahnjo commented May 2, 2025

Discussion from the IO meeting: in the end we may want to exercise all [Split]Index{32,64}, but only for one element type (std::int32_t). Thought right now: then we can also use those extra fields to use a SplitInt32 encoding for the element field

@hahnjo
Copy link
Member Author

hahnjo commented May 5, 2025

then we can also use those extra fields to use a SplitInt32 encoding for the element field

On second thought, that's not a great idea because if we do this consequently, we would only have split encodings inside collections of split index encodings. Let's go with the originally agreed approach to assume separation of column encodings.

@hahnjo hahnjo force-pushed the optional-unique_ptr branch from a438fe6 to 50724ef Compare May 5, 2025 08:22
@hahnjo hahnjo requested review from silverweed and pcanal and removed request for pcanal May 5, 2025 08:25
Copy link
Contributor

@silverweed silverweed left a comment

Choose a reason for hiding this comment

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

lgtm

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.

Thanks.

@hahnjo hahnjo merged commit a91c84c into root-project:main May 7, 2025
1 check passed
@hahnjo hahnjo deleted the optional-unique_ptr branch May 7, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test for std::unique_ptr Test for std::optional
3 participants