Skip to content

MSVC TCP throughput fixes for P2pStream (IOCP recv/send pending, queue prefix, 65536 B Win recv) - #561

Merged
NikolayChirkov merged 15 commits into
mainfrom
fix/main-msvc-winrecv-minimal
Oct 23, 2026
Merged

NikolayChirkov merged 15 commits into
mainfrom
fix/main-msvc-winrecv-minimal

Conversation

@NikolayChirkov

Copy link
Copy Markdown
Collaborator

Summary

  • Fix Win IOCP pending flags on synchronous WSARecv/WSASend success paths.
  • Fix PacketQueueManager to pop only contiguous finished prefix at queue front.
  • Fix ApiContext lifetime in make_api_call_sender Operation::start.
  • Stop re-enqueue on TCP Send()==0; WinTcp user recv buffer fixed at 65536 B (production default).
  • Add three PacketQueueManager regression tests in test-transport.

Throughput (harness single-pair topology 1b, external bench)

Payload 64512 B, inflight 8, 65536 B recv: median active goodput ~10.28 MiB/s; successful runs ~10.8-11.5 MiB/s vs prior stuck low single-digit MiB/s before these client fixes.

Test plan

  • Release test-transport (3 queue regressions PASS)
  • Windows topology 1b smoke 2 MiB: 100% delivery

Made with Cursor

NikolayChirkov and others added 15 commits October 20, 2026 08:55
Co-authored-by: Cursor <cursoragent@cursor.com>
Set is_recv_pending_ when WSARecv returns success so IOCP OnRead can deliver bytes through HandleRecv without dropping sync completions.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep per-frame WriteAction completion as sent_offset crosses segment ends; host stays inflight until the merged buffer is fully sent.

Co-authored-by: Cursor <cursoragent@cursor.com>
Emit host frame status without Action::Finish until all segment tasks complete; add queue regression tests in test-transport.

Co-authored-by: Cursor <cursoragent@cursor.com>
Track send_started_ before Send even when zero bytes are written; add pending-socket regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
…tity.

Absorb by reference with batch_host_ delegation; merge only data buffers and clear host links when the batch Action finishes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace index walk with repeated front pop; add queue regression tests for finished/pending/finished ordering.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore single-frame SendAction; keep PacketQueueManager finished-prefix pop and WinTcpSocket 65536 recv buffer.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…r sizing.

Co-authored-by: Cursor <cursoragent@cursor.com>
…des and add queue regressions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@NikolayChirkov
NikolayChirkov merged commit 8e465bc into main Oct 23, 2026
12 checks passed
@NikolayChirkov
NikolayChirkov deleted the fix/main-msvc-winrecv-minimal branch October 23, 2026 20:08
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