diff options
author | Alon Zakai <alonzakai@gmail.com> | 2019-04-03 10:48:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 10:48:11 -0700 |
commit | 29d638f9d298a9448996bcd3f50a9d51b7d200d9 (patch) | |
tree | ac8daf62ae700c09a204861b90e5fe79d2fa30f8 /scripts/fuzz_opt.py | |
parent | 91704fbae74fa7c89a017764eaa5ff03eda5ec0d (diff) | |
parent | 5a72c0433d9a984ea217e82ac2690faccd688916 (diff) | |
download | binaryen-29d638f9d298a9448996bcd3f50a9d51b7d200d9.tar.gz binaryen-29d638f9d298a9448996bcd3f50a9d51b7d200d9.tar.bz2 binaryen-29d638f9d298a9448996bcd3f50a9d51b7d200d9.zip |
Fuzz more carefully when using nans (#1956)
They are nondeterministic between VMs, so disable VM comparisons in that case.
Diffstat (limited to 'scripts/fuzz_opt.py')
-rw-r--r-- | scripts/fuzz_opt.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 58751a72e..d3d2ea6e2 100644 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -26,8 +26,9 @@ from test.shared import options # parameters +NANS = True -FUZZ_OPTS = ['--mvp-features'] # may want to add '--no-fuzz-nans' for cross-VM testing +FUZZ_OPTS = ['--mvp-features'] INPUT_SIZE_LIMIT = 250 * 1024 @@ -134,9 +135,11 @@ def run_vms(prefix): if len(results) == 0: results = [0] - first = results[0] - for i in range(len(results)): - compare(first, results[i], 'comparing between vms at ' + str(i)) + # NaNs are a source of nondeterminism between VMs; don't compare them + if not NANS: + first = results[0] + for i in range(len(results)): + compare(first, results[i], 'comparing between vms at ' + str(i)) return results @@ -241,6 +244,9 @@ def get_multiple_opt_choices(): # main +if not NANS: + FUZZ_OPTS += ['--no-fuzz-nans'] + if __name__ == '__main__': print('checking infinite random inputs') random.seed(time.time() * os.getpid()) |