Cache x86 checksum SIMD feature detection#1929
Merged
Merged
Conversation
This was referenced May 1, 2026
oferchen
added a commit
that referenced
this pull request
May 4, 2026
…dling (#1929, #1930) (#3608) * fix(fast_io): IOCP writer_from_file overlapped flag + typed error handling (#1929, #1930) #1929: IOCP writer_from_file now correctly handles std::fs::File handles that lack FILE_FLAG_OVERLAPPED. Under IocpPolicy::Enabled the path is recovered via GetFinalPathNameByHandleW, the original handle is dropped, and the file is reopened through IocpWriter::create_for_append with FILE_FLAG_OVERLAPPED. Anonymous handles (pipes, unnamed temp files) are rejected with a clear ErrorKind::Unsupported message that names the underlying FILE_FLAG_OVERLAPPED requirement. IocpPolicy::Auto silently falls back to standard buffered I/O on any failure. #1930: Two Win32 error codes are now mapped to typed IocpError variants: - ERROR_INVALID_PARAMETER (87) -> IocpError::InvalidOperation, returned by WriteFile/ReadFile/GetQueuedCompletionStatus(Ex) call sites in the file reader, file writer, and completion pump. Maps to io::ErrorKind::InvalidInput. - ERROR_INSUFFICIENT_BUFFER (122) -> IocpError::InsufficientBuffer. The pump drain loop transparently doubles its OVERLAPPED_ENTRY buffer (capped at 8192 entries / 256 KiB) and retries, only surfacing the typed error if the cap is reached. Maps to io::ErrorKind::OutOfMemory. Both variants implement From<IocpError> for io::Error, so existing io::Result-returning APIs remain backwards compatible. Cross-platform stub mirrors the type for compile parity. Tests added (Windows-gated): - writer_from_file_enabled_reopens_with_overlapped: real file handle reopened as Iocp variant, content writes succeed. - writer_from_file_enabled_rejects_anonymous_handle: CreatePipe handle yields ErrorKind::Unsupported with FILE_FLAG_OVERLAPPED in the message. - writer_from_file_auto_falls_back_for_anonymous_handle: Auto policy never errors on a regular file (Iocp or Std both acceptable). - pump_drains_burst_larger_than_batch_size: 4x batch-size completion burst dispatches without loss, exercising the dynamic-growth path. - iocp_error_insufficient_buffer_round_trips: typed variant maps to OutOfMemory and preserves request/capacity in the message. - error.rs: 6 unit tests covering both variants, code recognition helpers, and classify_overlapped_error pass-through. * style: cargo fmt --all
oferchen
added a commit
that referenced
this pull request
May 5, 2026
…dling (#1929, #1930) (#3608) * fix(fast_io): IOCP writer_from_file overlapped flag + typed error handling (#1929, #1930) #1929: IOCP writer_from_file now correctly handles std::fs::File handles that lack FILE_FLAG_OVERLAPPED. Under IocpPolicy::Enabled the path is recovered via GetFinalPathNameByHandleW, the original handle is dropped, and the file is reopened through IocpWriter::create_for_append with FILE_FLAG_OVERLAPPED. Anonymous handles (pipes, unnamed temp files) are rejected with a clear ErrorKind::Unsupported message that names the underlying FILE_FLAG_OVERLAPPED requirement. IocpPolicy::Auto silently falls back to standard buffered I/O on any failure. #1930: Two Win32 error codes are now mapped to typed IocpError variants: - ERROR_INVALID_PARAMETER (87) -> IocpError::InvalidOperation, returned by WriteFile/ReadFile/GetQueuedCompletionStatus(Ex) call sites in the file reader, file writer, and completion pump. Maps to io::ErrorKind::InvalidInput. - ERROR_INSUFFICIENT_BUFFER (122) -> IocpError::InsufficientBuffer. The pump drain loop transparently doubles its OVERLAPPED_ENTRY buffer (capped at 8192 entries / 256 KiB) and retries, only surfacing the typed error if the cap is reached. Maps to io::ErrorKind::OutOfMemory. Both variants implement From<IocpError> for io::Error, so existing io::Result-returning APIs remain backwards compatible. Cross-platform stub mirrors the type for compile parity. Tests added (Windows-gated): - writer_from_file_enabled_reopens_with_overlapped: real file handle reopened as Iocp variant, content writes succeed. - writer_from_file_enabled_rejects_anonymous_handle: CreatePipe handle yields ErrorKind::Unsupported with FILE_FLAG_OVERLAPPED in the message. - writer_from_file_auto_falls_back_for_anonymous_handle: Auto policy never errors on a regular file (Iocp or Std both acceptable). - pump_drains_burst_larger_than_batch_size: 4x batch-size completion burst dispatches without loss, exercising the dynamic-growth path. - iocp_error_insufficient_buffer_round_trips: typed variant maps to OutOfMemory and preserves request/capacity in the message. - error.rs: 6 unit tests covering both variants, code recognition helpers, and classify_overlapped_error pass-through. * style: cargo fmt --all
This was referenced May 5, 2026
oferchen
added a commit
that referenced
this pull request
May 7, 2026
…3871) Document the 10000-file / 32-thread stress workload, completion-port queue-depth and latency metrics, and disk-full / ENOMEM failure injection cases that gate the Windows IOCP disk-commit path before it is declared production-ready. Cites the #1899 IOCP benchmark and the in-flight #1929 / #1930 hardening work.
This was referenced May 14, 2026
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…3871) Document the 10000-file / 32-thread stress workload, completion-port queue-depth and latency metrics, and disk-full / ENOMEM failure injection cases that gate the Windows IOCP disk-commit path before it is declared production-ready. Cites the #1899 IOCP benchmark and the in-flight #1929 / #1930 hardening work.
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
internal docsand cover the behaviour with a dedicated unit testTesting
https://chatgpt.com/codex/tasks/task_e_6909a6b5de688323843bbbc8d20f9db6