From e64d968aa491b45910c8b14583a14a841f50d502 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 4 Aug 2026 10:20:54 -0700 Subject: [PATCH 1/5] fix --- scripts/fuzz_opt.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index a36282c17fc..74f6db25568 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -2048,10 +2048,11 @@ def handle(self, wasm): compare(output, optimized_output, 'Two-Opt') # If we can, also test in V8. We also cannot compare if there are NaNs - # (as optimizations can lead to different outputs), and we must - # disallow some features. + # or relaxed SIMD (as binaryen optimizations can lead to different + # outputs from V8), and we must disallow features that don't even work + # in V8. # TODO: relax some of these - if NANS or not all_disallowed(DISALLOWED_FEATURES_IN_V8): + if NANS or all_disallowed(['relaxed-simd']) or not all_disallowed(DISALLOWED_FEATURES_IN_V8): return output = run_d8_wasm(wasm, args=[second_wasm]) From 9012854bee09563c09c70884c03889fd4664beda Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 4 Aug 2026 10:53:38 -0700 Subject: [PATCH 2/5] fix --- src/ir/features.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ir/features.h b/src/ir/features.h index 315e275d65a..42e4c9ee8ed 100644 --- a/src/ir/features.h +++ b/src/ir/features.h @@ -173,7 +173,8 @@ inline FeatureSet get(BinaryOp op) { case RelaxedMinVecF64x2: case RelaxedMaxVecF64x2: case RelaxedSwizzleVecI8x16: - case RelaxedQ15MulrSVecI16x8: { + case RelaxedQ15MulrSVecI16x8: + case RelaxedDotI8x16I7x16SToVecI16x8: { ret.setSIMD(); ret.setRelaxedSIMD(); break; From a2e312d2d3fcd453f6a73c75c0bc81cce2b140cb Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 4 Aug 2026 10:56:13 -0700 Subject: [PATCH 3/5] fix --- scripts/fuzz_opt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 74f6db25568..a6c379093e5 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -2052,7 +2052,7 @@ def handle(self, wasm): # outputs from V8), and we must disallow features that don't even work # in V8. # TODO: relax some of these - if NANS or all_disallowed(['relaxed-simd']) or not all_disallowed(DISALLOWED_FEATURES_IN_V8): + if NANS or not all_disallowed(['relaxed-simd']) or not all_disallowed(DISALLOWED_FEATURES_IN_V8): return output = run_d8_wasm(wasm, args=[second_wasm]) From 27d3e510763ce797f0102d428c57714faee9cae1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 4 Aug 2026 13:26:31 -0700 Subject: [PATCH 4/5] another --- scripts/fuzz_opt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index a6c379093e5..eaa40783268 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -864,9 +864,9 @@ def can_run(self, wasm): @override def can_compare_to_self(self): - # With nans, VM differences can confuse us, so only very simple VMs - # can compare to themselves after opts in that case. - return not NANS + # With nans or relaxed SIMD, VM differences can confuse us, so only very + # simple VMs can compare to themselves after binaryen opts in that case. + return not NANS and all_disallowed(['relaxed-simd']) @override def can_compare_to_other(self, other): From adaa24bad2f8ebe6f01a3bb8fc28cea87d181e51 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 4 Aug 2026 15:32:04 -0700 Subject: [PATCH 5/5] clarify comment --- scripts/fuzz_opt.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index eaa40783268..7261691761d 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -864,8 +864,10 @@ def can_run(self, wasm): @override def can_compare_to_self(self): - # With nans or relaxed SIMD, VM differences can confuse us, so only very - # simple VMs can compare to themselves after binaryen opts in that case. + # With nans or relaxed SIMD, VM differences can confuse us, including + # differences between binaryen and V8 (binaryen's behavior can get + # "baked" into the wasm when it precomputes code, so we cannot compare + # V8's output before binaryen opts and after binaryen opts). return not NANS and all_disallowed(['relaxed-simd']) @override