Skip to content

use Owi to check for equivalence of the fuzzer-generated programs #7420

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
47 changes: 36 additions & 11 deletions scripts/fuzz_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1806,22 +1806,47 @@ def get_relevant_lines(wat):

compare(get_relevant_lines(original), get_relevant_lines(processed), 'Preserve')

class Owi(TestCaseHandler):
frequency = 1

def can_run_on_wasm(self, wasm):
if JSPI:
return False
return all_disallowed(['exception-handling', 'simd', 'threads', 'gc', 'multimemory', 'memory64', 'custom-descriptors', 'shared-everything'])

def handle_pair(self, input, before_wasm, after_wasm, opts):
completed_process = subprocess.run(["owi", "iso", before_wasm, after_wasm, "--fail-on-assertion-only"])
code = completed_process.returncode

# 20: incompatible import type due to log-i64 being unreliable
if code == 20:
return True
# illegal opcode, needs to be investigated
elif code == 30:
return True
# unknown import, needs to be fixed in Owi (table-get and table-set)
elif code == 45:
return True
else:
print("found a bug: return code of Owi was: ", code)
return code == 0

# The global list of all test case handlers
testcase_handlers = [
FuzzExec(),
CompareVMs(),
CheckDeterminism(),
Wasm2JS(),
TrapsNeverHappen(),
CtorEval(),
Merge(),
#FuzzExec(),
#CompareVMs(),
#CheckDeterminism(),
#Wasm2JS(),
#TrapsNeverHappen(),
#CtorEval(),
#Merge(),
# TODO: enable when stable enough, and adjust |frequency| (see above)
# Split(),
RoundtripText(),
ClusterFuzz(),
Two(),
PreserveImportsExports(),
#RoundtripText(),
#ClusterFuzz(),
#Two(),
#PreserveImportsExports(),
Owi(),
]


Expand Down