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

Add a top-down code generation option to wasm-smith #1484

Open
fitzgen opened this issue Apr 3, 2024 · 0 comments
Open

Add a top-down code generation option to wasm-smith #1484

fitzgen opened this issue Apr 3, 2024 · 0 comments
Labels
wasm-smith Related to the wasm-smith crate and creating wasm modules for fuzzing

Comments

@fitzgen
Copy link
Member

fitzgen commented Apr 3, 2024

Right now we generate bottom up, based on what is on the stack.

This means that we pre-filter instructions that require "rare" stacks, making their generation even rarer.

We should also add the ability to generate code top down, where we first choose the instruction we want to generate, and then ensure that the prerequisite operand values are also generated and pushed onto the stack first. This avoids the "pre-filter" and makes "rare" stacks more likely.

We could even switch between the two approaches within the same function body.

cc @alexcrichton @cfallin @jameysharp

@fitzgen fitzgen added the wasm-smith Related to the wasm-smith crate and creating wasm modules for fuzzing label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasm-smith Related to the wasm-smith crate and creating wasm modules for fuzzing
Projects
None yet
Development

No branches or pull requests

1 participant