Open Source 开源项目 1h ago Updated 1h ago 更新于 1小时前 47

softmata/horus softmata/horus

HORUS is a real-time distributed middleware that replaces DDS with shared-memory ring buffers and lock-free synchronization, achieving sub-200ns IPC latency (171 ns one-way cross-process) Supports Rust, Python, and C++ with zero-copy tensor sharing and a unified `horus.toml` configuration, eliminating cross-language serialization overhead Built-in real-time scheduling with 5 execution classes, deterministic timing, and safety features (graduated watchdog, safe-state hooks, BlackBox recording) De HORUS是替代DDS的实时分布式中间件,采用共享内存环形缓冲区与无锁同步,IPC延迟低至171纳秒(单向跨进程) 支持Rust/Python/C++跨语言共享内存通信,Python张量通过池化实现零拷贝转换至NumPy,避免序列化开销 提供确定性调度(5类执行)与内置安全机制(分级看门狗、BlackBox故障记录),适用于机器人/自动驾驶等硬实时场景 简化开发流程:单horus.toml配置文件替代ROS2多文件组合,一键安装脚本确保CLI与库版本一致性

55
Hot 热度
50
Quality 质量
50
Impact 影响力

Analysis 深度分析

TL;DR

  • HORUS is a real-time distributed middleware that replaces DDS with shared-memory ring buffers and lock-free synchronization, achieving sub-200ns IPC latency (171 ns one-way cross-process)
  • Supports Rust, Python, and C++ with zero-copy tensor sharing and a unified horus.toml configuration, eliminating cross-language serialization overhead
  • Built-in real-time scheduling with 5 execution classes, deterministic timing, and safety features (graduated watchdog, safe-state hooks, BlackBox recording)
  • Designed for latency-critical domains: robotics, industrial automation, autonomous vehicles, trading systems, and game engines
  • Offers a streamlined developer experience with horus new and horus run commands, contrasting with ROS2's complex colcon build workflow

Why It Matters

HORUS addresses a critical pain point in real-time AI and robotics systems: the latency bottleneck introduced by DDS-based middleware. For practitioners building systems where sub-millisecond determinism matters—such as motor control loops running at 1kHz alongside AI inference—HORUS enables co-locating async GPU work and real-time control in the same process, something DDS architectures struggle to achieve efficiently.

Technical Details

  • Architecture: Shared-memory ring buffers with lock-free synchronization replace DDS's publish-subscribe model, enabling 171 ns one-way cross-process IPC versus ~5 µs for ROS2 REP 2014
  • Multi-language support: Rust, Python, and C++ nodes share the same memory space with zero-copy tensor access to NumPy (host memory), eliminating serialize/deserialize overhead
  • Real-time scheduling: 5 execution classes with deterministic timing; nodes can run on dedicated real-time threads via .rate() and .order(), with configurable deadline miss handling (Miss::SafeMode)
  • Safety features: Built-in budget/deadline/watchdog monitoring, safe-state hooks, and BlackBox recording for post-mortem analysis—addressing application-level safety gaps in DDS
  • AI + RT convergence: Supports running AsyncIO (for GPU workloads) and real-time motor control in the same process, bridging the traditional separation between AI inference and control loops

Industry Insight

  • The sub-200ns IPC benchmark positions HORUS as a serious alternative to DDS for latency-sensitive robotics and autonomous systems, potentially accelerating adoption of real-time AI at the edge where every microsecond counts
  • The unified multi-language shared-memory model (Rust/Python/C++) could simplify middleware stacks in mixed-language robotics projects, reducing the integration complexity that currently forces teams into language-specific bridges
  • The "AI + RT in same process" design suggests a growing industry trend toward co-locating inference and control, which could reshape how real-time systems are architected—moving away from the traditional separate-process DDS model toward tightly integrated runtime environments

TL;DR

  • HORUS是替代DDS的实时分布式中间件,采用共享内存环形缓冲区与无锁同步,IPC延迟低至171纳秒(单向跨进程)
  • 支持Rust/Python/C++跨语言共享内存通信,Python张量通过池化实现零拷贝转换至NumPy,避免序列化开销
  • 提供确定性调度(5类执行)与内置安全机制(分级看门狗、BlackBox故障记录),适用于机器人/自动驾驶等硬实时场景
  • 简化开发流程:单horus.toml配置文件替代ROS2多文件组合,一键安装脚本确保CLI与库版本一致性

为什么值得看

HORUS以亚微秒级延迟和确定性调度挑战传统DDS中间件,为AI驱动的实时系统(如机器人控制、自动驾驶)提供高性能通信基础。其跨语言零拷贝共享内存设计显著降低开发复杂度,对追求低延迟与高可靠性的AI从业者具有重要参考价值。

技术解析

  • 核心架构:基于共享内存环形缓冲区实现进程间通信(IPC),采用无锁同步机制,避免传统DDS的序列化开销,实现171纳秒单向跨进程延迟(对比ROS2 REP 2014的~5µs)
  • 多语言支持:Rust/Python/C++节点可共享同一块内存,Python张量通过池化实现零拷贝转换至NumPy(主机内存),AI与实时控制可共存于同一进程(AsyncIo处理GPU,RT线程处理电机)
  • 调度与实时性:内置5类执行调度器,支持tick_rate(默认100Hz)、order(节点执行顺序)、rate(独立实时线程)及on_miss(超时时进入安全模式)等策略,提供确定性调度与实时保障
  • 安全机制:集成分级看门狗、安全状态钩子与BlackBox故障记录,满足工业级安全要求;配置单文件(horus.toml)替代ROS2的package.xml/CMakeLists/launch文件组合
  • 开发体验:提供一键安装脚本(curl管道)与版本锁定机制,确保CLI与库版本一致;Python需指定版本下限(>=0.4.1)避免PyPI旧版兼容问题

行业启示

  • 实时中间件正从"尽力而为"向"确定性通信"演进,HORUS的低延迟设计预示AI+机器人系统将更深度整合实时控制与异步AI推理
  • 跨语言零拷贝共享内存成为高性能分布式系统的新标准,有望减少多语言栈(如Rust核心+Python AI)中的数据搬运瓶颈
  • 开发者应关注此类新兴中间件,评估其在现有ROS2/DDS架构中的替代潜力,尤其在延迟敏感型AI应用(如自动驾驶、工业机械臂)中优先验证性能收益

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Open Source 开源 Programming 编程 Deployment 部署