Data-plane throughput pass: batched I/O + zero-repair FEC bypass #2

Merged
vxfemboy merged 13 commits from data-plane-throughput-pass into main 2026-06-30 22:26:21 +00:00
vxfemboy commented 2026-06-30 22:22:14 +00:00 (Migrated from github.com)

A measurement-driven optimization pass on the yipd data-plane hot path. Spec + plan committed; executed as 6 reviewed tasks.

What landed (no wire-format change — netns ping 3/3 throughout)

  • Batched I/O via yip-io: egress sends a packet's FEC symbols in one sendmmsg; ingress reads bursts via recvmmsg (MSG_WAITFORONE). yipd now uses yip-io's PlainIo instead of a raw UdpSocket.
  • No per-symbol allocation (reused thread-owned arena); 4 MiB SO_SNDBUF/SO_RCVBUF via a yip-io set_socket_buffers helper. yipd is now #![forbid(unsafe_code)]; libc pinned exactly.
  • Byte-identical RaptorQ encode bypass for the zero-repair case (yip-transport) — skips the ~24 µs Encoder::new solve, emitting source symbols byte-identically to the encoder (verified across 13 object sizes in the final review).
  • Per-stage pipeline profile harness confirming FEC encode (~24 µs) dominates egress.

Honest verdict (see crates/yip-bench/README.md)

Clean-link single-stream TCP ~220–285 Mbit/s — no regression. The FEC-encode bypass is dormant: the controller's repair_count floors at max(1), so it never requests zero repair. That floor is load-bearing until the daemon feeds observed loss back to the controller (deferred ARQ/feedback) — dropping repair to zero without that would disable FEC entirely. So the clean-link win (skip encode + halve per-packet datagram count) is unlocked by the adaptive loss-feedback loop (the next milestone), not this pass alone. This pass shipped the plumbing and a ready, tested bypass.

Review

Per-task reviews + a final whole-branch opus review: READY TO MERGE, no Critical/Important findings; cumulative unsafe (sendmmsg/recvmmsg/setsockopt) verified sound, no network-input panic paths.

🤖 Generated with Claude Code

A measurement-driven optimization pass on the yipd data-plane hot path. Spec + plan committed; executed as 6 reviewed tasks. ## What landed (no wire-format change — netns ping 3/3 throughout) - **Batched I/O via yip-io**: egress sends a packet's FEC symbols in one `sendmmsg`; ingress reads bursts via `recvmmsg` (`MSG_WAITFORONE`). yipd now uses yip-io's `PlainIo` instead of a raw `UdpSocket`. - **No per-symbol allocation** (reused thread-owned arena); **4 MiB `SO_SNDBUF`/`SO_RCVBUF`** via a yip-io `set_socket_buffers` helper. yipd is now `#![forbid(unsafe_code)]`; `libc` pinned exactly. - **Byte-identical RaptorQ encode bypass** for the zero-repair case (`yip-transport`) — skips the ~24 µs `Encoder::new` solve, emitting source symbols byte-identically to the encoder (verified across 13 object sizes in the final review). - **Per-stage pipeline profile** harness confirming FEC encode (~24 µs) dominates egress. ## Honest verdict (see `crates/yip-bench/README.md`) Clean-link single-stream TCP ~220–285 Mbit/s — **no regression**. The FEC-encode bypass is **dormant**: the controller's `repair_count` floors at `max(1)`, so it never requests zero repair. That floor is load-bearing until the daemon feeds observed loss back to the controller (deferred ARQ/feedback) — dropping repair to zero without that would disable FEC entirely. So the clean-link win (skip encode + halve per-packet datagram count) is unlocked by the **adaptive loss-feedback loop** (the next milestone), not this pass alone. This pass shipped the plumbing and a ready, tested bypass. ## Review Per-task reviews + a final whole-branch opus review: **READY TO MERGE**, no Critical/Important findings; cumulative `unsafe` (sendmmsg/recvmmsg/setsockopt) verified sound, no network-input panic paths. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.