feat(webrtc): real-SCTP loopback provider + typed msg transforms#2806
Draft
spomichter wants to merge 2 commits into
Draft
feat(webrtc): real-SCTP loopback provider + typed msg transforms#2806spomichter wants to merge 2 commits into
spomichter wants to merge 2 commits into
Conversation
…or tests and benchmarks Two in-process RTCPeerConnections over localhost UDP (host candidates only, direct SDP exchange, no signaling server or credentials), running the full aiortc DTLS+SCTP stack — unlike the in-memory mock/dict providers, this measures what a real DataChannel link does. - providers/loopback.py: LoopbackConfig/LoopbackProvider following the CloudflareProvider structure minus HTTP; lazy per-topic negotiated channel pairs; empty iceServers (aiortc's default queries Google STUN, stalling gathering ~5s per peer when blocked — handshake is ~50ms without it) - test_loopback.py: event-driven unit tests (roundtrip, topic isolation, 32KiB through SCTP fragmentation, unsubscribe, restart-after-stop, config singleton) - test_spec.py: real-SCTP row in the shared pubsub contract grid - benchmark/testdata.py: WebrtcSctp Case, keyless, sizes above the 64KiB negotiated SCTP limit skip until chunking lands Measured (in-process, one loop thread serving both peers, 8s drain): ~3.7k msg/s small msgs, ~20 MiB/s at 16-64KiB, 0% loss. This settles the transport-spec P1 gate: raw Image/PointCloud2 rates need decimation or media-track routing; DataChannels carry control + decimated bulk.
MsgTransform = (A) -> B | None applied before the wire; None drops the
message. Picklable frozen-dataclass callables (VoxelDownsample,
ResizeImage, Throttle) plus a TransformTransport wrapper that composes
them around any Transport backend (LCM, Zenoh, SHM, ROS, WebRTC), so
bandwidth policy — decimation, rate caps — lives once at the type level
instead of per-backend:
("lidar", PointCloud2): TransformTransport(
ZenohTransport("lidar", PointCloud2), VoxelDownsample(0.05))
Groundwork for constrained links (WebRTC transport backend spec) where
raw Image/PointCloud2 rates exceed the link budget.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
first chunk of the webrtc-as-full-transport-backend work. two peices, can split the transforms commit out if prefered.
loopback provider — keyless real-SCTP link for tests + benchmarks. full aiortc stack (dtls, sctp, localhost udp), no signaling server, no CF creds. unlike the in-memory mock this measures what a real datachannel actually does:
benchmarked (new WebrtcSctp row, keyless, runs anywhere): ~3.7k msg/s small msgs, ~20 MiB/s at 16-64KiB, 0% loss once the send queue drains. so raw Image/PointCloud2 over datachannels is dead — decimation / video track routing it is. thats the decision gate this was built to answer.
transforms — decimation/throttling as typed picklable callables that compose around any transport, not webrtc specific:
tests: 6 loopback units (event driven, no sleeps), real-sctp row in the shared pubsub contract grid, 6 transform units. full suite green locally (2510 passed). loopback tests add ~0.5s to CI.