-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add concepts and concrete types for BlockZipperJoinImpl
#1625
Conversation
if (allBlocksWereFilled) { | ||
blockStatus = BlockStatus::allFilled; | ||
} | ||
}; |
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.
Here, self
is swapped with this
AD_CORRECTNESS_CHECK(!lessThan_(lastProcessedElement, | ||
std::as_const(blocks.front()).back())); | ||
AD_CORRECTNESS_CHECK( | ||
!lessThan_(lastProcessedElement, blocks.front().back())); |
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.
Here as_const
is dropped. This presumably works because of recent fixes to the IdTable
class.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1625 +/- ##
=======================================
Coverage 89.37% 89.38%
=======================================
Files 375 375
Lines 36107 36107
Branches 4077 4077
=======================================
+ Hits 32272 32274 +2
+ Misses 2518 2516 -2
Partials 1317 1317 ☔ View full report in Codecov by Sentry. |
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.
I have a rant about code duplication, read it, think about it, comment it, and then do something about it or don't depending on the outcome of the thought.
Probably there's nothing to do...
@@ -1228,7 +1253,8 @@ struct BlockZipperJoinImpl { | |||
// `side.undefBlocks_` and skipped for subsequent processing. The first block | |||
// containing defined values is split and the defined part is stored in | |||
// `side.currentBlocks_`. | |||
void findFirstBlockWithoutUndef(auto& side) { | |||
void findFirstBlockWithoutUndef( | |||
ad_utility::SameAsAny<LeftSide, RightSide> auto& side) { |
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.
The only concepts you are using are SameAsAny<LeftSide, RightSide>
and SameAsAny<CurrentBlocksLeft, CurrentBlocksRight>
.
Can we explore if we can remove some of the redundancy?
My first approach is: With concepts it doesn't work, they can't be local, you cant shorten their names, etc.
So a syntax could be to have a static constexpr bool
and then write
template <typename T> requires LeftOrRightSide<T>
But that is not at all shorter....
If you want to....
Bad word Bad word Bad word...
** MACRO **
(don't forget to Undef it).
But maybe this all isn't worth it.
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.
A very minor suggestion, that should be easily implementable.
// We can't define aliases for these concepts, so we use macros instead. | ||
#define Side SameAsAny<LeftSide, RightSide> auto | ||
#define Blocks SameAsAny<LeftBlocks, RightBlocks> auto |
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.
To be ultra safe,
pleas do an #if defined(Side) || defined(Blocks) ERROR(...)
to guarantee that we don't accidentally overwrite any macros and introduce bugs that are impossibly to trace....
Conformance check passed ✅No test result changes. |
Quality Gate passedIssues Measures |
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.
Thank you very much, I will merge this once the checks have run through.
BlockZipperJoinImpl
BlockZipperJoinImpl
This class (which is the central implementation of the lazy merge join) previously had a lot of
const auto&
etc. parameters, which made the (already rather complex) code harder to reason about. This PR adds concrete types wherever possible, and constrains the other parameters using concepts.