Enable SIMD rolling checksums on x86#1928
Merged
Merged
Conversation
This was referenced May 1, 2026
oferchen
added a commit
that referenced
this pull request
May 1, 2026
Add CompletionPump: a shared completion-port driver that owns a worker thread looping on GetQueuedCompletionStatusEx and dispatches each completion entry to a per-operation handler keyed by the OVERLAPPED pointer. This is the Windows analogue of an io_uring CQE drain and is the foundational building block for the upcoming batched-write API (#1898), the concurrent file/socket paths (#1928-#1932), and the IOCP benchmark harness (#1899). Existing IocpReader/IocpWriter create a private port and inline-call GetQueuedCompletionStatus per operation, so the pump introduces a process-wide proactor without disturbing those single-op paths. Cross-platform: real implementation lives behind #[cfg(all(target_os = "windows", feature = "iocp"))]; non-Windows targets get an Unsupported-returning stub so the crate still compiles on Linux and macOS. All unsafe stays inside fast_io per the workspace unsafe-code policy.
3 tasks
oferchen
added a commit
that referenced
this pull request
May 1, 2026
Adds an IOCP-backed async socket reader/writer that mirrors the io_uring socket surface and dispatches completions through the shared CompletionPump from #1897. Each WSARecv/WSASend issues an OVERLAPPED operation; synchronous completions and WSA_IO_PENDING paths both wait on a oneshot handler registered with the pump, so file I/O and socket I/O share a single drain thread. Mirrors upstream rsync's socket I/O semantics: - recv treats graceful peer close (WSAEDISCON, WSAESHUTDOWN, WSAENETRESET, WSAECONNRESET, WSAECONNABORTED) and STATUS_END_OF_FILE as Ok(0), matching safe_read breaking on n == 0 (target/interop/upstream-src/rsync-3.4.1/io.c:276). - send maps WSAESHUTDOWN/WSAECONNRESET/WSAECONNABORTED to BrokenPipe and returns short counts so the caller's loop re-issues, matching safe_write's partial-write retry (io.c:316-336). Files: - crates/fast_io/src/iocp/socket.rs (new): IocpSocketReader, IocpSocketWriter, SharedPump alias, six tests covering localhost TCP roundtrip, partial 64KB send accounting, peer-shutdown EOF, empty-buffer fast paths, and completion-key override. - crates/fast_io/src/iocp/mod.rs: pub mod socket; (single line) - crates/fast_io/src/iocp_stub.rs: matching stub module so the workspace cross-compiles on Linux and macOS, all methods returning io::ErrorKind::Unsupported. - crates/fast_io/Cargo.toml: add Win32_Networking_WinSock to the windows-sys feature list for WSARecv/WSASend bindings. Cross-platform compile preserved: the real implementation is gated behind cfg(all(target_os = "windows", feature = "iocp")) at the fast_io::iocp module level; non-Windows builds fall through to the stub.
oferchen
added a commit
that referenced
this pull request
May 2, 2026
Adds an IOCP-backed async socket reader/writer that mirrors the io_uring socket surface and dispatches completions through the shared CompletionPump from #1897. Each WSARecv/WSASend issues an OVERLAPPED operation; synchronous completions and WSA_IO_PENDING paths both wait on a oneshot handler registered with the pump, so file I/O and socket I/O share a single drain thread. Mirrors upstream rsync's socket I/O semantics: - recv treats graceful peer close (WSAEDISCON, WSAESHUTDOWN, WSAENETRESET, WSAECONNRESET, WSAECONNABORTED) and STATUS_END_OF_FILE as Ok(0), matching safe_read breaking on n == 0 (target/interop/upstream-src/rsync-3.4.1/io.c:276). - send maps WSAESHUTDOWN/WSAECONNRESET/WSAECONNABORTED to BrokenPipe and returns short counts so the caller's loop re-issues, matching safe_write's partial-write retry (io.c:316-336). Files: - crates/fast_io/src/iocp/socket.rs (new): IocpSocketReader, IocpSocketWriter, SharedPump alias, six tests covering localhost TCP roundtrip, partial 64KB send accounting, peer-shutdown EOF, empty-buffer fast paths, and completion-key override. - crates/fast_io/src/iocp/mod.rs: pub mod socket; (single line) - crates/fast_io/src/iocp_stub.rs: matching stub module so the workspace cross-compiles on Linux and macOS, all methods returning io::ErrorKind::Unsupported. - crates/fast_io/Cargo.toml: add Win32_Networking_WinSock to the windows-sys feature list for WSARecv/WSASend bindings. Cross-platform compile preserved: the real implementation is gated behind cfg(all(target_os = "windows", feature = "iocp")) at the fast_io::iocp module level; non-Windows builds fall through to the stub.
oferchen
added a commit
that referenced
this pull request
May 2, 2026
* feat(fast_io): IOCP socket I/O via WSARecv/WSASend (#1928) Adds an IOCP-backed async socket reader/writer that mirrors the io_uring socket surface and dispatches completions through the shared CompletionPump from #1897. Each WSARecv/WSASend issues an OVERLAPPED operation; synchronous completions and WSA_IO_PENDING paths both wait on a oneshot handler registered with the pump, so file I/O and socket I/O share a single drain thread. Mirrors upstream rsync's socket I/O semantics: - recv treats graceful peer close (WSAEDISCON, WSAESHUTDOWN, WSAENETRESET, WSAECONNRESET, WSAECONNABORTED) and STATUS_END_OF_FILE as Ok(0), matching safe_read breaking on n == 0 (target/interop/upstream-src/rsync-3.4.1/io.c:276). - send maps WSAESHUTDOWN/WSAECONNRESET/WSAECONNABORTED to BrokenPipe and returns short counts so the caller's loop re-issues, matching safe_write's partial-write retry (io.c:316-336). Files: - crates/fast_io/src/iocp/socket.rs (new): IocpSocketReader, IocpSocketWriter, SharedPump alias, six tests covering localhost TCP roundtrip, partial 64KB send accounting, peer-shutdown EOF, empty-buffer fast paths, and completion-key override. - crates/fast_io/src/iocp/mod.rs: pub mod socket; (single line) - crates/fast_io/src/iocp_stub.rs: matching stub module so the workspace cross-compiles on Linux and macOS, all methods returning io::ErrorKind::Unsupported. - crates/fast_io/Cargo.toml: add Win32_Networking_WinSock to the windows-sys feature list for WSARecv/WSASend bindings. Cross-platform compile preserved: the real implementation is gated behind cfg(all(target_os = "windows", feature = "iocp")) at the fast_io::iocp module level; non-Windows builds fall through to the stub. * style(transport): cargo fmt
oferchen
added a commit
that referenced
this pull request
May 5, 2026
Add CompletionPump: a shared completion-port driver that owns a worker thread looping on GetQueuedCompletionStatusEx and dispatches each completion entry to a per-operation handler keyed by the OVERLAPPED pointer. This is the Windows analogue of an io_uring CQE drain and is the foundational building block for the upcoming batched-write API (#1898), the concurrent file/socket paths (#1928-#1932), and the IOCP benchmark harness (#1899). Existing IocpReader/IocpWriter create a private port and inline-call GetQueuedCompletionStatus per operation, so the pump introduces a process-wide proactor without disturbing those single-op paths. Cross-platform: real implementation lives behind #[cfg(all(target_os = "windows", feature = "iocp"))]; non-Windows targets get an Unsupported-returning stub so the crate still compiles on Linux and macOS. All unsafe stays inside fast_io per the workspace unsafe-code policy.
oferchen
added a commit
that referenced
this pull request
May 5, 2026
* feat(fast_io): IOCP socket I/O via WSARecv/WSASend (#1928) Adds an IOCP-backed async socket reader/writer that mirrors the io_uring socket surface and dispatches completions through the shared CompletionPump from #1897. Each WSARecv/WSASend issues an OVERLAPPED operation; synchronous completions and WSA_IO_PENDING paths both wait on a oneshot handler registered with the pump, so file I/O and socket I/O share a single drain thread. Mirrors upstream rsync's socket I/O semantics: - recv treats graceful peer close (WSAEDISCON, WSAESHUTDOWN, WSAENETRESET, WSAECONNRESET, WSAECONNABORTED) and STATUS_END_OF_FILE as Ok(0), matching safe_read breaking on n == 0 (target/interop/upstream-src/rsync-3.4.1/io.c:276). - send maps WSAESHUTDOWN/WSAECONNRESET/WSAECONNABORTED to BrokenPipe and returns short counts so the caller's loop re-issues, matching safe_write's partial-write retry (io.c:316-336). Files: - crates/fast_io/src/iocp/socket.rs (new): IocpSocketReader, IocpSocketWriter, SharedPump alias, six tests covering localhost TCP roundtrip, partial 64KB send accounting, peer-shutdown EOF, empty-buffer fast paths, and completion-key override. - crates/fast_io/src/iocp/mod.rs: pub mod socket; (single line) - crates/fast_io/src/iocp_stub.rs: matching stub module so the workspace cross-compiles on Linux and macOS, all methods returning io::ErrorKind::Unsupported. - crates/fast_io/Cargo.toml: add Win32_Networking_WinSock to the windows-sys feature list for WSARecv/WSASend bindings. Cross-platform compile preserved: the real implementation is gated behind cfg(all(target_os = "windows", feature = "iocp")) at the fast_io::iocp module level; non-Windows builds fall through to the stub. * style(transport): cargo fmt
This was referenced May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_6909a2caa6a08323acf3149f63e0f1f7