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

No function signatures available for --only map_keys #3533

Closed
mbasmanova opened this issue Dec 16, 2022 · 11 comments
Closed

No function signatures available for --only map_keys #3533

mbasmanova opened this issue Dec 16, 2022 · 11 comments
Assignees
Labels
bug Something isn't working fuzzer Issues related the to Velox fuzzer test components.

Comments

@mbasmanova
Copy link
Contributor

Bug description

Expression fuzzer currently fails if --only flag lists only generic functions, e.g. --only map_keys

This prevents us from testing many functions in isolation.

CC: @kgpai @bikramSingh91 @kagamiori

velox_expression_fuzzer_test --only map_keys --velox_fuzzer_enable_complex_types --logtostderr=1 --duration_sec 60

I20221216 06:58:55.322088 2765706 FuzzerRunner.h:120] Skipping special form: if
I20221216 06:58:55.323611 2765706 FuzzerRunner.h:120] Skipping special form: coalesce
I20221216 06:58:55.323622 2765706 FuzzerRunner.h:120] Skipping special form: switch
I20221216 06:58:55.324132 2765706 ExpressionFuzzer.cpp:351] Total candidate functions: 1 (1 signatures)
I20221216 06:58:55.324153 2765706 ExpressionFuzzer.cpp:355] Functions with at least one supported signature: 1 (100.00%)
I20221216 06:58:55.324172 2765706 ExpressionFuzzer.cpp:359] Functions with no supported signature: 0 (0.00%)
I20221216 06:58:55.324182 2765706 ExpressionFuzzer.cpp:363] Supported function signatures: 1 (100.00%)
I20221216 06:58:55.324190 2765706 ExpressionFuzzer.cpp:367] Unsupported function signatures: 0 (0.00%)
E20221216 06:58:55.324229 2765706 Exceptions.h:68] Line: /Users/mbasmanova/cpp/velox-1/velox/expression/tests/ExpressionFuzzer.cpp:778, Function:go, Expression: !signatures_.empty() No function signatures available., Source: RUNTIME, ErrorCode: INVALID_STATE
libc++abi: terminating with uncaught exception of type facebook::velox::VeloxRuntimeError: Exception: VeloxRuntimeError
Error Source: RUNTIME
Error Code: INVALID_STATE
Reason: No function signatures available.
Retriable: False
Expression: !signatures_.empty()
Function: go
File: /Users/mbasmanova/cpp/velox-1/velox/expression/tests/ExpressionFuzzer.cpp
Line: 778

System information

n/a

Relevant logs

n/a
@mbasmanova mbasmanova added bug Something isn't working fuzzer Issues related the to Velox fuzzer test components. labels Dec 16, 2022
@kagamiori kagamiori self-assigned this Dec 16, 2022
@darrenfu
Copy link
Contributor

Also got affected for a few map functions, such as map_from_entries.

@bikramSingh91
Copy link
Contributor

this will be fixed as a part of #3388. It happens because the current code relies on function signatures to pick the starting return type and currently it only picks from the non-templatized function signatures. Therefore it requires "signatures_" to be non empty and has a VELOX_CHECK for that.

The part in #3388 that deals with using random top level return type (using VectorFuzzer::randType() ) will fix this.

@mbasmanova
Copy link
Contributor Author

@bikramSingh91 Bikram, what is the timeline for #3388? If it is more than a week away, can we fix this issue first to unblock folks adding new functions?

@kagamiori
Copy link
Contributor

I think we can do a quick fix to unblock the new functions before Bikram implement a general solution. Basically we can flip the coin to determine whether to choose a function from signatures_ or signatureTemplates_. If the chosen one is empty, then we choose from the other.

@bikramSingh91
Copy link
Contributor

I think we can do a quick fix to unblock the new functions before Bikram implement a general solution. Basically we can flip the coin to determine whether to choose a function from signatures_ or signatureTemplates_. If the chosen one is empty, then we choose from the other.

Sounds good! let me know if you have already started on this, otherwise feel free to assign it to me.

@kagamiori
Copy link
Contributor

I think we can do a quick fix to unblock the new functions before Bikram implement a general solution. Basically we can flip the coin to determine whether to choose a function from signatures_ or signatureTemplates_. If the chosen one is empty, then we choose from the other.

Sounds good! let me know if you have already started on this, otherwise feel free to assign it to me.

Hi Bikram, Yeah, I'm working on this. It would be great if you could help review it.

kagamiori added a commit to kagamiori/velox that referenced this issue Dec 17, 2022
… in fuzzer

Summary:
The signatures of some functions contain type variables such as "T". When generating
a random expression, fuzzer currently choose the top-level function only from function
signatures that do not contain type variable. This is a limitation because sometimes we
would like to test only a function that have type variables in its signature.

This diff allows choosing function signatures that contain type variables as the top-level
function. It also add an API  ArgumentTypeFuzzer::fuzzReturnType() to return a concrete
type that can bind to the formal return type of a function signature.

This diff fixes the issue facebookincubator#3533.

Differential Revision: D42116543

fbshipit-source-id: c18ece843dadfb5bc3eec6e471d14f74a90034df
@mbasmanova
Copy link
Contributor Author

@kagamiori Wei, Bikram, thank you for working on this. I wonder if it makes sense to start by randomly picking up a signature or signature template instead of picking up return type.

@kagamiori
Copy link
Contributor

@kagamiori Wei, Bikram, thank you for working on this. I wonder if it makes sense to start by randomly picking up a signature or signature template instead of picking up return type.

Yes, I think in #3540 we pick up a signature or signature template and use its return type as the top-level result type.

@kagamiori
Copy link
Contributor

#3540 is blocked by fuzzer test failures such as #3542. It may be a problem in the fuzzer itself (e.g., simplified path). I'm going to investigate.

zacw7 pushed a commit to zacw7/velox that referenced this issue Dec 20, 2022
… in fuzzer (facebookincubator#3540)

Summary:
Pull Request resolved: facebookincubator#3540

The signatures of some functions contain type variables such as "T". When generating
a random expression, fuzzer currently choose the top-level function only from function
signatures that do not contain type variable. This is a limitation because sometimes we
would like to test only a function that have type variables in its signature.

This diff allows choosing function signatures that contain type variables as the top-level
function. It also add an API  ArgumentTypeFuzzer::fuzzReturnType() to return a concrete
type that can bind to the formal return type of a function signature.

This diff fixes the issue facebookincubator#3533.

Reviewed By: bikramSingh91

Differential Revision: D42116543

fbshipit-source-id: 2c118f127561dc069adf6a845f4c4f500fffa70e
kagamiori added a commit to kagamiori/velox that referenced this issue Dec 21, 2022
… in fuzzer (facebookincubator#3540)

Summary:
Pull Request resolved: facebookincubator#3540

The signatures of some functions contain type variables such as "T". When generating
a random expression, fuzzer currently choose the top-level function only from function
signatures that do not contain type variable. This is a limitation because sometimes we
would like to test only a function that have type variables in its signature.

This diff allows choosing function signatures that contain type variables as the top-level
function. It also add an API  ArgumentTypeFuzzer::fuzzReturnType() to return a concrete
type that can bind to the formal return type of a function signature.

This diff fixes the issue facebookincubator#3533.

Reviewed By: bikramSingh91

Differential Revision: D42116543

fbshipit-source-id: 3f6ab56065deda24f954450121948a0f81bb2e67
kevinwilfong pushed a commit to kevinwilfong/velox that referenced this issue Dec 21, 2022
… in fuzzer (facebookincubator#3540)

Summary:
Pull Request resolved: facebookincubator#3540

The signatures of some functions contain type variables such as "T". When generating
a random expression, fuzzer currently choose the top-level function only from function
signatures that do not contain type variable. This is a limitation because sometimes we
would like to test only a function that have type variables in its signature.

This diff allows choosing function signatures that contain type variables as the top-level
function. It also add an API  ArgumentTypeFuzzer::fuzzReturnType() to return a concrete
type that can bind to the formal return type of a function signature.

This diff fixes the issue facebookincubator#3533.

Differential Revision: https://internalfb.com/D42116543

fbshipit-source-id: fac259688cd1dc2fd33317965471634cb7c85962
zacw7 pushed a commit to zacw7/velox that referenced this issue Dec 21, 2022
… in fuzzer (facebookincubator#3540)

Summary:
Pull Request resolved: facebookincubator#3540

The signatures of some functions contain type variables such as "T". When generating
a random expression, fuzzer currently choose the top-level function only from function
signatures that do not contain type variable. This is a limitation because sometimes we
would like to test only a function that have type variables in its signature.

This diff allows choosing function signatures that contain type variables as the top-level
function. It also add an API  ArgumentTypeFuzzer::fuzzReturnType() to return a concrete
type that can bind to the formal return type of a function signature.

This diff fixes the issue facebookincubator#3533.

Reviewed By: bikramSingh91

Differential Revision: D42116543

fbshipit-source-id: 0a01926e044e1e1b7e87f6093136dbc7fe12d235
kagamiori added a commit to kagamiori/velox that referenced this issue Dec 21, 2022
… in fuzzer (facebookincubator#3540)

Summary:
Pull Request resolved: facebookincubator#3540

The signatures of some functions contain type variables such as "T". When generating
a random expression, fuzzer currently choose the top-level function only from function
signatures that do not contain type variable. This is a limitation because sometimes we
would like to test only a function that have type variables in its signature.

This diff allows choosing function signatures that contain type variables as the top-level
function. It also add an API  ArgumentTypeFuzzer::fuzzReturnType() to return a concrete
type that can bind to the formal return type of a function signature.

This diff fixes the issue facebookincubator#3533.

Reviewed By: bikramSingh91

Differential Revision: D42116543

fbshipit-source-id: a37a0fa756242c471906d3aa6812b01613bbbb12
facebook-github-bot pushed a commit that referenced this issue Dec 21, 2022
… in fuzzer (#3540)

Summary:
Pull Request resolved: #3540

The signatures of some functions contain type variables such as "T". When generating
a random expression, fuzzer currently choose the top-level function only from function
signatures that do not contain type variable. This is a limitation because sometimes we
would like to test only a function that have type variables in its signature.

This diff allows choosing function signatures that contain type variables as the top-level
function. It also add an API  ArgumentTypeFuzzer::fuzzReturnType() to return a concrete
type that can bind to the formal return type of a function signature.

This diff fixes the issue #3533.

Reviewed By: bikramSingh91

Differential Revision: D42116543

fbshipit-source-id: 49a1c492dbb25c31ac3b9ceb2d2fb0087a032438
@mbasmanova
Copy link
Contributor Author

@kagamiori Wei, is this done now?

@kagamiori
Copy link
Contributor

@kagamiori Wei, is this done now?

I believe so. Closing this issue since it's fixed in #3540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fuzzer Issues related the to Velox fuzzer test components.
Projects
None yet
Development

No branches or pull requests

4 participants