@@ -864,9 +864,11 @@ def can_run(self, wasm):
864864
865865 @override
866866 def can_compare_to_self (self ):
867- # With nans, VM differences can confuse us, so only very simple VMs
868- # can compare to themselves after opts in that case.
869- return not NANS
867+ # With nans or relaxed SIMD, VM differences can confuse us, including
868+ # differences between binaryen and V8 (binaryen's behavior can get
869+ # "baked" into the wasm when it precomputes code, so we cannot compare
870+ # V8's output before binaryen opts and after binaryen opts).
871+ return not NANS and all_disallowed (['relaxed-simd' ])
870872
871873 @override
872874 def can_compare_to_other (self , other ):
@@ -2048,10 +2050,11 @@ def handle(self, wasm):
20482050 compare (output , optimized_output , 'Two-Opt' )
20492051
20502052 # If we can, also test in V8. We also cannot compare if there are NaNs
2051- # (as optimizations can lead to different outputs), and we must
2052- # disallow some features.
2053+ # or relaxed SIMD (as binaryen optimizations can lead to different
2054+ # outputs from V8), and we must disallow features that don't even work
2055+ # in V8.
20532056 # TODO: relax some of these
2054- if NANS or not all_disallowed (DISALLOWED_FEATURES_IN_V8 ):
2057+ if NANS or not all_disallowed ([ 'relaxed-simd' ]) or not all_disallowed ( DISALLOWED_FEATURES_IN_V8 ):
20552058 return
20562059
20572060 output = run_d8_wasm (wasm , args = [second_wasm ])
0 commit comments