Add bounded Windows socket handoff across IOCP shards - #2
Merged
Conversation
renerocksai
marked this pull request as ready for review
September 6, 2026 16:23
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.
Windows
--shards 3now runs three independent IOCP owners behind one exclusive listener. Previously, Windows rejected multiple shards. Shard zero accepts connections and handles its round-robin share; the cluster creates no extra acceptor thread.Each accepted socket retains one shared admission charge through transfer, queue residence, and adoption. Destinations associate sockets with their own IOCP before receiving request bytes. Fixed queues transfer only socket metadata. Original deadlines and separate cancellation ownership remain intact. Receivers acquire the publication-completion flag before their final queue-empty check, so shutdown cannot abandon a final transfer.
The PR preserves the callback/writer API, Linux scheduling, and macOS topology. It adds deterministic ownership fixtures, nine native Windows wire cases, an illustrated architecture section, and a pinned evidence packet. The new SVG is included in both the offline whitepaper and the Markdown reader.
Windows defaults to one shard. Explicit inline configurations permit 1–64 owners within the startup memory budget; native fixtures exercise 1–4. Each owner still reserves the full connection capacity. Admission includes queued and transferring sockets, with one additional accept staging socket and one listener outside that count. Provider resources remain outside framework heap accounting. Application callbacks on separate shards can run concurrently and must obey the existing ownership contract.
Validation on final pushed head
419de5445901a87ea6973020df5b13a420917483, using exact Zig 0.16.0:Final Windows run 34044844060 executed the exact PR head. Final live connections, live operations, and late allocations were zero. The final documentation build and nine browser cases passed, including diagrams, rendered Markdown, mobile layout, offline viewing, and printing.
The candidate report preserves the initial qualified implementation, raw commands, exact host metadata, source hashes, watchdogs, and artifact digest. Later gates remain associated with their actual workflow commits; no cross-compilation is promoted to runtime evidence.
Windows throughput, ARM64, service integration, and physical deployment remain unqualified. macOS distribution remains queued. The wiki should ingest the merged implementation and report after review and merge; its M3-006 remains postponed.