refactor(client): move probe scheduling out of SessionMachine #40

Merged
Lochnair merged 2 commits from refactor/probe-scheduling into main 2026-08-03 17:16:21 +00:00
Lochnair commented 2026-08-03 17:13:17 +00:00 (Migrated from github.com)

Summary

Move probe cadence and finite-run scheduling from SessionMachine into a
crate-private ProbeSchedule owned by the blocking client and each managed
target.

Architectural rationale

SessionMachine now owns only protocol lifecycle, sequence allocation, pending
probes, reply classification, and terminal protocol state. Scheduling deadlines,
finite-run boundaries, cadence advancement, and missed-slot handling have one
separate owner.

This preserves absolute opening-time cadence, exclusive finite-run completion,
missed-slot skipping, and the requirement to drain pending replies after the
final scheduled send.

Test stabilization

Replace the burst and staggered pacing tests' opposing 20 ms loopback thresholds
with deterministic explicit-Instant assertions over private scheduling
helpers. Existing loose multi-target loopback smoke coverage remains.

Testing

  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo test --workspace
  • cargo test -p irtt-client --no-default-features
  • cargo clippy -p irtt-client --all-targets --no-default-features -- -D warnings
  • Focused managed pacing, delayed pacing, target-update, finite-run, and
    pending-reply tests
  • Five repeated passes of both deterministic pacing replacements
## Summary Move probe cadence and finite-run scheduling from `SessionMachine` into a crate-private `ProbeSchedule` owned by the blocking client and each managed target. ## Architectural rationale `SessionMachine` now owns only protocol lifecycle, sequence allocation, pending probes, reply classification, and terminal protocol state. Scheduling deadlines, finite-run boundaries, cadence advancement, and missed-slot handling have one separate owner. This preserves absolute opening-time cadence, exclusive finite-run completion, missed-slot skipping, and the requirement to drain pending replies after the final scheduled send. ## Test stabilization Replace the burst and staggered pacing tests' opposing 20 ms loopback thresholds with deterministic explicit-`Instant` assertions over private scheduling helpers. Existing loose multi-target loopback smoke coverage remains. ## Testing - `cargo fmt --all -- --check` - `cargo check --workspace` - `cargo test --workspace` - `cargo test -p irtt-client --no-default-features` - `cargo clippy -p irtt-client --all-targets --no-default-features -- -D warnings` - Focused managed pacing, delayed pacing, target-update, finite-run, and pending-reply tests - Five repeated passes of both deterministic pacing replacements
Sign in to join this conversation.