Skip to content

Refactor SRTLA components and enhance stall gate functionality#16

Merged
datagutt merged 16 commits into
mainfrom
sans-io
Jul 17, 2026
Merged

Refactor SRTLA components and enhance stall gate functionality#16
datagutt merged 16 commits into
mainfrom
sans-io

Conversation

@datagutt

Copy link
Copy Markdown
Member

No description provided.

datagutt added 16 commits July 15, 2026 16:35
…ndency-free crate

Inject the keepalive wire timestamp (create_keepalive_packet[_ext] now take now)
so the protocol has zero crate-internal deps, then move src/protocol into a new
srtla-protocol workspace crate. The sender aliases it as crate::protocol, so every
existing crate::protocol::* reference keeps resolving.
process_packet was an inherent impl SrtlaConnection method holding the receive
path's tokio UdpSocket + mpsc coupling. Move it verbatim (ACK fast-path intact)
into sender::uplink_recv::process_uplink_packet(conn, ...) so the connection
state carries no receive-side I/O.
…pure CriticalWindow

Move spawn_listener (tokio UDP) into a new priority_listener shell module; add
CriticalWindow::record_malformed so the listener needs no private-field access.
priority.rs (CriticalWindow + select_best_quality_idx) is now tokio-free in
production.
selection is core scheduler logic, mutually dependent with connection (connection
calls calculate_quality_multiplier; selection operates on SrtlaConnection), so it
cannot live under the sender shell. Move src/sender/selection -> src/selection and
repoint connection to crate::selection, breaking the last core->shell dependency.
sender keeps crate::sender::* re-exports for the test/telemetry surface.
… net module

Move BatchUdpSocket (batch_recv) and the socket/binder helpers (socket.rs) plus
send_all_datagrams into a new top-level net shell module, and relocate the shared
BATCH_SEND_SIZE constant into connection (core) so net depends on core, not the
reverse. connection/ now holds only pure, tokio-free protocol state.
…ynamicConfig

DynamicConfig couples to the control dispatcher and SharedStats (shell), but the
scheduler core only needs the pure ConfigSnapshot. Move ConfigSnapshot + its
STALL_* default consts into a new config_snapshot core module; DynamicConfig
re-exports them for the existing crate::config::* paths. selection now depends on
config_snapshot, not config — the last core->shell config leak.
…n dwell

the staleness window now scales with smoothed rtt (4x, floored at 1s,
capped at the configured ceiling) so a fast link is pulled within
hundreds of ms of going dark. gating latches asymmetrically: engage on
the raw stall signal, release only after an uninterrupted run of fresh
delivery proof spanning twice the effective window, so a backlog drained
by cumulative acks or a single keepalive echo can no longer flap a
still-marginal link back into rotation. adds a per-link gate-event
counter and a 1-in-n duplicate-probe cadence helper.
srt packets carrying the retransmit flag now route through the
best-quality override: recovery traffic that rides a degraded link
arrives too late to fill the hole it was resent for. stall-gated links
receive a copy of every nth routed data packet; the duplicate is deduped
by the srt receiver so it can never stall the buffer, while a delivered
one earns the gated link the data-sized delivery proof its rejoin dwell
requires. srtla acks now match the arrival link's packet log first so a
probe's ack credits the link that actually delivered it.
@datagutt
datagutt merged commit 4eedb41 into main Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@datagutt, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 072f5a24-c903-44bb-88a8-4229d816a0a2

📥 Commits

Reviewing files that changed from the base of the PR and between a844258 and 9314fdf.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (66)
  • Cargo.toml
  • crates/srtla-core/Cargo.toml
  • crates/srtla-core/src/config_snapshot.rs
  • crates/srtla-core/src/connection/ack_nak.rs
  • crates/srtla-core/src/connection/batch_send.rs
  • crates/srtla-core/src/connection/bitrate.rs
  • crates/srtla-core/src/connection/congestion/classic.rs
  • crates/srtla-core/src/connection/congestion/enhanced.rs
  • crates/srtla-core/src/connection/congestion/mod.rs
  • crates/srtla-core/src/connection/incoming.rs
  • crates/srtla-core/src/connection/mod.rs
  • crates/srtla-core/src/connection/reconnection.rs
  • crates/srtla-core/src/connection/rtt.rs
  • crates/srtla-core/src/ewma.rs
  • crates/srtla-core/src/kalman.rs
  • crates/srtla-core/src/lib.rs
  • crates/srtla-core/src/mode.rs
  • crates/srtla-core/src/priority.rs
  • crates/srtla-core/src/registration/mod.rs
  • crates/srtla-core/src/registration/probing.rs
  • crates/srtla-core/src/selection/classic.rs
  • crates/srtla-core/src/selection/classifier.rs
  • crates/srtla-core/src/selection/enhanced.rs
  • crates/srtla-core/src/selection/link_cc.rs
  • crates/srtla-core/src/selection/mod.rs
  • crates/srtla-core/src/selection/quality.rs
  • crates/srtla-core/src/test_helpers.rs
  • crates/srtla-core/src/utils.rs
  • crates/srtla-protocol/Cargo.toml
  • crates/srtla-protocol/src/builders.rs
  • crates/srtla-protocol/src/constants.rs
  • crates/srtla-protocol/src/lib.rs
  • crates/srtla-protocol/src/parsers.rs
  • crates/srtla-protocol/src/types.rs
  • src/config.rs
  • src/connection/incoming.rs
  • src/connection/packet_io.rs
  • src/control.rs
  • src/control_socket.rs
  • src/lib.rs
  • src/main.rs
  • src/metrics.rs
  • src/net/batch_recv.rs
  • src/net/mod.rs
  • src/net/socket.rs
  • src/priority_listener.rs
  • src/sender/connections.rs
  • src/sender/housekeeping.rs
  • src/sender/mod.rs
  • src/sender/packet_handler.rs
  • src/sender/status.rs
  • src/sender/uplink.rs
  • src/sender/uplink_recv.rs
  • src/stats.rs
  • src/test_helpers.rs
  • src/tests/config_tests.rs
  • src/tests/connection_tests.rs
  • src/tests/end_to_end_tests.rs
  • src/tests/integration_tests.rs
  • src/tests/keepalive_interop_tests.rs
  • src/tests/protocol_tests.rs
  • src/tests/registration_tests.rs
  • src/tests/sender_tests.rs
  • src/tests/stall_deselect_tests.rs
  • tests/parser_proptest.rs
  • tests/srtla_wire_conformance.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sans-io

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@datagutt
datagutt deleted the sans-io branch July 17, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant