Skip to content

[NFC] Move more logic about unfuzzable tests to a shared location #7175

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

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions scripts/fuzz_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ def is_git_repo():

all_tests = shared.get_all_tests()

INITIAL_CONTENTS_IGNORE = fuzzing.unfuzzable_tests


def pick_initial_contents():
# if we use an initial wasm file's contents as the basis for the
Expand All @@ -334,25 +332,9 @@ def pick_initial_contents():
# no longer exist, and we should just skip it.
if not os.path.exists(test_name):
return
if os.path.basename(test_name) in INITIAL_CONTENTS_IGNORE:
if not fuzzing.is_fuzzable(test_name):
return
assert os.path.exists(test_name)
# tests that check validation errors are not helpful for us
if '.fail.' in test_name:
print('initial contents is just a .fail test')
return
if os.path.basename(test_name) in [
# contains too many segments to run in a wasm VM
'limit-segments_disable-bulk-memory.wast',
# https://github.com/WebAssembly/binaryen/issues/3203
'simd.wast',
# corner cases of escaping of names is not interesting
'names.wast',
# huge amount of locals that make it extremely slow
'too_much_for_liveness.wasm'
]:
print('initial contents is disallowed')
return

if test_name.endswith('.wast'):
# this can contain multiple modules, pick one
Expand Down
20 changes: 19 additions & 1 deletion scripts/test/fuzzing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os


# Tests that the fuzzers should not operate on.
unfuzzable_tests = [
unfuzzable = [
# Float16 is still experimental.
'f16.wast',
# not all relaxed SIMD instructions are implemented in the interpreter
Expand Down Expand Up @@ -73,4 +75,20 @@
'typed_continuations_contnew.wast',
'typed_continuations_contbind.wast',
'typed_continuations_suspend.wast',
# contains too many segments to run in a wasm VM
'limit-segments_disable-bulk-memory.wast',
# https://github.com/WebAssembly/binaryen/issues/7176
'names.wast',
# huge amount of locals that make it extremely slow
'too_much_for_liveness.wasm',
]


def is_fuzzable(name):
name = os.path.basename(name)

# It makes no sense to fuzz things that check validation errors.
if '.fail.' in name:
return False

return name not in unfuzzable
Loading