diff --git a/public/og/contracts-on-a-microcontroller.png b/public/og/contracts-on-a-microcontroller.png new file mode 100644 index 00000000..565ced06 Binary files /dev/null and b/public/og/contracts-on-a-microcontroller.png differ diff --git a/scripts/schedule_doubles.py b/scripts/schedule_doubles.py index 8534a496..6fb2de15 100644 --- a/scripts/schedule_doubles.py +++ b/scripts/schedule_doubles.py @@ -245,6 +245,8 @@ # beside the tidy-agent episode of the day. "2026-12-07": {"slug": "cpp-safety-state-of-the-union-december-2026", "hour": 16, "why": "December safety roundup, beside the tidy-agent episode"}, + "2026-12-13": {"slug": "contracts-on-a-microcontroller", "hour": 16, + "why": "lvgl26 size finding on contracts, beside the RAII ffmpeg post"}, } diff --git a/social/facebook/contracts-on-a-microcontroller/README.md b/social/facebook/contracts-on-a-microcontroller/README.md new file mode 100644 index 00000000..85dc2af2 --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/README.md @@ -0,0 +1,130 @@ +# LinkedIn Square Post (1200x1200) + +Standard LinkedIn feed post at 1:1 square aspect ratio. Works well as a scroll-stopping image in the LinkedIn feed. + +## Usage + +```bash +brand-gen init social/linkedin-post my-post +cd my-post +# edit content.md +brand-gen build # -> index.html +brand-gen image # -> my-post.png (2400x2400 at 2x DPR) +``` + +## Directives + +All templates use one of four post types. Each uses the same directive pattern: + +### Quote + +```markdown +::::post{type=quote theme=dark logo=top-left} + +:::quote{author="Filip Sajdak" role="Founder & CEO, ScudoAI"} + +Sovereign AI is not a feature you bolt on later. It is the architecture. + +::: + +:::: +``` + +### Stat + +```markdown +::::post{type=stat theme=light accent=brand} + +:::stat{value="USD 80B" label="Worldwide sovereign cloud spend" context="Europe is the fastest-growing region at 83% YoY." source="Gartner, Feb 2026"} +::: + +:::: +``` + +### Announcement + +```markdown +::::post{type=announcement theme=light} + +:::announcement{kind="launch" date="April 2026"} + +# ScudoAI joins NVIDIA Inception + +We are thrilled to join the NVIDIA Inception program to accelerate sovereign AI deployment across European regulated industries. + +::: + +:::: +``` + +### Insight + +```markdown +::::post{type=insight theme=dark} + +:::insight{citation="EU AI Act full enforcement: 2 August 2026"} + +# The AI compliance deadline most companies are missing + +Full EU AI Act enforcement for high-risk AI systems begins in 2 August 2026. Most regulated enterprises are not ready for the documentation and audit requirements. Teams running cloud AI will face the hardest transition. + +::: + +:::: +``` + +## Attributes reference + +### `::::post` attributes + +- `type` - quote | stat | announcement | insight (required) +- `theme` - dark | light (default light) +- `accent` - brand | amber | nv (optional colored gradient background) +- `logo` - top-left | top-right | bottom-left | bottom-right (default bottom-right) + +### `:::quote` attributes + +- `author` - attribution name (appears below the quote) +- `role` - attribution role/title (appears under the author) + +### `:::stat` attributes + +- `value` - the big number (e.g. "USD 80B", "3/4", "Hours to minutes") +- `label` - short label under the value +- `context` - 1-2 sentences providing context +- `source` - small citation + +### `:::announcement` attributes + +- `kind` - launch | milestone | event | hire | partnership +- `date` - free-form date string + +### `:::insight` attributes + +- `citation` - small footer citation (e.g. regulation reference) + +## Character limits + +- **Quote body**: ~120 characters for maximum readability at thumbnail size +- **Stat label**: ~40 characters +- **Stat context**: ~200 characters +- **Announcement headline**: ~80 characters +- **Announcement body**: ~250 characters +- **Insight hook**: ~100 characters +- **Insight body**: ~300 characters + +Posts that exceed these limits will still render but typography may shrink or content may clip. + +## Media + +Add a `media/` directory to the project and reference local files: + +```markdown +:::background{image="nvidia-thor.jpg" overlay="dark"} +::: + +:::image{src="product-screenshot.png" alt="ScudoAI compliance dashboard" position="top"} +::: +``` + +Paths are relative to the project's `media/` directory. diff --git a/social/facebook/contracts-on-a-microcontroller/assets/brand-kit.json b/social/facebook/contracts-on-a-microcontroller/assets/brand-kit.json new file mode 100644 index 00000000..ad9976ca --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/assets/brand-kit.json @@ -0,0 +1,11 @@ +{ + "template": "social/linkedin-post", + "bundleSource": "scudoai-social.css", + "brandKitVersion": "0.1.0", + "vendoredAt": "2026-11-29T14:03:08.479Z", + "files": [ + "scudoai.css", + "layout.css", + "logo-symbol.svg" + ] +} diff --git a/social/facebook/contracts-on-a-microcontroller/assets/layout.css b/social/facebook/contracts-on-a-microcontroller/assets/layout.css new file mode 100644 index 00000000..e69de29b diff --git a/social/facebook/contracts-on-a-microcontroller/assets/logo-symbol.svg b/social/facebook/contracts-on-a-microcontroller/assets/logo-symbol.svg new file mode 100644 index 00000000..1fc44966 --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/assets/logo-symbol.svg @@ -0,0 +1,22 @@ + diff --git a/social/facebook/contracts-on-a-microcontroller/assets/scudoai.css b/social/facebook/contracts-on-a-microcontroller/assets/scudoai.css new file mode 100644 index 00000000..612b5a12 --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/assets/scudoai.css @@ -0,0 +1,343 @@ +/* ============================================================ + * wro.cpp social card -- standalone stylesheet + * + * Self-contained styling for brand-gen's `social/linkedin-post` + * output. Replaces (does NOT extend) the scudoai-social.css that + * brand-gen ships with -- the design language here is the + * wro.cpp 'Editorial Magnet' look used by src/styles/global.css, + * not the scudoai blue-indigo deck aesthetic. + * + * Source of truth for tokens: src/styles/global.css:12-30 in the + * wrocpp.github.io repo. + * + * Brand-gen markup we style: + *
+ *
(decorative, hidden) + *
(decorative, hidden) + *
+ *

...

+ *

...

+ *
...
+ *
+ *
+ * + * ScudoAI (hidden; replaced via ::after) + *
+ *
+ * + * Other card types (card-quote, card-stat, card-announcement) + * get analogous rules at the bottom. + * ============================================================ */ + +@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500;700&display=swap'); + +:root { + --paper: #FCFAF5; + --paper-2: #F3EFE6; + --paper-3: #E8E1D0; + --ink: #1B1B1D; + --ink-muted:#55555A; + --ink-faint:#8A8A90; + --rule: #D7D2C4; + --orange: #EA541E; + --orange-2: #D6481A; + --blue: #3EB5E9; + --blue-deep:#2E8FB8; + + --font-display: 'Quicksand', system-ui, -apple-system, sans-serif; + --font-body: 'Source Serif 4', Georgia, serif; + --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; +} + +html, body { + margin: 0; + padding: 0; + background: var(--paper); + color: var(--ink); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-family: var(--font-body); + font-size: 18px; + line-height: 1.6; +} + +/* Hide brand-gen decorative noise -- the wro.cpp aesthetic is calm + * and editorial, not a dark deck with glow + grid backgrounds. */ +.grid-bg, .glow { display: none !important; } + +/* ---------------- Card frame (1200x1200) ---------------- */ +.card { + position: relative; + width: 1200px; + height: 1200px; + background: var(--paper); + /* Faint warm radial wash, mirrors body { background-image } in + * src/styles/global.css:44-49 -- gives the paper texture without + * looking flat. */ + background-image: + radial-gradient(900px 700px at 80% -10%, rgba(234, 84, 30, 0.06), transparent 60%), + radial-gradient(800px 600px at -10% 110%, rgba(62, 181, 233, 0.05), transparent 60%); + overflow: hidden; + box-sizing: border-box; + padding: 130px 110px 130px 110px; + display: flex; + flex-direction: column; + /* Faint inner border gives the card a printed-page feel. */ + border-bottom: 6px solid var(--orange); +} + +/* Override: theme=dark cards still use paper. We keep the editorial + * light look across the board so the wro.cpp brand stays consistent. + * If the user really wants a dark variant later, this is the hook. */ +.card.dark { background: var(--paper) !important; color: var(--ink) !important; } +.card.dark h1, .card.dark h2, .card.dark p, +.card.dark blockquote { color: var(--ink) !important; } + +/* ---------------- INSIGHT card ---------------- */ +.card-insight { + justify-content: center; + padding-top: 200px; /* reserve space for logo watermark (top:90px + 64px + safety) */ +} +.card-insight .insight-content { + display: flex; + flex-direction: column; + gap: 60px; + max-width: 980px; +} +.card-insight h1 { + font-family: var(--font-display); + font-weight: 700; + font-size: 92pt; + line-height: 1.02; + letter-spacing: -0.025em; + color: var(--ink); + margin: 0; +} +.card-insight h1.title-long { + font-size: 72pt; + line-height: 1.06; + letter-spacing: -0.02em; + max-height: 420px; +} +.card-insight h1.title-xlong { + font-size: 56pt; + line-height: 1.10; + letter-spacing: -0.015em; + max-height: 440px; +} +/* Auto-accent: ++ in C++/C++26 turns orange, sentence-final period + * (when wrapped in ) turns blue. The skill writes + * the heading with these spans for the wro.cpp signature look. */ +.card-insight h1 .accent { color: var(--orange); } +.card-insight h1 .dot { color: var(--blue-deep); } +.card-insight p { + font-family: var(--font-body); + font-size: 30pt; + line-height: 1.5; + color: var(--ink-muted); + margin: 0; + max-width: 920px; +} +.card-insight .insight-citation { + font-family: var(--font-mono); + font-size: 18pt; + letter-spacing: 0.04em; + color: var(--ink-faint); + margin-top: 40px; + padding-top: 30px; + border-top: 1px solid var(--rule); + text-transform: lowercase; +} +.card-insight .insight-citation::before { + content: '// '; + color: var(--orange); + font-weight: 700; +} + +/* ---------------- QUOTE card ---------------- */ +.card-quote { justify-content: center; padding: 140px 110px; } +.card-quote .quote-content { display: flex; flex-direction: column; align-items: flex-start; } +.card-quote .quote-mark { + font-family: var(--font-display); + font-weight: 700; + font-size: 200pt; + line-height: 0.8; + color: var(--orange); + opacity: 0.20; + /* In-flow above the text (not floated in the corner) with a negative + * bottom margin so the mark nearly touches the first quote line. */ + margin: 0 0 -0.62em; +} +.card-quote .quote-body { + font-family: var(--font-display); + font-weight: 600; + font-size: 64pt; + line-height: 1.15; + letter-spacing: -0.02em; + color: var(--ink); + max-width: 980px; + margin: 0; +} +.card-quote .quote-attribution { + margin-top: 50px; + font-family: var(--font-mono); + font-size: 18pt; + color: var(--ink-muted); +} +.card-quote .quote-attribution::before { content: '-- '; color: var(--orange); } +/* author and role are adjacent spans with no separator in the markup; + * add one so they do not run together ("wro.cppC++26 ..."). */ +.card-quote .quote-attribution .role::before { content: ' / '; color: var(--ink-faint); } + +/* ---------------- STAT card ---------------- */ +.card-stat { justify-content: center; } +/* Value and label sit side by side (label wraps to stacked lines whose + * combined height roughly matches the value); context + source span the + * full width underneath. */ +.card-stat .stat-content { + display: grid; + grid-template-columns: auto 1fr; + grid-template-areas: + "value label" + "context context" + "source source"; + column-gap: 64px; + align-items: center; +} +.card-stat .stat-value { + grid-area: value; + font-family: var(--font-display); + font-weight: 700; + font-size: 240pt; + line-height: 0.82; + letter-spacing: -0.04em; + color: var(--orange); + margin: 0; +} +.card-stat .stat-label { + grid-area: label; + font-family: var(--font-display); + font-weight: 700; + font-size: 90pt; + line-height: 1.0; + letter-spacing: -0.02em; + color: var(--ink); + /* min-content forces a per-word wrap, so "codegen steps" stacks into + * two lines next to the value instead of running on one long line. */ + width: min-content; + margin: 0; +} +.card-stat .stat-context { + grid-area: context; + font-family: var(--font-body); + font-size: 26pt; + line-height: 1.45; + color: var(--ink-muted); + margin: 56px 0 0; + max-width: 880px; +} +.card-stat .stat-source { + grid-area: source; + margin-top: 44px; + font-family: var(--font-mono); + font-size: 18pt; + color: var(--ink-faint); +} +.card-stat .stat-source::before { content: '// '; color: var(--orange); } + +/* ---------------- ANNOUNCEMENT card ---------------- */ +.card-announcement { justify-content: center; } +.card-announcement .announcement-meta { + font-family: var(--font-mono); + font-size: 20pt; + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--orange); + margin-bottom: 30px; +} +.card-announcement .announcement-content h1, +.card-announcement .announcement-content h2 { + font-family: var(--font-display); + font-weight: 700; + font-size: 78pt; + line-height: 1.05; + letter-spacing: -0.02em; + color: var(--ink); + margin: 0; +} +.card-announcement .announcement-content p { + font-family: var(--font-body); + font-size: 28pt; + line-height: 1.5; + color: var(--ink-muted); + margin: 40px 0 0; + max-width: 900px; +} + +/* ---------------- LOGO WATERMARK ---------------- */ +/* brand-gen hard-codes "ScudoAI" in .logo-wordmark; we hide it and + * draw "wro.cpp" via ::after on the watermark. The orange ".cpp" mirrors + * the brand-mark in the site header. */ +.logo-watermark { + position: absolute; + display: flex; + align-items: center; + gap: 18px; + height: 64px; + z-index: 10; + color: var(--ink); +} +.logo-watermark.top-left { top: 90px; left: 110px; } +.logo-watermark.top-right { top: 90px; right: 110px; } +.logo-watermark.bottom-left { bottom: 60px; left: 110px; } +.logo-watermark.bottom-right { bottom: 60px; right: 110px; } +.logo-watermark svg { + width: 64px; + height: 64px; + flex-shrink: 0; + /* Magnet logo PNG already has transparent paper-tone background; + * no rounded box needed -- it sits on the paper card directly. */ +} +.logo-wordmark { + font-size: 0 !important; + line-height: 0 !important; + /* Hide the upstream "ScudoAI" text node entirely. */ +} +.logo-watermark::after { + content: 'wro.cpp'; + font-family: var(--font-display); + font-weight: 700; + font-size: 28pt; + letter-spacing: -0.025em; + color: var(--ink); + line-height: 1; + /* The .cpp portion is given orange via a ::first-line trick below + * isn't reliable for inline -- so the SKILL writes the wordmark + * with explicit spans when it owns the markup. For this default + * rendering, the whole wordmark is ink and the orange comes through + * the bottom border + eyebrow. */ +} +.logo-watermark.top-right::after, +.logo-watermark.bottom-right::after { order: -1; margin-right: 18px; } + +/* ---------------- AI DISCLOSURE BADGE ---------------- */ +/* A small, honest "AI-GENERATED" label so the disclosure rides with the + * card image on social. Bottom-right corner (logo is top-left, citation is + * center-bottom, so this corner is free). Injected into index.html by + * inject.sh. See the /ai policy page. */ +.ai-badge { + position: absolute; + bottom: 74px; /* clears the 6px orange accent bar; sits in the bottom padding band */ + right: 110px; /* matches the card side padding / logo inset */ + z-index: 10; + font-family: var(--font-mono); + font-size: 14pt; + font-weight: 500; + letter-spacing: 0.10em; + text-transform: uppercase; + color: var(--ink-faint); +} + +/* ---------------- Defensive overrides ---------------- */ +/* Anything brand-gen might have set inline using its tokens. */ +* { box-sizing: border-box; } diff --git a/social/facebook/contracts-on-a-microcontroller/caption.md b/social/facebook/contracts-on-a-microcontroller/caption.md new file mode 100644 index 00000000..280e4c63 --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/caption.md @@ -0,0 +1,16 @@ +# What a C++26 contract check costs on a microcontroller + +## Body +With GCC 16.2 and enforce, each C++26 contract check keeps a 36-byte record in RAM and its full function name in flash. In lvgl26's Cortex-M4 program, 112 checks cost 22,784 B of flash and 4,032 B of RAM. The post shows why a check in a template multiplies, why quick_enforce still links the exception run-time, and how the shipped build keeps the checks on for 364 B and no RAM. + +https://wrocpp.github.io/posts/contracts-on-a-microcontroller/ + +## Hashtags +#cpp #cpp26 #contracts #embedded #wrocpp + +## Alt-text +wro.cpp card with the magnet logo. Headline reads "A contract check in GCC 16.2 takes 36 bytes of RAM" with a subtitle about GCC 16.2 with enforce on a Cortex-M4, and quick_enforce with terminate mapped to abort keeping no record. Citation footer: wro.cpp, 2026-12-13. + +## Suggested post time +Sunday 2026-12-13, 16:00 UTC +Reason: the second slot of the day, beside the 08:00 UTC RAII ffmpeg post. diff --git a/social/facebook/contracts-on-a-microcontroller/config.yaml b/social/facebook/contracts-on-a-microcontroller/config.yaml new file mode 100644 index 00000000..15e210bb --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/config.yaml @@ -0,0 +1,12 @@ +template: social/linkedin-post + +size: + width: 1200 + height: 1200 + dpr: 2 + +project: + name: "contracts-on-a-microcontroller" + author: "Filip Sajdak, Founder & CEO" + email: "office@scudoai.com" + date: "2026-12-13" diff --git a/social/facebook/contracts-on-a-microcontroller/content.md b/social/facebook/contracts-on-a-microcontroller/content.md new file mode 100644 index 00000000..17d18b78 --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/content.md @@ -0,0 +1,12 @@ +--- +template: social/linkedin-post +--- + +::::post{type=insight theme=dark logo=top-left} + +:::insight{citation="wro.cpp -- 2026-12-13"} +# A contract check in GCC 16.2 takes 36 bytes of RAM +With the enforce semantic, on a Cortex-M4. quick_enforce, with terminate mapped to abort, keeps no record: 364 B of flash in lvgl26. +::: + +:::: diff --git a/social/facebook/contracts-on-a-microcontroller/image.png b/social/facebook/contracts-on-a-microcontroller/image.png new file mode 100644 index 00000000..04c06e38 Binary files /dev/null and b/social/facebook/contracts-on-a-microcontroller/image.png differ diff --git a/social/facebook/contracts-on-a-microcontroller/index.html b/social/facebook/contracts-on-a-microcontroller/index.html new file mode 100644 index 00000000..c9b0c724 --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/index.html @@ -0,0 +1,28 @@ + + + + + + contracts-on-a-microcontroller + + + + + + + + + + +

A contract check in GCC 16.2 takes 36 bytes of RAM

With the enforce semantic, on a Cortex-M4. quick_enforce, with terminate mapped to abort, keeps no record: 364 B of flash in lvgl26.

wro.cpp -- 2026-12-13
ScudoAI
AI-generated
+ + \ No newline at end of file diff --git a/social/facebook/contracts-on-a-microcontroller/media/.gitkeep b/social/facebook/contracts-on-a-microcontroller/media/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/social/facebook/contracts-on-a-microcontroller/media/README.md b/social/facebook/contracts-on-a-microcontroller/media/README.md new file mode 100644 index 00000000..bb81c7fa --- /dev/null +++ b/social/facebook/contracts-on-a-microcontroller/media/README.md @@ -0,0 +1,9 @@ +# Media directory + +Drop images here (PNG, JPG, SVG) for use in your post. + +Reference them in your content.md with: + + :::image{src="screenshot.png" alt="Alt text" position="top"} + +The renderer resolves paths relative to this media/ directory. diff --git a/social/linkedin/contracts-on-a-microcontroller/README.md b/social/linkedin/contracts-on-a-microcontroller/README.md new file mode 100644 index 00000000..85dc2af2 --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/README.md @@ -0,0 +1,130 @@ +# LinkedIn Square Post (1200x1200) + +Standard LinkedIn feed post at 1:1 square aspect ratio. Works well as a scroll-stopping image in the LinkedIn feed. + +## Usage + +```bash +brand-gen init social/linkedin-post my-post +cd my-post +# edit content.md +brand-gen build # -> index.html +brand-gen image # -> my-post.png (2400x2400 at 2x DPR) +``` + +## Directives + +All templates use one of four post types. Each uses the same directive pattern: + +### Quote + +```markdown +::::post{type=quote theme=dark logo=top-left} + +:::quote{author="Filip Sajdak" role="Founder & CEO, ScudoAI"} + +Sovereign AI is not a feature you bolt on later. It is the architecture. + +::: + +:::: +``` + +### Stat + +```markdown +::::post{type=stat theme=light accent=brand} + +:::stat{value="USD 80B" label="Worldwide sovereign cloud spend" context="Europe is the fastest-growing region at 83% YoY." source="Gartner, Feb 2026"} +::: + +:::: +``` + +### Announcement + +```markdown +::::post{type=announcement theme=light} + +:::announcement{kind="launch" date="April 2026"} + +# ScudoAI joins NVIDIA Inception + +We are thrilled to join the NVIDIA Inception program to accelerate sovereign AI deployment across European regulated industries. + +::: + +:::: +``` + +### Insight + +```markdown +::::post{type=insight theme=dark} + +:::insight{citation="EU AI Act full enforcement: 2 August 2026"} + +# The AI compliance deadline most companies are missing + +Full EU AI Act enforcement for high-risk AI systems begins in 2 August 2026. Most regulated enterprises are not ready for the documentation and audit requirements. Teams running cloud AI will face the hardest transition. + +::: + +:::: +``` + +## Attributes reference + +### `::::post` attributes + +- `type` - quote | stat | announcement | insight (required) +- `theme` - dark | light (default light) +- `accent` - brand | amber | nv (optional colored gradient background) +- `logo` - top-left | top-right | bottom-left | bottom-right (default bottom-right) + +### `:::quote` attributes + +- `author` - attribution name (appears below the quote) +- `role` - attribution role/title (appears under the author) + +### `:::stat` attributes + +- `value` - the big number (e.g. "USD 80B", "3/4", "Hours to minutes") +- `label` - short label under the value +- `context` - 1-2 sentences providing context +- `source` - small citation + +### `:::announcement` attributes + +- `kind` - launch | milestone | event | hire | partnership +- `date` - free-form date string + +### `:::insight` attributes + +- `citation` - small footer citation (e.g. regulation reference) + +## Character limits + +- **Quote body**: ~120 characters for maximum readability at thumbnail size +- **Stat label**: ~40 characters +- **Stat context**: ~200 characters +- **Announcement headline**: ~80 characters +- **Announcement body**: ~250 characters +- **Insight hook**: ~100 characters +- **Insight body**: ~300 characters + +Posts that exceed these limits will still render but typography may shrink or content may clip. + +## Media + +Add a `media/` directory to the project and reference local files: + +```markdown +:::background{image="nvidia-thor.jpg" overlay="dark"} +::: + +:::image{src="product-screenshot.png" alt="ScudoAI compliance dashboard" position="top"} +::: +``` + +Paths are relative to the project's `media/` directory. diff --git a/social/linkedin/contracts-on-a-microcontroller/assets/brand-kit.json b/social/linkedin/contracts-on-a-microcontroller/assets/brand-kit.json new file mode 100644 index 00000000..1ffbba68 --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/assets/brand-kit.json @@ -0,0 +1,11 @@ +{ + "template": "social/linkedin-post", + "bundleSource": "scudoai-social.css", + "brandKitVersion": "0.1.0", + "vendoredAt": "2026-11-29T14:03:08.332Z", + "files": [ + "scudoai.css", + "layout.css", + "logo-symbol.svg" + ] +} diff --git a/social/linkedin/contracts-on-a-microcontroller/assets/layout.css b/social/linkedin/contracts-on-a-microcontroller/assets/layout.css new file mode 100644 index 00000000..e69de29b diff --git a/social/linkedin/contracts-on-a-microcontroller/assets/logo-symbol.svg b/social/linkedin/contracts-on-a-microcontroller/assets/logo-symbol.svg new file mode 100644 index 00000000..1fc44966 --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/assets/logo-symbol.svg @@ -0,0 +1,22 @@ + diff --git a/social/linkedin/contracts-on-a-microcontroller/assets/scudoai.css b/social/linkedin/contracts-on-a-microcontroller/assets/scudoai.css new file mode 100644 index 00000000..612b5a12 --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/assets/scudoai.css @@ -0,0 +1,343 @@ +/* ============================================================ + * wro.cpp social card -- standalone stylesheet + * + * Self-contained styling for brand-gen's `social/linkedin-post` + * output. Replaces (does NOT extend) the scudoai-social.css that + * brand-gen ships with -- the design language here is the + * wro.cpp 'Editorial Magnet' look used by src/styles/global.css, + * not the scudoai blue-indigo deck aesthetic. + * + * Source of truth for tokens: src/styles/global.css:12-30 in the + * wrocpp.github.io repo. + * + * Brand-gen markup we style: + *
+ *
(decorative, hidden) + *
(decorative, hidden) + *
+ *

...

+ *

...

+ *
...
+ *
+ *
+ * + * ScudoAI (hidden; replaced via ::after) + *
+ *
+ * + * Other card types (card-quote, card-stat, card-announcement) + * get analogous rules at the bottom. + * ============================================================ */ + +@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500;700&display=swap'); + +:root { + --paper: #FCFAF5; + --paper-2: #F3EFE6; + --paper-3: #E8E1D0; + --ink: #1B1B1D; + --ink-muted:#55555A; + --ink-faint:#8A8A90; + --rule: #D7D2C4; + --orange: #EA541E; + --orange-2: #D6481A; + --blue: #3EB5E9; + --blue-deep:#2E8FB8; + + --font-display: 'Quicksand', system-ui, -apple-system, sans-serif; + --font-body: 'Source Serif 4', Georgia, serif; + --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; +} + +html, body { + margin: 0; + padding: 0; + background: var(--paper); + color: var(--ink); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-family: var(--font-body); + font-size: 18px; + line-height: 1.6; +} + +/* Hide brand-gen decorative noise -- the wro.cpp aesthetic is calm + * and editorial, not a dark deck with glow + grid backgrounds. */ +.grid-bg, .glow { display: none !important; } + +/* ---------------- Card frame (1200x1200) ---------------- */ +.card { + position: relative; + width: 1200px; + height: 1200px; + background: var(--paper); + /* Faint warm radial wash, mirrors body { background-image } in + * src/styles/global.css:44-49 -- gives the paper texture without + * looking flat. */ + background-image: + radial-gradient(900px 700px at 80% -10%, rgba(234, 84, 30, 0.06), transparent 60%), + radial-gradient(800px 600px at -10% 110%, rgba(62, 181, 233, 0.05), transparent 60%); + overflow: hidden; + box-sizing: border-box; + padding: 130px 110px 130px 110px; + display: flex; + flex-direction: column; + /* Faint inner border gives the card a printed-page feel. */ + border-bottom: 6px solid var(--orange); +} + +/* Override: theme=dark cards still use paper. We keep the editorial + * light look across the board so the wro.cpp brand stays consistent. + * If the user really wants a dark variant later, this is the hook. */ +.card.dark { background: var(--paper) !important; color: var(--ink) !important; } +.card.dark h1, .card.dark h2, .card.dark p, +.card.dark blockquote { color: var(--ink) !important; } + +/* ---------------- INSIGHT card ---------------- */ +.card-insight { + justify-content: center; + padding-top: 200px; /* reserve space for logo watermark (top:90px + 64px + safety) */ +} +.card-insight .insight-content { + display: flex; + flex-direction: column; + gap: 60px; + max-width: 980px; +} +.card-insight h1 { + font-family: var(--font-display); + font-weight: 700; + font-size: 92pt; + line-height: 1.02; + letter-spacing: -0.025em; + color: var(--ink); + margin: 0; +} +.card-insight h1.title-long { + font-size: 72pt; + line-height: 1.06; + letter-spacing: -0.02em; + max-height: 420px; +} +.card-insight h1.title-xlong { + font-size: 56pt; + line-height: 1.10; + letter-spacing: -0.015em; + max-height: 440px; +} +/* Auto-accent: ++ in C++/C++26 turns orange, sentence-final period + * (when wrapped in ) turns blue. The skill writes + * the heading with these spans for the wro.cpp signature look. */ +.card-insight h1 .accent { color: var(--orange); } +.card-insight h1 .dot { color: var(--blue-deep); } +.card-insight p { + font-family: var(--font-body); + font-size: 30pt; + line-height: 1.5; + color: var(--ink-muted); + margin: 0; + max-width: 920px; +} +.card-insight .insight-citation { + font-family: var(--font-mono); + font-size: 18pt; + letter-spacing: 0.04em; + color: var(--ink-faint); + margin-top: 40px; + padding-top: 30px; + border-top: 1px solid var(--rule); + text-transform: lowercase; +} +.card-insight .insight-citation::before { + content: '// '; + color: var(--orange); + font-weight: 700; +} + +/* ---------------- QUOTE card ---------------- */ +.card-quote { justify-content: center; padding: 140px 110px; } +.card-quote .quote-content { display: flex; flex-direction: column; align-items: flex-start; } +.card-quote .quote-mark { + font-family: var(--font-display); + font-weight: 700; + font-size: 200pt; + line-height: 0.8; + color: var(--orange); + opacity: 0.20; + /* In-flow above the text (not floated in the corner) with a negative + * bottom margin so the mark nearly touches the first quote line. */ + margin: 0 0 -0.62em; +} +.card-quote .quote-body { + font-family: var(--font-display); + font-weight: 600; + font-size: 64pt; + line-height: 1.15; + letter-spacing: -0.02em; + color: var(--ink); + max-width: 980px; + margin: 0; +} +.card-quote .quote-attribution { + margin-top: 50px; + font-family: var(--font-mono); + font-size: 18pt; + color: var(--ink-muted); +} +.card-quote .quote-attribution::before { content: '-- '; color: var(--orange); } +/* author and role are adjacent spans with no separator in the markup; + * add one so they do not run together ("wro.cppC++26 ..."). */ +.card-quote .quote-attribution .role::before { content: ' / '; color: var(--ink-faint); } + +/* ---------------- STAT card ---------------- */ +.card-stat { justify-content: center; } +/* Value and label sit side by side (label wraps to stacked lines whose + * combined height roughly matches the value); context + source span the + * full width underneath. */ +.card-stat .stat-content { + display: grid; + grid-template-columns: auto 1fr; + grid-template-areas: + "value label" + "context context" + "source source"; + column-gap: 64px; + align-items: center; +} +.card-stat .stat-value { + grid-area: value; + font-family: var(--font-display); + font-weight: 700; + font-size: 240pt; + line-height: 0.82; + letter-spacing: -0.04em; + color: var(--orange); + margin: 0; +} +.card-stat .stat-label { + grid-area: label; + font-family: var(--font-display); + font-weight: 700; + font-size: 90pt; + line-height: 1.0; + letter-spacing: -0.02em; + color: var(--ink); + /* min-content forces a per-word wrap, so "codegen steps" stacks into + * two lines next to the value instead of running on one long line. */ + width: min-content; + margin: 0; +} +.card-stat .stat-context { + grid-area: context; + font-family: var(--font-body); + font-size: 26pt; + line-height: 1.45; + color: var(--ink-muted); + margin: 56px 0 0; + max-width: 880px; +} +.card-stat .stat-source { + grid-area: source; + margin-top: 44px; + font-family: var(--font-mono); + font-size: 18pt; + color: var(--ink-faint); +} +.card-stat .stat-source::before { content: '// '; color: var(--orange); } + +/* ---------------- ANNOUNCEMENT card ---------------- */ +.card-announcement { justify-content: center; } +.card-announcement .announcement-meta { + font-family: var(--font-mono); + font-size: 20pt; + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--orange); + margin-bottom: 30px; +} +.card-announcement .announcement-content h1, +.card-announcement .announcement-content h2 { + font-family: var(--font-display); + font-weight: 700; + font-size: 78pt; + line-height: 1.05; + letter-spacing: -0.02em; + color: var(--ink); + margin: 0; +} +.card-announcement .announcement-content p { + font-family: var(--font-body); + font-size: 28pt; + line-height: 1.5; + color: var(--ink-muted); + margin: 40px 0 0; + max-width: 900px; +} + +/* ---------------- LOGO WATERMARK ---------------- */ +/* brand-gen hard-codes "ScudoAI" in .logo-wordmark; we hide it and + * draw "wro.cpp" via ::after on the watermark. The orange ".cpp" mirrors + * the brand-mark in the site header. */ +.logo-watermark { + position: absolute; + display: flex; + align-items: center; + gap: 18px; + height: 64px; + z-index: 10; + color: var(--ink); +} +.logo-watermark.top-left { top: 90px; left: 110px; } +.logo-watermark.top-right { top: 90px; right: 110px; } +.logo-watermark.bottom-left { bottom: 60px; left: 110px; } +.logo-watermark.bottom-right { bottom: 60px; right: 110px; } +.logo-watermark svg { + width: 64px; + height: 64px; + flex-shrink: 0; + /* Magnet logo PNG already has transparent paper-tone background; + * no rounded box needed -- it sits on the paper card directly. */ +} +.logo-wordmark { + font-size: 0 !important; + line-height: 0 !important; + /* Hide the upstream "ScudoAI" text node entirely. */ +} +.logo-watermark::after { + content: 'wro.cpp'; + font-family: var(--font-display); + font-weight: 700; + font-size: 28pt; + letter-spacing: -0.025em; + color: var(--ink); + line-height: 1; + /* The .cpp portion is given orange via a ::first-line trick below + * isn't reliable for inline -- so the SKILL writes the wordmark + * with explicit spans when it owns the markup. For this default + * rendering, the whole wordmark is ink and the orange comes through + * the bottom border + eyebrow. */ +} +.logo-watermark.top-right::after, +.logo-watermark.bottom-right::after { order: -1; margin-right: 18px; } + +/* ---------------- AI DISCLOSURE BADGE ---------------- */ +/* A small, honest "AI-GENERATED" label so the disclosure rides with the + * card image on social. Bottom-right corner (logo is top-left, citation is + * center-bottom, so this corner is free). Injected into index.html by + * inject.sh. See the /ai policy page. */ +.ai-badge { + position: absolute; + bottom: 74px; /* clears the 6px orange accent bar; sits in the bottom padding band */ + right: 110px; /* matches the card side padding / logo inset */ + z-index: 10; + font-family: var(--font-mono); + font-size: 14pt; + font-weight: 500; + letter-spacing: 0.10em; + text-transform: uppercase; + color: var(--ink-faint); +} + +/* ---------------- Defensive overrides ---------------- */ +/* Anything brand-gen might have set inline using its tokens. */ +* { box-sizing: border-box; } diff --git a/social/linkedin/contracts-on-a-microcontroller/caption.md b/social/linkedin/contracts-on-a-microcontroller/caption.md new file mode 100644 index 00000000..bd374fea --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/caption.md @@ -0,0 +1,22 @@ +# What a C++26 contract check costs on a microcontroller + +## Body +With GCC 16.2 and the default enforce semantic, every contract check keeps a 20-byte violation record and a 16-byte source location in .data. On a microcontroller that is RAM. The record points at the full function name, template arguments included, which sits in flash. + +In the Cortex-M4 test program of lvgl26, 112 checks cost 22,784 B of flash and 4,032 B of RAM. 98 of those records came from one function template, because a check in a template gets a record for each instantiation. Moving the check into a plain function leaves one. + +quick_enforce keeps no record, but its call of std::terminate links libstdc++'s exception run-time (about 10 KB) even under -fno-exceptions. A linker defsym that maps std::terminate to newlib's abort removes it. That is outside the standard, so it belongs in a bare-metal toolchain file. After the fixes the checks stay on for 364 B of flash and no RAM. + +The post has three assembly views on Compiler Explorer (ARM GCC 16.2) and a local link table. lvgl26 is my own project. + +https://wrocpp.github.io/posts/contracts-on-a-microcontroller/ + +## Hashtags +#cpp #cpp26 #contracts #embedded #gcc #wrocpp + +## Alt-text +wro.cpp card with the magnet logo. Headline reads "A contract check in GCC 16.2 takes 36 bytes of RAM" with a subtitle about GCC 16.2 with enforce on a Cortex-M4, and quick_enforce with terminate mapped to abort keeping no record. Citation footer: wro.cpp, 2026-12-13. + +## Suggested post time +Sunday 2026-12-13, 16:00 UTC +Reason: the second slot of the day, beside the 08:00 UTC RAII ffmpeg post. diff --git a/social/linkedin/contracts-on-a-microcontroller/config.yaml b/social/linkedin/contracts-on-a-microcontroller/config.yaml new file mode 100644 index 00000000..15e210bb --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/config.yaml @@ -0,0 +1,12 @@ +template: social/linkedin-post + +size: + width: 1200 + height: 1200 + dpr: 2 + +project: + name: "contracts-on-a-microcontroller" + author: "Filip Sajdak, Founder & CEO" + email: "office@scudoai.com" + date: "2026-12-13" diff --git a/social/linkedin/contracts-on-a-microcontroller/content.md b/social/linkedin/contracts-on-a-microcontroller/content.md new file mode 100644 index 00000000..17d18b78 --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/content.md @@ -0,0 +1,12 @@ +--- +template: social/linkedin-post +--- + +::::post{type=insight theme=dark logo=top-left} + +:::insight{citation="wro.cpp -- 2026-12-13"} +# A contract check in GCC 16.2 takes 36 bytes of RAM +With the enforce semantic, on a Cortex-M4. quick_enforce, with terminate mapped to abort, keeps no record: 364 B of flash in lvgl26. +::: + +:::: diff --git a/social/linkedin/contracts-on-a-microcontroller/image.png b/social/linkedin/contracts-on-a-microcontroller/image.png new file mode 100644 index 00000000..565ced06 Binary files /dev/null and b/social/linkedin/contracts-on-a-microcontroller/image.png differ diff --git a/social/linkedin/contracts-on-a-microcontroller/index.html b/social/linkedin/contracts-on-a-microcontroller/index.html new file mode 100644 index 00000000..c9b0c724 --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/index.html @@ -0,0 +1,28 @@ + + + + + + contracts-on-a-microcontroller + + + + + + + + + + +

A contract check in GCC 16.2 takes 36 bytes of RAM

With the enforce semantic, on a Cortex-M4. quick_enforce, with terminate mapped to abort, keeps no record: 364 B of flash in lvgl26.

wro.cpp -- 2026-12-13
ScudoAI
AI-generated
+ + \ No newline at end of file diff --git a/social/linkedin/contracts-on-a-microcontroller/media/.gitkeep b/social/linkedin/contracts-on-a-microcontroller/media/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/social/linkedin/contracts-on-a-microcontroller/media/README.md b/social/linkedin/contracts-on-a-microcontroller/media/README.md new file mode 100644 index 00000000..bb81c7fa --- /dev/null +++ b/social/linkedin/contracts-on-a-microcontroller/media/README.md @@ -0,0 +1,9 @@ +# Media directory + +Drop images here (PNG, JPG, SVG) for use in your post. + +Reference them in your content.md with: + + :::image{src="screenshot.png" alt="Alt text" position="top"} + +The renderer resolves paths relative to this media/ directory. diff --git a/src/content/posts/2026-12-13-contracts-on-a-microcontroller.mdx b/src/content/posts/2026-12-13-contracts-on-a-microcontroller.mdx new file mode 100644 index 00000000..575527b2 --- /dev/null +++ b/src/content/posts/2026-12-13-contracts-on-a-microcontroller.mdx @@ -0,0 +1,115 @@ +--- +title: "What a C++26 contract check costs on a microcontroller" +slug: "contracts-on-a-microcontroller" +pubDate: 2026-12-13 +author: filip-sajdak +language: en +kind: short +audience: working-cpp +tags: [contracts, embedded, cpp26, gcc] +summary: "With GCC 16.2 every enforced contract check keeps a 36-byte record in RAM and its full function name in flash. In lvgl26's Cortex-M4 slice, 112 checks cost 22,784 B of flash and 4,032 B of RAM. After the fixes, quick_enforce with terminate mapped to abort costs 364 B and no RAM." +draft: false +relatedPosts: [cpp26-contracts, contracts-check-that-acts, buzios-always-enforced-contract-label, structured-binding-pack-lto-crash] +--- + +import GodboltEmbed from '../../components/GodboltEmbed.astro'; +import PostLink from '../../components/PostLink.astro'; + +With GCC 16.2, every contract check that is compiled with the default `enforce` semantic keeps a 36-byte record in writable memory. On a microcontroller that is RAM. The record points at the full name of the function, template arguments included, which sits in flash. In the Cortex-M4 test program of lvgl26, 112 checks cost 22,784 bytes of flash and 4,032 bytes of RAM. After the fixes below, the checks stay on and cost 364 bytes of flash and no RAM. + +## In short + +- GCC 16.2 emits a 20-byte violation record and a 16-byte source location for each check, in `.data`. They hold only constants, yet they take RAM. +- A check written in a function template gets one record for each instantiation. In lvgl26, one template made 98 of the 112 records. +- The `quick_enforce` semantic keeps no record. Its call of `std::terminate` still links libstdc++'s exception run-time, about 10 KB, even under `-fno-exceptions`. +- Mapping `std::terminate` to `abort` at link time removes that run-time. It is outside the standard, so it belongs in a bare-metal toolchain file. + +lvgl26 is written by Filip Sajdak, who runs this blog. Status: lvgl26 is a 0.0.1 preview. It builds with GCC 16.2 only, and the numbers here come from its Cortex-M4 program run in QEMU. + +## What to do + +1. **Count the records.** Compile one file with `-S` and count the `.Lcontract_violation` labels. Each one, with its source location, is 36 bytes of RAM under `enforce`. +2. **Write the check outside the template.** Move a precondition that does not depend on the template arguments into a plain function, and the template calls it. GCC then keeps one record for it in each translation unit. +3. **Pick the semantic per build.** On a device that cannot report a violation, build with `-fcontract-evaluation-semantic=quick_enforce`. If exceptions are off, also link with `-Wl,--defsym=_ZSt9terminatev=abort`. Then check with `nm` that `__cxa_throw` is gone. +4. **Keep your home directory out of the firmware.** A check records its file name. Map the source directory with `-fmacro-prefix-map==`, and the binary no longer depends on where it was built. + +## What GCC keeps for each check + +The first example has one precondition in a function template and four instantiations of it: + +```cpp +template +int scaled(int value) + pre(value >= 0) +{ + return value * Scale; +} +``` + +Compile it with ARM GCC 16.2 for a Cortex-M4 at `-Os`, and the assembly has four records in the `.data` section. Each is a 20-byte `.Lcontract_violation` plus a 16-byte `.Lsrc_loc`. The strings in `.rodata.str1.1` hold the predicate once, the file name once, and four function names such as `int {anonymous}::scaled(int) [with int Scale = 2]`. + + + +The records hold only constants and addresses, but the sections are writable, so the startup code copies them into RAM. The lvgl26 slice follows the same arithmetic. Its 112 records of 36 bytes are 4,032 bytes, exactly the growth of its data section from the `ignore` build to the `enforce` build. The strings were larger. The slice's string pool was 17,156 bytes. Its [research note](https://github.com/filipsajdak/lvgl26/blob/3a23a478ca2593d4d6517e8d7854f6a4ae72cb15/docs/research/size-vs-c.md#2-contracts-on-in-a-release-build-at-near-zero-cost) counts 97 distinct function names in it, 16,448 bytes, the longest 279 characters. The note found no GCC 16.2 option that shortens the names or moves the records to flash. + +## A check in a template is a check per instantiation + +In the slice, 98 of the 112 records came from two `contract_assert` statements in one template, `bind_member`. It is instantiated once for each member that a run-time `set` can bind, and every instantiation got its own record and its own long name. + +The second example moves the check into a plain function that the template calls: + +```cpp +void check_non_negative(int value) + pre(value >= 0) +{ +} + +template +int scaled(int value) { + check_non_negative(value); + return value * Scale; +} +``` + +The assembly now has one record and one name, `void {anonymous}::check_non_negative(int)`, even though the call is inlined four times. GCC keeps a record for each function a check is written in, not for each place it ends up. An inline function in a header still gets one record in every translation unit that uses it. I checked that with two files. + + + +lvgl26 did the same in [pull request 302](https://github.com/filipsajdak/lvgl26/pull/302). Measured on main just before that change, with `enforce`, the records went from 113 to 16. The checks moved to two plain functions; the code is in [props.hpp](https://github.com/filipsajdak/lvgl26/blob/38d176157e23278070e7f58a45912316c67e05c3/include/lv/props.hpp#L682-L691). + +## quick_enforce and the exception run-time + +The `quick_enforce` semantic stops the program at a violation without calling a handler. With it, the first example has no `.data` section and no strings at all. A failed check calls `__tu_terminate_wrapper()`, which calls `std::terminate()`. + + + +In libstdc++, `std::terminate` lives in an object that pulls in the personality routine, the unwinder and the throw function. That happens even when the program is compiled with `-fno-exceptions`. Compiler Explorer cannot link for this target, so I linked the first example locally with arm-none-eabi-g++ 16.2.0 and newlib: + +| semantic | text | data | exception run-time symbols | +|---|---|---|---| +| `ignore` | 3,026 | 392 | 0 | +| `enforce`, library handler | 15,061 | 552 | 47 | +| `quick_enforce` | 14,697 | 408 | 47 | +| `quick_enforce`, `terminate` = `abort` | 3,250 | 392 | 0 | + +The last row adds `-Wl,--defsym=_ZSt9terminatev=abort` to the link. The symbol `std::terminate` then resolves to newlib's `abort`, and four checks cost 224 bytes of text and no data. The programs were linked, not run. + +In the lvgl26 slice, `quick_enforce` added 196 symbols and 10,023 bytes of the exception run-time. Under `enforce` the test program had already kept the run-time out with a violation handler of its own, which prints the comment and calls `abort`. Pull request 302 put both options in the Arm toolchain file. A violated precondition still stops the program, and the test script checks that. + +Replacing `std::terminate` like this is outside the standard, because it is not a replaceable function. With exceptions off, `terminate` has nothing to do but stop. That makes the mapping a choice for the bare-metal toolchain, not for the library. + +| lvgl26 slice, over the `ignore` build | flash | RAM in `.data` | +|---|---|---| +| `enforce`, before the fixes | 22,784 | 4,032 | +| `quick_enforce` with `abort`, before the fixes | 1,660 | 0 | +| `quick_enforce` with `abort`, as shipped | 364 | 0 | + +The first two rows come from the [research note's table](https://github.com/filipsajdak/lvgl26/blob/3a23a478ca2593d4d6517e8d7854f6a4ae72cb15/docs/research/size-vs-c.md#the-semantic-for-each-build) of 28 November. The third row is from the [before and after measurements](https://github.com/wrocpp/cpp26-reflection-examples/tree/96d26715a4e45da052e63b74c56a14fb51db81b0/posts/152-where-did-my-flash-go/RESULTS.md) of 29 November, rows 1 and 5. The shipped slice also contains the `bind_member` change and a task that sets one property by name ([pull request 303](https://github.com/filipsajdak/lvgl26/pull/303)), so fewer checks are linked. The step from 1,660 to 364 bytes comes from those changes, not from the semantic. + +## The home directory in the firmware + +Each record points at its file name, and GCC writes the path the compiler saw. The lvgl26 slice held 8 strings with the builder's home directory, counted with `strings slice.elf | grep -c /Users/`. After the fixes it holds none ([row 6](https://github.com/wrocpp/cpp26-reflection-examples/tree/96d26715a4e45da052e63b74c56a14fb51db81b0/posts/152-where-did-my-flash-go/RESULTS.md)). + +Two changes did that. `quick_enforce` dropped the records and their paths. [Pull request 304](https://github.com/filipsajdak/lvgl26/pull/304) maps lvgl26's include directory with `-fmacro-prefix-map`. A build with `enforce` then stays free of the home directory, and two checkouts give the same binary. On Compiler Explorer the same option turns `/app/example.cpp` into `example.cpp` in the strings of the second example. Only the macro form is mapped; debug information keeps the real paths for the debugger. + +The earlier posts on contracts cover what the semantics mean: the introduction, checks that act, and the enforced label under ignore. The lvgl26 numbers come from arm-none-eabi GCC 16.2.0 at `-Os`, measured on 28 and 29 November 2026. The 20 December post, "Where did my flash go?", walks through how they were measured. The examples, the link script and the outputs are in [`posts/150-contracts-on-a-microcontroller`](https://github.com/wrocpp/cpp26-reflection-examples/tree/c63435f69a36d40a19ef27ebe4911c5549bcb504/posts/150-contracts-on-a-microcontroller).