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

misc(fuzzer): Support custom result verifier with compare() API in window fuzzer #12148

Closed
wants to merge 1 commit into from

Conversation

kagamiori
Copy link
Contributor

Summary:
The custom result verifiers of some functions provides a compare() API that can be used to
compare the expected and actual results after certain transformation. This is needed for
functions like avg(interval) -> interval because the result of this function can have a small
precision error that should be tolerated. However, the window fuzzer used to only support
the verify() API of custom result verifiers. This diff makes the window fuzzer to use the
compare() API as well when available.

Differential Revision: D68507422

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 22, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68507422

Copy link

netlify bot commented Jan 22, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 0882dd9
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67929ceb0a363a0008bc7a00

@kagamiori kagamiori requested a review from kgpai January 22, 2025 22:22
Copy link
Contributor

@kgpai kgpai left a comment

Choose a reason for hiding this comment

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

Looks great; if you can refactor some of the code under the if blocks so theres less duplication and more readability that would be great.

@@ -1052,27 +1052,6 @@ void AggregationFuzzer::Stats::print(size_t numIterations) const {
AggregationFuzzerBase::Stats::print(numIterations);
}

namespace {
// Merges a vector of RowVectors into one RowVector.
RowVectorPtr mergeRowVectors(
Copy link
Contributor

Choose a reason for hiding this comment

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

Someone was just asking about a utility like this , thanks for moving it to fuzzer toolkit.

frame);
customVerifierInitialized = true;
} catch (...) {
LOG(WARNING) << "Custom verifier initialization failed";
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we throw instead of just logging as a warning ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we intentionally create some illegal queries in window fuzzer to ensure they don't crash. In that case, the custom verifier initialization may throw, which is expected.

LOG(INFO) << "Verified results against reference DB";
} else if (referenceQueryRunner_->supportsVeloxVectorResults()) {
if (enableWindowVerification) {
auto prestoQueryRunner =
Copy link
Contributor

Choose a reason for hiding this comment

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

nit code under these if blocks is very similar, maybe we can move some of it to some common function ?

kagamiori added a commit to kagamiori/velox that referenced this pull request Jan 23, 2025
…ndow fuzzer (facebookincubator#12148)

Summary:

The custom result verifiers of some functions provides a compare() API that can be used to 
compare the expected and actual results after certain transformation. This is needed for 
functions like `avg(interval) -> interval` because the result of this function can have a small 
precision error that should be tolerated. However, the window fuzzer used to only support 
the verify() API of custom result verifiers. This diff makes the window fuzzer to use the 
compare() API as well when available.

Reviewed By: kgpai

Differential Revision: D68507422
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68507422

kagamiori added a commit to kagamiori/velox that referenced this pull request Jan 23, 2025
…ndow fuzzer (facebookincubator#12148)

Summary:

The custom result verifiers of some functions provides a compare() API that can be used to 
compare the expected and actual results after certain transformation. This is needed for 
functions like `avg(interval) -> interval` because the result of this function can have a small 
precision error that should be tolerated. However, the window fuzzer used to only support 
the verify() API of custom result verifiers. This diff makes the window fuzzer to use the 
compare() API as well when available.

Reviewed By: kgpai

Differential Revision: D68507422
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68507422

…ndow fuzzer (facebookincubator#12148)

Summary:

The custom result verifiers of some functions provides a compare() API that can be used to 
compare the expected and actual results after certain transformation. This is needed for 
functions like `avg(interval) -> interval` because the result of this function can have a small 
precision error that should be tolerated. However, the window fuzzer used to only support 
the verify() API of custom result verifiers. This diff makes the window fuzzer to use the 
compare() API as well when available.

Reviewed By: kgpai

Differential Revision: D68507422
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68507422

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 419de77.

Copy link

Conbench analyzed the 0 benchmark runs that triggered this notification.

None of the specified runs were found on the Conbench server.

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants