What's Changed in v0.3.0
fsmc v0.3.0 introduces major real-time embedded runtime enhancements, static abstract interpretation for Extended Finite State Machines (EFSM), automated Requirement Traceability Matrix (RTM) generation, and a comprehensive overhaul of the documentation and design pattern cookbooks.
🚀 Key Highlights & New Features
1. Lock-Free & Wait-Free SPSC Runtime Engine (fsm::spsc_fsm)
- Wait-Free O(1) Producer: Designed for Interrupt Service Routines (ISRs) and hard real-time tasks (ARM Cortex-M, RISC-V, FreeRTOS). Pushing events (
enqueue) never allocates dynamic memory, never spins on mutexes, and executes in bounded CPU cycles. - Sequential RTOS Consumer: Dedicated
process_one()andrun_until_empty()dispatch loop. - Seqlock Context Snapshots: High-frequency telemetry or watchdog tasks can read consistent context snapshots (
snapshot_context()) without blocking producers or consumers.
2. EFSM Data Path Interval Analysis (EFSMIntervalAnalyzer)
- Static abstract interpretation engine based on interval lattices
[lo, hi]propagating numerical variable bounds forward across reachable state paths. - Statically detects unreachable transition branches and unsatisfiable guards (
W_EFSM_UNSATISFIABLE_GUARD) prior to code generation.
3. Requirement Traceability Matrix (RTM) Audit Reports
- Full audit trail linking
@fsm:reqannotations in SysML / UML diagrams to covered states, transitions, and formal verification outcomes. - Added CLI flags
--rtm-output <file>and--rtm-format <json|md>for CI/CD compliance validation.
4. Automatic Resolved Guard & Action Code Generation
- Statechart boolean conditions (e.g.
[batteryLevel >= 20.0 and isGpsLocked]) and assignments (e.g.do waypointIndex += 1;) are automatically parsed, type-checked, and emitted as direct C++ expressions without requiring manual stub implementations.
5. Transition Flight Recorder & Telemetry (dispatch_result)
dispatch_resultnow embedstransition_tracemetadata capturing source state, target state, event, guard evaluation, and action execution for real-time diagnostics.
6. Formal Middle-End ChoiceInliningPass
- Automates Cartesian product flattening for
StateKind::ChoiceandStateKind::Junctionnodes on the intermediate representation (FsmIr). - Inlines decision trees into direct composite transitions guarded by
fsm::and_.
7. Documentation Overhaul & Architectural Cookbooks
- Reorganized official documentation with clear engineering-focused principles.
- Added Architectural Design Patterns Cookbook with 4 real-world production recipes (Hardware Sensor ISR, Hierarchical UAV Mission Controller, Network Protocol Parser, Multi-FSM Coordination).
💥 Breaking Changes & Migration
- Consolidated Thread-Safe Runtimes: Deprecated legacy standalone aliases in favor of
fsm::spsc_fsm(for ISR / lock-free single-producer single-consumer queues) andfsm::thread_safe_fsm(for multi-threaded MPSC queues with asynchronous futures).
🧪 Verification & Quality
- Test Suite: 51/51 GoogleTest unit and integration test suites passing (100% pass rate).
- Compliance: Zero memory leaks (
-fsanitize=address,undefined),-Werror, andclang-formatcompliant.
Full Changelog: v0.2.0...v0.3.0
Full Changelog: v0.2.0...v0.3.0
Full Changelog: v0.2.0...v0.3.0
Full Changelog: v0.2.0...v0.3.0