← index #5908Issue #17357
Related · high · value 2.249
QUERY · ISSUE

esp32: float/*_special tests fail

openby tveopened 2020-04-11updated 2020-04-13
port-esp32

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)
>
CANDIDATE · ISSUE

esp32: `misc/rge_sm.py` test fails with hardware floating point enabled.

openby agattiopened 2025-05-25updated 2025-05-25
bug

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

  1. Build the current master (49f81d5046aaeb31f90626426363ae2518dbd810) ESP32 port with hard floating point support enabled (force MICROPY_OBJ_REPR set to MICROPY_OBJ_REPR_C and MICROPY_FLOAT_IMPL set to MICROPY_FLOAT_IMPL_FLOAT)
  2. Flash the firmware on the board and run the test suite
  3. misc/rge_sm test 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:

misc_rge_sm.py.out.txt

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

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied