Skip to content

Phase 2 prep: freestanding/embedded profile groundwork + Pico 2W guide#20

Merged
tap merged 1 commit into
masterfrom
claude/phase-2-prep-h8q9mz
Jun 26, 2026
Merged

Phase 2 prep: freestanding/embedded profile groundwork + Pico 2W guide#20
tap merged 1 commit into
masterfrom
claude/phase-2-prep-h8q9mz

Conversation

@tap

@tap tap commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Lays the groundwork for Phase 2 ("Reach") with the one self-contained, keep-it-green item — the freestanding/embedded profile (no exceptions/RTTI) — motivated by a concrete demand signal: the Raspberry Pi Pico 2W (RP2350). The other Reach items (QEMU, Android NDK, multicast) stay demand-gated.

Closes the groundwork portion of #15; adds the guide for #16.

The build seam

New osctap/osc/OscConfig.h:

  • Auto-detects OSCTAP_HAS_EXCEPTIONS from the compiler.
  • Routes all 78 core throw sites through OSCTAP_THROW. With exceptions on it is literally throw Xhosted builds are byte-for-byte unchanged (the test4/test5 malformed-input asserts still pass). Under -fno-exceptions it calls a non-returning, user-overridable fatal handler (OSCTAP_FATAL_HANDLER, default std::abort()).
  • OSCTAP_FREESTANDING drops the hosted-only facilities: <iostream>, the std::vector-backed OwnedMessage, and the std::string operator<<.

Also fixes a latent dependency: the outbound header used std::string relying on <iostream> to transitively include <string> — now explicit.

Profile + CI

  • OSCTAP_FREESTANDING CMake option builds tests/OscFreestandingTest.cpp with -fno-exceptions -fno-rtti (flags PRIVATE to that target, so the exception-based tests are unaffected). The test serializes then parses a message through the checked accessors (proving OSCTAP_THROW compiles under -fno-exceptions) and the realtime *Unchecked path.
  • New matrixed freestanding CI job (GCC + Clang).

Docs

  • docs/EMBEDDED_PICO2W.md — Pico SDK + lwIP integration recipe (use osc/ core, replace ip/ sockets with lwIP UDP), receive/send snippets, no-heap RT checklist, and the untrusted-input/DoS trade-off: with exceptions off a malformed packet hits the fatal handler, so open networks should keep exceptions on and catch — the non-throwing TryInit/validate to fix this is tracked as deferred work in Phase 2: Freestanding / embedded profile (no exceptions/RTTI option) #15.
  • ROADMAP.md / docs/STATUS.md — mark the groundwork landed, restate the remaining Reach items as demand-gated, fix the stale status line, add landmines for the new seam.

Verification

  • Hosted suite green: C++17 + C++20, GCC/Clang/MSVC matrix, ASan/UBSan (4/4).
  • OscFreestandingTest builds + runs under -fno-exceptions -fno-rtti on GCC and Clang, C++17 and C++20.

Follow-up (tracked)

Phase 2 issues opened: #15 (freestanding), #16 (Pico 2W), #17 (QEMU CI), #18 (Android NDK), #19 (multicast). The "Phase 2 — Reach" milestone object is an owner action — the GitHub MCP server exposes no milestone-creation endpoint.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MMR6tmM7H3obaL7SX14bkJ


Generated by Claude Code

Lay the groundwork for Phase 2 ("Reach") with the one self-contained,
keep-it-green item — the freestanding/embedded profile (no exceptions/RTTI)
— motivated by a concrete demand signal: the Raspberry Pi Pico 2W (RP2350).

- osc/OscConfig.h: build seam. Auto-detects OSCTAP_HAS_EXCEPTIONS and routes
  every core throw through OSCTAP_THROW (a plain `throw` when exceptions are
  on; a non-returning, user-overridable fatal handler when they are off).
  OSCTAP_FREESTANDING drops the hosted-only facilities.
- OscReceivedElements.h / OscOutboundPacketStream.h: route all 78 throw sites
  through OSCTAP_THROW; guard <iostream>, <vector>/OwnedMessage, and the
  std::string operator<< behind OSCTAP_FREESTANDING. Hosted builds unchanged.
- CMake OSCTAP_FREESTANDING option builds tests/OscFreestandingTest.cpp with
  -fno-exceptions -fno-rtti (flags PRIVATE to that target); new `freestanding`
  CI job (GCC + Clang) keeps it green.
- docs/EMBEDDED_PICO2W.md: Pico SDK + lwIP integration recipe, including the
  untrusted-input/exceptions trade-off and the no-heap RT checklist.
- ROADMAP.md / docs/STATUS.md: mark the groundwork landed, restate the
  remaining Reach items as demand-gated, add landmines for the new seam.

Verified: hosted suite green (C++17/20, GCC/Clang/ASan/UBSan); freestanding
test builds+runs under -fno-exceptions -fno-rtti on GCC and Clang, C++17/20.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMR6tmM7H3obaL7SX14bkJ
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.

2 participants