Skip to content

Port runtime options, footprint baseline, and app guidance from mrubyc-zephyr - #12

Merged
uist1idrju3i merged 7 commits into
mainfrom
devin/1795445292-zephyr-parity
Nov 24, 2026
Merged

uist1idrju3i merged 7 commits into
mainfrom
devin/1795445292-zephyr-parity

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Brings the applicable parts of OpenBlink/mrubyc-zephyr#11, #12, and #13 to the ESP-IDF component. The component stays on mruby/c release3.4.1, mruby 3.4.0 mrbc (RITE0300), and Registry version 3.4.1. vendor/mrubyc, the existing examples, the existing defaults, and upload.yml are unchanged.

  • Runtime options (from ci: verify compiled sources and example bytecode against upstream #11): Kconfig and CMakeLists.txt cover every mruby/c 3.4.1 configuration macro. Every option uses the upstream default, and macros that upstream treats as "undefined = off" are never passed as =0. Settings that change public struct layout (string width, NaN boxing, INT64, legacy macros, alloc profiling) are PUBLIC definitions, so consumers see the same layout. Allocator tuning is PRIVATE.
    • Added selectable: alloc profiling, linear symbol search, exception nest level, task name length, KV initial size and growth, MRBC_NO_STDIO, MRBC_DEBUG_REGS, disabling legacy value macros, MRBC_STRING_SIZE_T (16/32 bits), MRBC_ALLOC_FLI_BIT_WIDTH / SLI_BIT_WIDTH / IGNORE_LSBS / MIN_MEMORY_BLOCK_SIZE (validated by allocator_config.c at build time), and MRBC_NAN_BOXING (not with INT64; forces legacy value macros off).
    • Read-only symbols show fixed values: on for USE_STRING, ALLOC_24BIT, LITTLE_ENDIAN, REQUIRE_64BIT_ALIGNMENT; off for FLOAT_NONE, INT16, ALLOC_VMID, ALLOC_16BIT, BIG_ENDIAN, REQUIRE_32BIT_ALIGNMENT. USE_STRING=0, INT16, and ALLOC_VMID fail to build with unmodified 3.4.1 and stay read-only.
    • With 32-bit strings, exception messages are still limited to 65,535 bytes by upstream (documented).
  • Fatal hooks, opt-in and OFF by default: fatal_hooks.c and fatal_hooks.h are force-included only into component sources when enabled.
    • OOM_POOL_STATS prints pool total/used/free before hal_abort (pool allocator only).
    • PANIC_ON_UNHANDLED_EXCEPTION aborts on an exception that reaches mrbc_vm_end. Permanent Task.create VMs do not trigger it.
  • Footprint (from Port runtime options, footprint baseline, and app guidance from mrubyc-zephyr #12): test_app/footprint/ is a C baseline with the same output as hello. Measured on ESP32 / ESP-IDF 6.1.1, the total image size is 112,720 bytes for C and 185,457 bytes for Ruby hello. The Zephyr numbers are not reused.
  • Guidance (from #13): application design notes in README.md (bytecode, pool, cooperative scheduling, C bindings, task lifetime) and in .devin/wiki.json. Only behavior verified on 3.4.1 is documented. No new doc files are added.
  • Packaging: .devin/ is excluded from the Registry archive and tools/check_package.py enforces this. The archive has 98 files.
  • Tests: new test_app profiles (parity, nan_boxing, oom_*, exception_*), with QEMU checks of the expected markers and the abort for each fatal path.

Local verification: test_app profiles build on IDF 5.5.6, 6.0.3, and 6.1.1. The QEMU fixtures pass. The vendor and bytecode checks, actionlint, zizmor, and ShellCheck pass. Not tested on hardware.

Link to Devin session: https://app.devin.ai/sessions/e98b4d5e1c444f2eb2952ea1f63111e1
Open in Devin Desktop: https://app.devin.ai/desktop/session/e98b4d5e1c444f2eb2952ea1f63111e1?variant=devin
Requested by: @uist1idrju3i


🟢 Devin fixed all 2 findings · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 3 commits November 23, 2026 14:59
Co-Authored-By: Yoshihiro Yamashiro <me@xn--uist1idrju3i.jp>
Co-Authored-By: Yoshihiro Yamashiro <me@xn--uist1idrju3i.jp>
Co-Authored-By: Yoshihiro Yamashiro <me@xn--uist1idrju3i.jp>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Yoshihiro Yamashiro <me@xn--uist1idrju3i.jp>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 findings. Devin automatically fixed all 2 findings.

Fixed by Devin (2)
  • Legacy macros misread boxed floats — NaN boxing now forces the legacy value macros off (Kconfig), README corrected, and the test app asserts it.
  • Long exception messages leak memory — The 16-bit exception length is in unmodified upstream 3.4.1 code. Kconfig help and README now document the 65535-byte exception message limit for 32-bit strings.

View findings in Devin Review · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 3 commits November 23, 2026 22:47
Co-Authored-By: Yoshihiro Yamashiro <me@xn--uist1idrju3i.jp>
Co-Authored-By: Yoshihiro Yamashiro <me@xn--uist1idrju3i.jp>
Co-Authored-By: Yoshihiro Yamashiro <me@xn--uist1idrju3i.jp>

@uist1idrju3i uist1idrju3i left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@uist1idrju3i
uist1idrju3i merged commit 3793bf4 into main Nov 24, 2026
13 checks passed
@uist1idrju3i
uist1idrju3i deleted the devin/1795445292-zephyr-parity branch November 24, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant