-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp function selection in fuzzer (#3695)
Summary: This change modifies the function selection implementation in the expression fuzzer that more evenly spreads the probability of picking a particular function. Currently, functions are chosen from a list of signatures or templated signatures that support returning a specified return type. However, this gives more preference to functions that have multiple signatures. Moreover, there are steps in the implementation where we pick between concrete and templated signatures, which distributes probabilities evenly among them even though there are more functions with concrete signatures, thereby favoring functions with templated ones. After this change, functions are selected based on their name instead among all those that support a requested return type regardless of whether they have a concrete or templated signature. Limitation: This still gives some preference to functions that support more than one return type, however that is inevitable because we always need to start with a concrete return type and then pick among functions that support it. Therefore functions that support more than one would show up multiple times when picking functions. See #3388 for more details. Effect: Ran fuzzer for 60 secs each. Top 10 functions before this patch: functionName numTimesSelected proportionOfTimesSelected numProcessedRows subscript 10620 15.17% 82877 map_concat 8620 12.31% 3977 map 8617 12.31% 28431 array_distinct 4765 6.81% 35202 array_except 4682 6.69% 42196 array_position 3920 5.60% 27943 array_sort 1959 2.80% 16455 map_keys 1952 2.79% 11303 array_constructor 1952 2.79% 25570 slice 1948 2.78% 8798 Top 10 functions after this patch: functionName numTimesSelected proportionOfTimesSelected numProcessedRows subscript 4698 6.24% 50935 array_min 3039 4.04% 31115 array_max 3027 4.02% 34004 least 1830 2.43% 10932 greatest 1749 2.32% 9115 clamp 1492 1.98% 13815 floor 1416 1.88% 20626 divide 1404 1.87% 18279 negate 1399 1.86% 19363 sign 1367 1.82% 16842 Pull Request resolved: #3695 Reviewed By: kgpai Differential Revision: D42467870 Pulled By: bikramSingh91 fbshipit-source-id: 4a18afc9ea62b393c8ce4b6b8f0661fb7f0c0eef
- Loading branch information
1 parent
045d5df
commit 46da06e
Showing
2 changed files
with
115 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters