Skip to content

Medi v0.0.4 Released

We’re excited to announce Medi v0.0.4. This release focuses on reliability, observability, and documentation for the host runtime, with deterministic tests and clearer diagnostics that help both developers and clinicians.

Highlights

  • Comprehensive runtime error/diagnostics system
  • RuntimeError, MemoryErrorKind, SchedulerErrorKind, and RuntimeDiagnostic.
  • Context-aware reporting via set_error_reporter_with_context and the medi_runtime_report! macro that captures file/line/column/module/op.
  • Multi-listener support with add_error_context_listener for tests, metrics, and tooling.

  • Context tags for channels and GC

  • Channels (std mpsc): channel.send, channel.recv, channel.try_recv (only on non-empty failures).
  • Crossbeam: xchan.send, xchan.try_send (only on non-full failures), xchan.recv, xchan.try_recv (non-empty failures).
  • GC: gc.lock emitted when GC mutex is poisoned.

  • Real-time memory (rt_zones) visibility

  • rt_region.alloc_*_overflow for region overflows.
  • fixed_pool.alloc_exhausted, fixed_pool.invalid_free, fixed_pool.double_free for pool edges.

  • Deterministic scheduler tests

  • Replaced timing-based assertions with barrier/ack-based tests using crossbeam.
  • Serialized scheduler tests with a global test mutex to prevent cross-talk when running in parallel.

  • Better scheduler responsiveness

  • Unpark all workers after enqueue and after task panics.
  • Reduced lock hold time on stealers in worker threads.

  • Documentation

  • New compiler/medic_runtime/README.md covering error types, recovery policies, RT memory behavior, common op tags, and examples.

Performance notes

  • Diagnostics path validated via reporter_invocation_under_1ms test (10k events well under a 2s cap).
  • Real-time memory latency and IoT-like tests stay within budget; constant-time behaviors maintained.

Full Changelog

See the CHANGELOG v0.0.4 for complete details.

Upgrade guidance

  • No breaking API changes in this release.
  • For custom error pipelines, prefer set_error_reporter_with_context and consider add_error_context_listener for additional observers.
  • For testing scheduler behavior, follow the new ack-based pattern to avoid timing flakes.