Skip to content

Sans-IO Refactoring - #47

Open
franklee26 wants to merge 3 commits into
mainfrom
frank/sans-io-enforcement
Open

franklee26 wants to merge 3 commits into
mainfrom
frank/sans-io-enforcement

Conversation

@franklee26

Copy link
Copy Markdown
Owner

No description provided.

@github-actions

github-actions Bot commented May 16, 2026 •

Copy link
Copy Markdown

Bluefin throughput bench (macOS) ✅ PASS

Config: 5 run(s) × 2 conn(s) on Darwin arm64

Client throttle: 25 µs sleep every 3000 sends

Retries: 1 of 5 run(s) needed retry (+2 extra attempt(s)). See per-run table.

why retries vary across runs

Hosted CI runners occasionally land on a deeply contended host where both bench peers get starved and a run produces 0 GOOD conns despite no actual code regression. To absorb this without weakening the gate, this job uses an asymmetric retry policy (current values: ON_ZERO=2, ON_PARTIAL=0, backoff 5s):

attempt outcome extra retries granted
all 2 conns good 0 (accept)
1..1 conns good (partial) up to ON_PARTIAL=0
0 conns good (catastrophic) up to ON_ZERO=2

The retry budget is per-run and only shrinks across attempts: once a partial-good attempt has been observed in a run, that run is locked to the partial budget for the rest of its attempts -- it can never be promoted to the larger 0-good budget by a later attempt happening to collapse to 0. Only the final attempt's data is committed to the aggregate stats; earlier attempts' logs are still on disk under the run's attempt_* directory but are not parsed.

So the same code can show 0, 1, or 2 retries on different CI runs purely from runner-allocation luck. The attempts column in the per-run table below shows how many attempts each run took (bold = needed at least one retry).

Aggregate

metric observed floor result
mean avg gb/s (good only) 0.495 0.40 ✅
raw mean avg gb/s 0.366 — —
min avg gb/s 0.072 — —
mean peak gb/s 1.512 — —
max peak gb/s (good only) 1.940 1.30 ✅
good conns 5 / 10 3 ✅

Per-run

run attempts good/N mean avg gb/s (good) max peak gb/s (good) raw max peak gb/s
1 1 2/2 0.50 1.87 1.87
2 1 1/2 0.49 1.63 1.63
3 1 1/2 0.50 1.94 1.94
4 1 1/2 0.48 1.85 1.85
5 3 0/2 — — 1.52

A "good conn" delivered ≥ 700 MB before idle timeout.
"max peak (good only)" filters out kernel-buffer-drain artifacts
that appear as huge inst-throughput readings on starved conns under
runner CPU contention. Floors are env-var overridable:
BLUEFIN_BENCH_FLOOR_MEAN_AVG_GBPS, BLUEFIN_BENCH_FLOOR_MAX_PEAK_GBPS,
BLUEFIN_BENCH_FLOOR_GOOD_CONNS, BLUEFIN_BENCH_GOOD_CONN_MIN_BYTES.
Ratchet up after stable runs land. Script: bench_ci.sh.

@codecov

codecov Bot commented May 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.20670% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.29%. Comparing base (6e8a0a4) to head (44c479d).

Files with missing lines Patch % Lines
bluefin-proto/src/endpoint.rs 93.70% 9 Missing ⚠️
bluefin/src/net/close_handler.rs 97.22% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
+ Coverage   69.13%   71.29%   +2.16%     
==========================================
  Files          24       26       +2     
  Lines        3833     3958     +125     
==========================================
+ Hits         2650     2822     +172     
+ Misses       1183     1136      -47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Frank Lee added 3 commits May 17, 2026 09:50
- new bluefin-io/src/socket/factory.rs exposes tokio_udp_socket + tokio_connected_udp_socket with 32 MiB SO_{RCV,SND}BUF default

- bluefin/src/utils/mod.rs get_udp_socket / get_connected_udp_socket become thin delegating shims; ~50 lines of duplicated socket2 setup removed

- bench unchanged at 2.81/2.82 GB/s
…chitecture skills

Replaces the deleted docs/SANS_IO_MIGRATION.md with a post-mortem documenting
what landed (wire format extraction, Endpoint, CloseFsm, socket factory),
what was reverted (data-path FSMs, ConnectionAdapter mutex, single-task
driver), why (per-conn throughput regression on kernel-bound workload from
serialising recvfrom/sendto in one task), and lessons learned. Full attempt
preserved on branch frank/sans-io-experiment-archive.
@franklee26
franklee26 force-pushed the frank/sans-io-enforcement branch from e8bce23 to 44c479d Compare May 17, 2026 21:48
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