You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(Suspected) regression in bytecode dump handling routines #4341
I'd like again to attention to particular commits of #4265 , specifically "tools/mpy-tools.py: Fix opcode size enumeration and constant definition." and "py/bc.c: Fix opcode size enumeration.", current links:
What those commits show is that, allegedly, routines for decoding bytecode (as used for example by -v -v flags) have a bug/weren't updated after MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE was introduced, and tools/mpy-tool.py even has incorrect values for some bytecodes.
This is pretty serious regression, which, if true, may seriously confuse anyone trying to use MicroPython in advanced way, e.g. to look into optimizations.
Note that I didn't try to verify those findings (apparently, it's maintainer's job), hence modals sprinkled around the text.
Thanks for bringing this up. But it's not technically a regression because caching in the bytecode was added first, then frozen bytecode, then support for frozen bytecode with caching.
Just for the record, to understand what could be affected, the timeline is:
Jan 2016: frozen .mpy files (not supporting caching) 0699c6b
Jan 2017: support for caching in frozen bytecode 98458a4
It's unlikely that any embedded targets use bytecode caching and frozen bytecode because in such a case the frozen bytecode must be stored in RAM, which really limits its usefulness.
I stand corrected, and I used all those modals here because I indeed didn't try to investigate it myself (and don't remember all those details by now). All things bytecode are otherwise rather underused in MicroPython, some people show interest in knowing more about it, and having such issues could puzzle them a lot on their learning curve. Thanks for looking into this!
Activity
pfalcon commentedon Dec 10, 2018
dpgeorge commentedon Dec 10, 2018
Thanks for bringing this up. But it's not technically a regression because caching in the bytecode was added first, then frozen bytecode, then support for frozen bytecode with caching.
Just for the record, to understand what could be affected, the timeline is:
It's unlikely that any embedded targets use bytecode caching and frozen bytecode because in such a case the frozen bytecode must be stored in RAM, which really limits its usefulness.
pfalcon commentedon Dec 11, 2018
I stand corrected, and I used all those modals here because I indeed didn't try to investigate it myself (and don't remember all those details by now). All things bytecode are otherwise rather underused in MicroPython, some people show interest in knowing more about it, and having such issues could puzzle them a lot on their learning curve. Thanks for looking into this!
dpgeorge commentedon Dec 12, 2018
Fixed by above-linked PR.