Skip to content

fuzzgen: Move Arbitrary structs into the fuzzers#5820

Merged
afonso360 merged 4 commits intobytecodealliance:mainfrom
afonso360:fuzzgen-move-structs
Mar 4, 2023
Merged

fuzzgen: Move Arbitrary structs into the fuzzers#5820
afonso360 merged 4 commits intobytecodealliance:mainfrom
afonso360:fuzzgen-move-structs

Conversation

@afonso360
Copy link
Contributor

👋 Hey,

This PR is built on top of #5765, sorry about chaining these PR's so much, but doing it on top of main would cause conflicts with the two other PR's.

This PR does some cleanup around fuzzgen that @jameysharp sugested in #5764 (comment).

Namely:

  • It moves the Arbitrary structs from fuzzgen into the individual fuzzers.
    • This also allows us to keep ALLOWED_LIBCALLS near the interpreter implementation, which need to be updated together.
  • It centralizes the testcase printing infrastructure in a helper struct provided by fuzzgen.

@afonso360 afonso360 requested a review from jameysharp February 17, 2023 19:10
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator fuzzing Issues related to our fuzzing infrastructure labels Feb 17, 2023
@github-actions
Copy link

Subscribe to Label Action

cc @fitzgen

Details This issue or pull request has been labeled: "cranelift", "fuzzing"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: fuzzing

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

Copy link
Contributor

@jameysharp jameysharp left a comment

Choose a reason for hiding this comment

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

I think this turned out really well!

As a neat bonus, this also means that if we want statistics about how many times we rejected a fuzz input, like you were checking for a while, now we can reference static variables that are local to each fuzz-target from inside the implementation of Arbitrary.

After you rebase the other PRs out from under this one, go ahead and merge!

@afonso360 afonso360 force-pushed the fuzzgen-move-structs branch from 7a8f07a to a2f64e1 Compare March 4, 2023 18:49
@afonso360 afonso360 force-pushed the fuzzgen-move-structs branch from a2f64e1 to 6c35268 Compare March 4, 2023 18:51
@afonso360
Copy link
Contributor Author

afonso360 commented Mar 4, 2023

Rebased this onto the latest main and fixed the issue above.

As a neat bonus, this also means that if we want statistics about how many times we rejected a fuzz input, like you were checking for a while, now we can reference static variables that are local to each fuzz-target from inside the implementation of Arbitrary.

Yeah, that's a great idea! I'll put a PR up for that!

@afonso360 afonso360 enabled auto-merge March 4, 2023 19:00
@afonso360 afonso360 added this pull request to the merge queue Mar 4, 2023
Merged via the queue into bytecodealliance:main with commit e962149 Mar 4, 2023
@afonso360 afonso360 deleted the fuzzgen-move-structs branch March 4, 2023 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator fuzzing Issues related to our fuzzing infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants