← index #17357Issue #15551
Off-topic · high · value 1.604
QUERY · 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

CANDIDATE · ISSUE

RV32 native emitter fails compiling some of the tests

closedby dpgeorgeopened 2024-07-26updated 2024-08-19
bug

Port, board and/or hardware

Any RISC-V 32 architecture

MicroPython version

Current master version (commit 6007f3e2062cc65fc8416f241c682e37eb956c11)

Reproduction

Using an ESP32C3 board, run the test suite using the following:

$ cd tests
$ ./run-tests.py --target esp32 --device /dev/ttyUSB0 --via-mpy --emit native --mpy-cross-flags="-march=rv32imc" -d basics

The output is:

518 tests performed (16146 individual testcases)
488 tests passed
18 tests skipped: annotate_var builtin_next_arg2 builtin_range_binop del_deref del_local exception_chain gen_yield_from_close memoryview_itemsize namedtuple_asdict nanbox_smallint scope_implicit subclass_native_call sys_path sys_tracebacklimit try_finally_return2 try_reraise try_reraise2 unboundlocal
30 tests failed: array1 array_construct array_construct_endian array_intbig builtin_property class_ordereddict class_super dict1 dict_fixed errno1 frozenset_binop fun_calldblstar3 gc1 ifcond int1 logic_constfolding memoryview_intbig namedtuple1 set_binop stopiteration string_format_modulo string_format_modulo_int struct1 struct1_intbig struct2 struct_micropython sys_getsizeof true_value try_finally_return unpack1

The test failures are due to mpy-cross crashing:

mpy-cross: ../py/asmbase.c:94: mp_asm_base_label_assign: Assertion `as->label_offsets[label] == as->code_offset' failed.

Alternatively, a much simpler way to see the problem:

$ ./mpy-cross/build/mpy-cross -march=rv32imc -X emit=native tests/basics/array1.py 
mpy-cross: ../py/asmbase.c:94: mp_asm_base_label_assign: Assertion `as->label_offsets[label] == as->code_offset' failed.

Expected behaviour

mpy-cross should be able to compile all the tests with the rv32imc emitter selected.

Observed behaviour

mpy-cross crashes with an assertion failure.

Additional Information

No response

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