Skip to content

feat(transport): rust zenoh support and api refactor#2753

Open
aclauer wants to merge 27 commits into
mainfrom
andrew/feat/zenoh-rust-transport
Open

feat(transport): rust zenoh support and api refactor#2753
aclauer wants to merge 27 commits into
mainfrom
andrew/feat/zenoh-rust-transport

Conversation

@aclauer

@aclauer aclauer commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

Only ~900 lines of source code change, the rest is Cargo.lock

Closes DIM-XXX

Solution

  • rewrite the Rust transport trait to be a real pub sub contract
  • each topic gets individual publish thread (necessary for QoS to be per topic)
  • add Zenoh transport. key expressions are passed to Rust from Python
  • add Zenoh QoS

How to Test

local ping pong

python3 rust_ping_pong.py --transport=zenoh
python3 rust_ping_pong.py --transport=lcm

remote ping pong (run on different machines, connected to same network)

DIMOS_TRANSPORT=zenoh ./target/release/pong <<< '{"topics":{"data":"dimos/pingpong_data/geometry_msgs.Twist","confirm":"dimos/pingpong_confirm/geometry_msgs.Twist"},"config":{"sample_config":0}}'
DIMOS_TRANSPORT=zenoh ./target/release/ping <<< '{"topics":{"data":"dimos/pingpong_data/geometry_msgs.Twist","confirm":"dimos/pingpong_confirm/geometry_msgs.Twist"},"config":null}'

benchmark between lcm and zenoh locally

cd dimos/native/rust
cargo run --release --example transport_benchmark

Contributor License Agreement

  • I have read and approved the CLA.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.23529% with 25 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dimos/core/native_module.py 17.39% 18 Missing and 1 partial ⚠️
dimos/core/transport.py 71.42% 6 Missing ⚠️
@@            Coverage Diff             @@
##             main    #2753      +/-   ##
==========================================
- Coverage   71.91%   71.91%   -0.01%     
==========================================
  Files         979      979              
  Lines       87346    87401      +55     
  Branches     7982     7990       +8     
==========================================
+ Hits        62819    62851      +32     
- Misses      22387    22410      +23     
  Partials     2140     2140              
Flag Coverage Δ
OS-ubuntu-24.04-arm 64.56% <63.23%> (-0.02%) ⬇️
OS-ubuntu-latest 67.05% <63.23%> (-0.01%) ⬇️
Py-3.10 67.03% <63.23%> (-0.02%) ⬇️
Py-3.11 67.03% <63.23%> (-0.01%) ⬇️
Py-3.12 67.04% <63.23%> (-0.01%) ⬇️
Py-3.13 67.03% <63.23%> (-0.02%) ⬇️
Py-3.14 67.04% <63.23%> (-0.02%) ⬇️
Py-3.14t 67.04% <63.23%> (-0.01%) ⬇️
SelfHosted-Large 30.10% <30.88%> (+<0.01%) ⬆️
SelfHosted-Linux 37.66% <39.70%> (-0.01%) ⬇️
SelfHosted-macOS 36.02% <42.64%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/protocol/pubsub/impl/test_zenohpubsub.py 98.58% <100.00%> (+0.05%) ⬆️
dimos/protocol/pubsub/impl/zenohpubsub.py 91.46% <100.00%> (+0.61%) ⬆️
dimos/core/transport.py 66.85% <71.42%> (-0.12%) ⬇️
dimos/core/native_module.py 67.87% <17.39%> (-4.74%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aclauer aclauer marked this pull request as ready for review July 7, 2026 19:56
@aclauer aclauer changed the title Andrew/feat/zenoh rust transport feat(transport): rust zenoh support and api refactor Jul 7, 2026
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Rust Zenoh transport support and updates native module transport selection. The main changes are:

  • Runtime selection between LCM and Zenoh for Rust native modules.
  • Native Zenoh publish, subscribe, key handling, and QoS wiring.
  • Python-side channel and QoS metadata passed to stdin-configured native modules.
  • Per-output Rust publish workers for transport sends.
  • Updated Rust examples, docs, tests, and lockfiles.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
native/rust/dimos-module/src/lcm.rs Refactors LCM receive handling into callback registration over the shared transport loop.
native/rust/dimos-module/src/module.rs Updates the module runtime for callback subscriptions, per-output publish queues, and stdin QoS parsing.
native/rust/dimos-module/src/zenoh.rs Adds the native Zenoh transport with publisher caching, subscriptions, key normalization, and QoS parsing.
dimos/core/native_module.py Passes the selected transport and optional output QoS metadata to native modules.
dimos/core/transport.py Adds channel and publish QoS accessors used by native module startup.

Reviews (13): Last reviewed commit: "Reduce buffers now that we have channel ..." | Re-trigger Greptile

Comment thread native/rust/dimos-module/src/zenoh.rs
Comment thread native/rust/dimos-module/src/lcm.rs
Comment thread native/rust/dimos-module/src/lcm.rs
@aclauer aclauer linked an issue Jul 7, 2026 that may be closed by this pull request
Comment thread native/rust/dimos-module/src/lcm.rs
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 8, 2026
@github-actions github-actions Bot removed the ready-to-merge Required CI checks have passed on this PR label Jul 8, 2026
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 8, 2026
Comment thread native/rust/dimos-module/src/module.rs
paul-nechifor
paul-nechifor previously approved these changes Jul 9, 2026
@github-actions github-actions Bot removed the ready-to-merge Required CI checks have passed on this PR label Jul 9, 2026
@github-actions github-actions Bot added the ready-to-merge Required CI checks have passed on this PR label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Required CI checks have passed on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zenoh Rust transport

2 participants