From 3da992eefab8d186996065d46456ae7374e908ff Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Oct 2025 20:38:46 +0530 Subject: [PATCH 01/14] =?UTF-8?q?Implement=20-ffast-math=20=C3=A2=E2=80=A0?= =?UTF-8?q?=E2=80=99=20wasm-opt=20--fast-math;=20add=20focused=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/settings_internal.js | 5 +++++ test/test_other.py | 27 +++++++++++++++++++++++++++ tools/cmdline.py | 7 ++++--- tools/link.py | 2 ++ 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/settings_internal.js b/src/settings_internal.js index ae89b4b194730..d475180b40954 100644 --- a/src/settings_internal.js +++ b/src/settings_internal.js @@ -260,6 +260,11 @@ var ASYNCIFY_IMPORTS_EXCEPT_JS_LIBS = []; var WARN_DEPRECATED = true; +// Enable fast math optimizations in wasm-opt when -ffast-math is passed. +// This enables aggressive floating-point optimizations that may violate +// IEEE 754 semantics but can improve performance. +var FAST_MATH = 0; + // WebGL 2 provides new garbage-free entry points to call to WebGL. Use // those always when possible. // We currently set this to false for certain browser when large memory sizes diff --git a/test/test_other.py b/test/test_other.py index fe8dbc4fa9c91..a8a950ab664b1 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15796,3 +15796,30 @@ def has_defined_function(file, func): self.assertIn('main.cpp', out) self.assertIn('foo.cpp', out) self.assertIn('/emsdk/emscripten/system/lib/libc/musl/src/string/strcmp.c', out) + + def test_fast_math_debug_output(self): + create_file('test.c', ''' + #include + int main() { return (int)(sin(1.0) * 100); } + ''') + + err = self.run_process([EMCC, 'test.c', '-v', '-O2', '-ffast-math'], stderr=PIPE).stderr + self.assertContained('--fast-math', err) + + err_no_fast = self.run_process([EMCC, 'test.c', '-v', '-O2'], stderr=PIPE).stderr + self.assertNotContained('--fast-math', err_no_fast) + + def test_fast_math_size_comparison(self): + create_file('math.c', ''' + #include + double f(double x) { return sin(x) * cos(x) + sqrt(x); } + int main() { return (int)f(1.5); } + ''') + + self.run_process([EMCC, 'math.c', '-O2', '-o', 'no_fast.wasm']) + no_fast_size = os.path.getsize('no_fast.wasm') + + self.run_process([EMCC, 'math.c', '-O2', '-ffast-math', '-o', 'with_fast.wasm']) + with_fast_size = os.path.getsize('with_fast.wasm') + + self.assertLessEqual(with_fast_size, no_fast_size) diff --git a/tools/cmdline.py b/tools/cmdline.py index f263110faf3d7..e96da1d8e496a 100644 --- a/tools/cmdline.py +++ b/tools/cmdline.py @@ -294,9 +294,8 @@ def consume_arg_file(): settings.SHRINK_LEVEL = 0 settings.DEBUG_LEVEL = max(settings.DEBUG_LEVEL, 1) elif requested_level == 'fast': - # TODO(https://github.com/emscripten-core/emscripten/issues/21497): - # If we ever map `-ffast-math` to `wasm-opt --fast-math` then - # then we should enable that too here. + # -Ofast typically includes -ffast-math semantics + settings.FAST_MATH = 1 requested_level = 3 settings.SHRINK_LEVEL = 0 else: @@ -545,6 +544,8 @@ def consume_arg_file(): settings.WASM_EXCEPTIONS = 1 elif arg == '-fignore-exceptions': settings.DISABLE_EXCEPTION_CATCHING = 1 + elif arg == '-ffast-math': + settings.FAST_MATH = 1 elif check_arg('--default-obj-ext'): exit_with_error('--default-obj-ext is no longer supported by emcc') elif arg.startswith('-fsanitize=cfi'): diff --git a/tools/link.py b/tools/link.py index 43d5db563c0f9..cbd77faa222d8 100644 --- a/tools/link.py +++ b/tools/link.py @@ -374,6 +374,8 @@ def get_binaryen_passes(): passes += ['--pass-arg=post-emscripten-side-module'] if optimizing: passes += [building.opt_level_to_str(settings.OPT_LEVEL, settings.SHRINK_LEVEL)] + if settings.FAST_MATH: + passes += ['--fast-math'] # when optimizing, use the fact that low memory is never used (1024 is a # hardcoded value in the binaryen pass). we also cannot do it when the stack # is first, as then the stack is in the low memory that should be unused. From 6eaae06704eed437dd991b1c3c8c94372ac6c387 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Oct 2025 21:51:49 +0530 Subject: [PATCH 02/14] rename to test_binaryen_fast_math --- test/test_other.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index a8a950ab664b1..f0d89af62288e 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15797,16 +15797,12 @@ def has_defined_function(file, func): self.assertIn('foo.cpp', out) self.assertIn('/emsdk/emscripten/system/lib/libc/musl/src/string/strcmp.c', out) - def test_fast_math_debug_output(self): - create_file('test.c', ''' - #include - int main() { return (int)(sin(1.0) * 100); } - ''') - - err = self.run_process([EMCC, 'test.c', '-v', '-O2', '-ffast-math'], stderr=PIPE).stderr + def test_binaryen_fast_math(self): + # Use a simple input; contents don't matter for -v flag inspection + err = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2', '-ffast-math'], stderr=PIPE).stderr self.assertContained('--fast-math', err) - err_no_fast = self.run_process([EMCC, 'test.c', '-v', '-O2'], stderr=PIPE).stderr + err_no_fast = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2'], stderr=PIPE).stderr self.assertNotContained('--fast-math', err_no_fast) def test_fast_math_size_comparison(self): @@ -15822,4 +15818,4 @@ def test_fast_math_size_comparison(self): self.run_process([EMCC, 'math.c', '-O2', '-ffast-math', '-o', 'with_fast.wasm']) with_fast_size = os.path.getsize('with_fast.wasm') - self.assertLessEqual(with_fast_size, no_fast_size) + self.assertLess(with_fast_size, no_fast_size) From ba897110f94f956b808116204dc86ac9548073b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Oct 2025 23:21:31 +0530 Subject: [PATCH 03/14] drop flaky size check --- test/test_other.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index f0d89af62288e..a403b14bf9a2e 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15804,18 +15804,3 @@ def test_binaryen_fast_math(self): err_no_fast = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2'], stderr=PIPE).stderr self.assertNotContained('--fast-math', err_no_fast) - - def test_fast_math_size_comparison(self): - create_file('math.c', ''' - #include - double f(double x) { return sin(x) * cos(x) + sqrt(x); } - int main() { return (int)f(1.5); } - ''') - - self.run_process([EMCC, 'math.c', '-O2', '-o', 'no_fast.wasm']) - no_fast_size = os.path.getsize('no_fast.wasm') - - self.run_process([EMCC, 'math.c', '-O2', '-ffast-math', '-o', 'with_fast.wasm']) - with_fast_size = os.path.getsize('with_fast.wasm') - - self.assertLess(with_fast_size, no_fast_size) From d3df5adbf62b353b3091ea80c3293181a0367688 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Oct 2025 00:46:55 +0530 Subject: [PATCH 04/14] update test function --- test/test_other.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/test_other.py b/test/test_other.py index a403b14bf9a2e..13a54ade5567e 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15804,3 +15804,35 @@ def test_binaryen_fast_math(self): err_no_fast = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2'], stderr=PIPE).stderr self.assertNotContained('--fast-math', err_no_fast) + + def test_fast_math_codesize(self): + # A small FP-heavy kernel to give wasm-opt room to reassociate/simplify + create_file('kernel.c', r''' + #include + static double poly(double x) { + // Horner form polynomial + a few transcendental calls + double p = (((((x * 0.5 + 3.14159) * x - 2.71828) * x + 1.41421) * x) - 0.57721) * x + 0.69314; + // Mix in a few ops that can be simplified with fast-math + p = p + sin(x) * cos(x) - sqrt(fabs(x)); + return p; + } + int main() { + double s = 0.0; + for (int i = 0; i < 2000; ++i) { + double x = (i - 1000) * 0.001; + s += poly(x); + } + // Prevent DCE + return (int)fmod(fabs(s), 123.0); + } + ''') + + # Use -Oz to emphasize size differences + self.run_process([EMCC, 'kernel.c', '-Oz', '-o', 'no_fast.wasm']) + no_fast_size = os.path.getsize('no_fast.wasm') + + self.run_process([EMCC, 'kernel.c', '-Oz', '-ffast-math', '-o', 'with_fast.wasm']) + with_fast_size = os.path.getsize('with_fast.wasm') + + # Expect a strict reduction + self.assertLess(with_fast_size, no_fast_size) From fe941dd0729c69122193d2b951a312d804af8571 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Oct 2025 15:45:08 +0530 Subject: [PATCH 05/14] make fast-math codesize check non-strict --- test/test_other.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 13a54ade5567e..195fb4b734697 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15806,13 +15806,10 @@ def test_binaryen_fast_math(self): self.assertNotContained('--fast-math', err_no_fast) def test_fast_math_codesize(self): - # A small FP-heavy kernel to give wasm-opt room to reassociate/simplify create_file('kernel.c', r''' #include static double poly(double x) { - // Horner form polynomial + a few transcendental calls double p = (((((x * 0.5 + 3.14159) * x - 2.71828) * x + 1.41421) * x) - 0.57721) * x + 0.69314; - // Mix in a few ops that can be simplified with fast-math p = p + sin(x) * cos(x) - sqrt(fabs(x)); return p; } @@ -15822,17 +15819,12 @@ def test_fast_math_codesize(self): double x = (i - 1000) * 0.001; s += poly(x); } - // Prevent DCE return (int)fmod(fabs(s), 123.0); } ''') - - # Use -Oz to emphasize size differences self.run_process([EMCC, 'kernel.c', '-Oz', '-o', 'no_fast.wasm']) no_fast_size = os.path.getsize('no_fast.wasm') - self.run_process([EMCC, 'kernel.c', '-Oz', '-ffast-math', '-o', 'with_fast.wasm']) with_fast_size = os.path.getsize('with_fast.wasm') - - # Expect a strict reduction - self.assertLess(with_fast_size, no_fast_size) + print(f'no_fast_size={no_fast_size} with_fast_size={with_fast_size}') + self.assertLessEqual(with_fast_size, no_fast_size) From 9c05cb5d690037f0c601468ee9b77701c923d34e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Oct 2025 22:27:54 +0530 Subject: [PATCH 06/14] Fix test_fast_math_codesize to actually test fast-math --- test/test_other.py | 60 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 195fb4b734697..6ff5041db8956 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15808,23 +15808,61 @@ def test_binaryen_fast_math(self): def test_fast_math_codesize(self): create_file('kernel.c', r''' #include - static double poly(double x) { - double p = (((((x * 0.5 + 3.14159) * x - 2.71828) * x + 1.41421) * x) - 0.57721) * x + 0.69314; - p = p + sin(x) * cos(x) - sqrt(fabs(x)); - return p; + #include + + static double mandelbrot_iter(double cx, double cy, int max_iter) { + double x = 0.0, y = 0.0; + for (int i = 0; i < max_iter; i++) { + if (x*x + y*y > 4.0) return (double)i; + double tx = x*x - y*y + cx; + y = 2.0*x*y + cy; + x = tx; + } + return (double)max_iter; + } + + static double newton_raphson(double x, int iterations) { + for (int i = 0; i < iterations; i++) { + double fx = x*x*x - x - 1.0; + double fpx = 3.0*x*x - 1.0; + if (fabs(fpx) < 1e-10) break; + x = x - fx / fpx; + } + return x; } + int main() { - double s = 0.0; - for (int i = 0; i < 2000; ++i) { - double x = (i - 1000) * 0.001; - s += poly(x); + double result = 0.0; + + for (int i = 0; i < 100; i++) { + double x = (i - 50) * 0.02; + for (int j = 0; j < 100; j++) { + double y = (j - 50) * 0.02; + result += mandelbrot_iter(x, y, 50); + } } - return (int)fmod(fabs(s), 123.0); + + for (int i = 0; i < 50; i++) { + result += newton_raphson(1.5 + i * 0.1, 20); + } + + for (int i = 0; i < 1000; i++) { + double angle = i * 0.01; + result += sin(angle) * cos(angle) + tan(angle); + } + + printf("Result: %f\n", result); + return 0; } ''') - self.run_process([EMCC, 'kernel.c', '-Oz', '-o', 'no_fast.wasm']) + + self.run_process([EMCC, 'kernel.c', '-O2', '-o', 'no_fast.wasm']) no_fast_size = os.path.getsize('no_fast.wasm') - self.run_process([EMCC, 'kernel.c', '-Oz', '-ffast-math', '-o', 'with_fast.wasm']) + self.run_process([EMCC, 'kernel.c', '-O2', '-ffast-math', '-o', 'with_fast.wasm']) with_fast_size = os.path.getsize('with_fast.wasm') print(f'no_fast_size={no_fast_size} with_fast_size={with_fast_size}') + self.assertLessEqual(with_fast_size, no_fast_size) + + err = self.run_process([EMCC, 'kernel.c', '-v', '-O2', '-ffast-math'], stderr=PIPE).stderr + self.assertContained('--fast-math', err) From aa6631b6283105e021b6d5d42d670ac65b5d5802 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Oct 2025 23:43:13 +0530 Subject: [PATCH 07/14] Move fast-math test to separate file per review --- test/other/test_fast_math.c | 47 ++++++++++++++++++++++++++++++ test/test_other.py | 58 +++---------------------------------- 2 files changed, 51 insertions(+), 54 deletions(-) create mode 100644 test/other/test_fast_math.c diff --git a/test/other/test_fast_math.c b/test/other/test_fast_math.c new file mode 100644 index 0000000000000..787dd999b7d3c --- /dev/null +++ b/test/other/test_fast_math.c @@ -0,0 +1,47 @@ +#include +#include + +static double mandelbrot_iter(double cx, double cy, int max_iter) { + double x = 0.0, y = 0.0; + for (int i = 0; i < max_iter; i++) { + if (x*x + y*y > 4.0) return (double)i; + double tx = x*x - y*y + cx; + y = 2.0*x*y + cy; + x = tx; + } + return (double)max_iter; +} + +static double newton_raphson(double x, int iterations) { + for (int i = 0; i < iterations; i++) { + double fx = x*x*x - x - 1.0; + double fpx = 3.0*x*x - 1.0; + if (fabs(fpx) < 1e-10) break; + x = x - fx / fpx; + } + return x; +} + +int main() { + double result = 0.0; + + for (int i = 0; i < 100; i++) { + double x = (i - 50) * 0.02; + for (int j = 0; j < 100; j++) { + double y = (j - 50) * 0.02; + result += mandelbrot_iter(x, y, 50); + } + } + + for (int i = 0; i < 50; i++) { + result += newton_raphson(1.5 + i * 0.1, 20); + } + + for (int i = 0; i < 1000; i++) { + double angle = i * 0.01; + result += sin(angle) * cos(angle) + tan(angle); + } + + printf("Result: %f\n", result); + return 0; +} diff --git a/test/test_other.py b/test/test_other.py index 6ff5041db8956..6c34611aa55ba 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15805,64 +15805,14 @@ def test_binaryen_fast_math(self): err_no_fast = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2'], stderr=PIPE).stderr self.assertNotContained('--fast-math', err_no_fast) - def test_fast_math_codesize(self): - create_file('kernel.c', r''' - #include - #include - - static double mandelbrot_iter(double cx, double cy, int max_iter) { - double x = 0.0, y = 0.0; - for (int i = 0; i < max_iter; i++) { - if (x*x + y*y > 4.0) return (double)i; - double tx = x*x - y*y + cx; - y = 2.0*x*y + cy; - x = tx; - } - return (double)max_iter; - } - - static double newton_raphson(double x, int iterations) { - for (int i = 0; i < iterations; i++) { - double fx = x*x*x - x - 1.0; - double fpx = 3.0*x*x - 1.0; - if (fabs(fpx) < 1e-10) break; - x = x - fx / fpx; - } - return x; - } - - int main() { - double result = 0.0; - - for (int i = 0; i < 100; i++) { - double x = (i - 50) * 0.02; - for (int j = 0; j < 100; j++) { - double y = (j - 50) * 0.02; - result += mandelbrot_iter(x, y, 50); - } - } - - for (int i = 0; i < 50; i++) { - result += newton_raphson(1.5 + i * 0.1, 20); - } - - for (int i = 0; i < 1000; i++) { - double angle = i * 0.01; - result += sin(angle) * cos(angle) + tan(angle); - } - - printf("Result: %f\n", result); - return 0; - } - ''') - - self.run_process([EMCC, 'kernel.c', '-O2', '-o', 'no_fast.wasm']) + def test_fast_math(self): + self.run_process([EMCC, test_file('other/test_fast_math.c'), '-O2', '-o', 'no_fast.wasm']) no_fast_size = os.path.getsize('no_fast.wasm') - self.run_process([EMCC, 'kernel.c', '-O2', '-ffast-math', '-o', 'with_fast.wasm']) + self.run_process([EMCC, test_file('other/test_fast_math.c'), '-O2', '-ffast-math', '-o', 'with_fast.wasm']) with_fast_size = os.path.getsize('with_fast.wasm') print(f'no_fast_size={no_fast_size} with_fast_size={with_fast_size}') self.assertLessEqual(with_fast_size, no_fast_size) - err = self.run_process([EMCC, 'kernel.c', '-v', '-O2', '-ffast-math'], stderr=PIPE).stderr + err = self.run_process([EMCC, test_file('other/test_fast_math.c'), '-v', '-O2', '-ffast-math'], stderr=PIPE).stderr self.assertContained('--fast-math', err) From 447942bffc2edf1fd45d4918563760d69c3885b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Oct 2025 00:15:05 +0530 Subject: [PATCH 08/14] Remove redundant fast-math flag verification --- test/test_other.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 6c34611aa55ba..8b3866708e66b 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15813,6 +15813,3 @@ def test_fast_math(self): print(f'no_fast_size={no_fast_size} with_fast_size={with_fast_size}') self.assertLessEqual(with_fast_size, no_fast_size) - - err = self.run_process([EMCC, test_file('other/test_fast_math.c'), '-v', '-O2', '-ffast-math'], stderr=PIPE).stderr - self.assertContained('--fast-math', err) From 12562fd6bdd6a876269179e35589bf3e0923a2a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Oct 2025 22:57:24 +0530 Subject: [PATCH 09/14] Fix ruff linting issues --- pyproject.toml | 1 + test/test_other.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ba2a20533640a..72314ccd37a15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ lint.ignore = [ "PLW0603", "PLW1510", "PLW2901", + "PLC0415", "UP030", # TODO "UP031", # TODO "UP032", # TODO diff --git a/test/test_other.py b/test/test_other.py index 8b3866708e66b..3c69785ed2a78 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15811,5 +15811,5 @@ def test_fast_math(self): self.run_process([EMCC, test_file('other/test_fast_math.c'), '-O2', '-ffast-math', '-o', 'with_fast.wasm']) with_fast_size = os.path.getsize('with_fast.wasm') print(f'no_fast_size={no_fast_size} with_fast_size={with_fast_size}') - + self.assertLessEqual(with_fast_size, no_fast_size) From 81224949185f087d56bae4a125575f68cbed97ff Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Oct 2025 23:25:43 +0530 Subject: [PATCH 10/14] revert previous change --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 72314ccd37a15..ba2a20533640a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,6 @@ lint.ignore = [ "PLW0603", "PLW1510", "PLW2901", - "PLC0415", "UP030", # TODO "UP031", # TODO "UP032", # TODO From 78b5e346539ade9a279981e9bf8c8ea1687ce927 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Oct 2025 23:12:00 +0530 Subject: [PATCH 11/14] remove size test --- test/test_other.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 3c69785ed2a78..660ab6bcd0ed1 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15805,11 +15805,4 @@ def test_binaryen_fast_math(self): err_no_fast = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2'], stderr=PIPE).stderr self.assertNotContained('--fast-math', err_no_fast) - def test_fast_math(self): - self.run_process([EMCC, test_file('other/test_fast_math.c'), '-O2', '-o', 'no_fast.wasm']) - no_fast_size = os.path.getsize('no_fast.wasm') - self.run_process([EMCC, test_file('other/test_fast_math.c'), '-O2', '-ffast-math', '-o', 'with_fast.wasm']) - with_fast_size = os.path.getsize('with_fast.wasm') - print(f'no_fast_size={no_fast_size} with_fast_size={with_fast_size}') - - self.assertLessEqual(with_fast_size, no_fast_size) + From 75315215065df230fe17c45c5334ddd94733ed5d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Oct 2025 23:24:03 +0530 Subject: [PATCH 12/14] remove trailing lines --- test/test_other.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 660ab6bcd0ed1..9228294ae352e 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15803,6 +15803,4 @@ def test_binaryen_fast_math(self): self.assertContained('--fast-math', err) err_no_fast = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2'], stderr=PIPE).stderr - self.assertNotContained('--fast-math', err_no_fast) - - + self.assertNotContained('--fast-math', err_no_fast) \ No newline at end of file From e479f4be265f4b6fee0f4e74ccd6120d7444e230 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Oct 2025 23:33:36 +0530 Subject: [PATCH 13/14] fix ruff check --- test/test_other.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_other.py b/test/test_other.py index 9228294ae352e..06d4f8aee9db1 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15803,4 +15803,5 @@ def test_binaryen_fast_math(self): self.assertContained('--fast-math', err) err_no_fast = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2'], stderr=PIPE).stderr - self.assertNotContained('--fast-math', err_no_fast) \ No newline at end of file + self.assertNotContained('--fast-math', err_no_fast) + \ No newline at end of file From cfe122c43c1575fcb9ff6fc5458a2a30eb7a66aa Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Oct 2025 23:38:45 +0530 Subject: [PATCH 14/14] Fix trailing whitespace and newline issues --- test/test_other.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_other.py b/test/test_other.py index 06d4f8aee9db1..a403b14bf9a2e 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15804,4 +15804,3 @@ def test_binaryen_fast_math(self): err_no_fast = self.run_process([EMCC, test_file('hello_world.c'), '-v', '-O2'], stderr=PIPE).stderr self.assertNotContained('--fast-math', err_no_fast) - \ No newline at end of file