Skip to content

Improve fuzzing of Two#8006

Merged
kripken merged 23 commits into
WebAssembly:mainfrom
kripken:fuzz.two
Oct 31, 2025
Merged

Improve fuzzing of Two#8006
kripken merged 23 commits into
WebAssembly:mainfrom
kripken:fuzz.two

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Oct 29, 2025

I finally found out how to make this not horrible:

  1. We must be careful to not use randomness differently when
    the second file is provided (or else reductions can fail weirdly).
  2. Automatically fuzz the second wasm when BINARYEN_FIRST_WASM
    is provided (which means the first is to be kept fixed).
  3. Add some docs.

@kripken kripken requested a review from tlively October 29, 2025 00:03
Comment thread scripts/fuzz_opt.py Outdated
Comment on lines +1805 to +1807
# The reduce.sh script will then do the right thing, using that as the first
# wasm, and reducing on the second one, if you replace "original.wasm" in the
# command with "second.wasm" as needed.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this mean replacing "original.wasm" in the text of reduce.sh? If not, which "original.wasm" is this referring to?

It would be useful to print these instructions in the fuzzer error message that provides the reduction command.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

"original.wasm" appears in the command that the fuzzer tells you to run. I clarified this now.

Comment thread scripts/fuzz_opt.py Outdated
Comment on lines +1817 to +1819
# Generate a second wasm file. (For fuzzing, we may be given one, but we
# still generate it to avoid changes to random numbers later; we just
# discard it after.)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment doesn't quite agree with the code below, which only generates the second module when it is not given.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah, yes, we only prepare to generate it. The actual generation consumes no randomness here. I clarified the text now.

@kripken kripken merged commit 7d7dd66 into WebAssembly:main Oct 31, 2025
16 checks passed
@kripken kripken deleted the fuzz.two branch October 31, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants