Skip to content

feat(post): what a contract check costs on a microcontroller (13 Dec) - #314

Merged
filipsajdak merged 3 commits into
mainfrom
feat/post-contracts-on-a-microcontroller
Nov 29, 2026
Merged

filipsajdak merged 3 commits into
mainfrom
feat/post-contracts-on-a-microcontroller

Conversation

@filipsajdak

Copy link
Copy Markdown
Contributor

13 Dec 16:00Z: what a C++26 contract check costs on a microcontroller with GCC 16.2 (a 20 B record and a 16 B source_location in RAM per check under enforce; quick_enforce stores none but links the exception runtime through std::terminate unless terminate maps to abort).

lvgl26 before (03496b8) and after (3a23a478) on a Cortex-M4 in QEMU, against the same screen in plain LVGL C:

before after plain C
flash, shipped slice 283,724 247,000 244,472
gap to C +39,252 +2,528
contract checks 22,784 flash, 4,032 RAM 364 flash, 0 RAM
flash per label + arc 188.3 B 68.3 B 57.3 B

Source: RESULTS.md in examples PR #109 (merges first). The lvgl26 disclosure line and status line are in the post.

Commits

  1. feat(post) 2. chore(schedule) 13 Dec 16:00Z double 3. feat(social)

Verification

Merge waits for the owner's go (deadline 12 Dec 20:00Z).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ju4yEXENcZNaSNEQWEri2X

filipsajdak and others added 3 commits November 29, 2026 17:37
A short for 13 December from the lvgl26 size findings: with GCC 16.2
and enforce each check keeps a 36-byte record in RAM and its full
function name in flash; a check in a template gets one per
instantiation; quick_enforce links the exception run-time through
std::terminate unless it is mapped to abort. Three ARM GCC 16.2
assembly views and a local link table back the numbers.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ju4yEXENcZNaSNEQWEri2X
The day's 08:00Z slot holds the RAII ffmpeg post.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ju4yEXENcZNaSNEQWEri2X
…cts-on-a-microcontroller post

Card headline: A contract check in GCC 16.2 takes 36 bytes of RAM.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ju4yEXENcZNaSNEQWEri2X
@filipsajdak
filipsajdak force-pushed the feat/post-contracts-on-a-microcontroller branch from b5a4712 to 6c450db Compare November 29, 2026 16:37
@filipsajdak
filipsajdak merged commit efa7b7a into main Nov 29, 2026
2 checks passed
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