esp32: `misc/rge_sm.py` test fails with hardware floating point enabled.
Port, board and/or hardware
generic esp32 board with ESP32_GENERIC
MicroPython version
MicroPython v1.26.0-preview.148.g49f81d504.dirty on 2025-05-25; Generic ESP32 module with ESP32
Reproduction
- Build the current
master(49f81d5046aaeb31f90626426363ae2518dbd810) ESP32 port with hard floating point support enabled (forceMICROPY_OBJ_REPRset toMICROPY_OBJ_REPR_CandMICROPY_FLOAT_IMPLset toMICROPY_FLOAT_IMPL_FLOAT) - Flash the firmware on the board and run the test suite
misc/rge_smtest will fail.
Expected behaviour
tests/misc/rge_sm.py should not fail with hard floating point support enabled.
Observed behaviour
The test output is attached:
Additional Information
Maybe the test should be rewritten using unittest.assertAlmostEqual to perform the value comparisons instead of relying on rounding behaviour.
I'm aware I'm trying out an uncommon object representation for the target in question, but I wonder if other MCUs with hardware floating point also exhibit the same test failure since the test relies on how float rounding is performed to pass.
Code of Conduct
Yes, I agree
esp32: float/*_special tests fail
The following two tests fail on the esp32: float/cmath_fun_special.py and float/math_domain_special.py:
> ./run-tests --device /dev/ttyUSB0 --target esp32 float/cmath_fun_special.py float/math_domain_special.py
FAIL float/cmath_fun_special.py
FAIL float/math_domain_special.py
2 tests performed (105 individual testcases)
0 tests passed
2 tests failed: cmath_fun_special math_domain_special
> ./run-tests --print-failures
FAILURE float_math_domain_special.py
--- float_math_domain_special.py.exp 2020-04-11 09:47:24.921644291 -0700
+++ float_math_domain_special.py.out 2020-04-11 09:47:24.921644291 -0700
@@ -45,7 +45,7 @@
gamma ValueError
1.0000
inf
-gamma ValueError
+inf
nan
lgamma ValueError
lgamma ValueError
FAILURE float_cmath_fun_special.py
--- float_cmath_fun_special.py.exp 2020-04-11 09:47:24.621649221 -0700
+++ float_cmath_fun_special.py.out 2020-04-11 09:47:24.621649221 -0700
@@ -7,10 +7,10 @@
complex(1, -0.68219)
complex(-0.30103, 0)
complex(-0.30103, 1.3644)
-complex(-0.15051, 0.34109)
-complex(-0.15051, 1.0233)
-complex(-0.15051, -0.34109)
-complex(-0.15051, -1.0233)
+complex(-0.15052, 0.34109)
+complex(-0.15052, 1.0233)
+complex(-0.15052, -0.34109)
+complex(-0.15052, -1.0233)
complex(0.12448, 0.51506)
complex(0.12448, 0.84932)
complex(0.12448, -0.51506)
>