Skip to content

select: validate and expand Windows descriptor capacity - #9021

Merged
youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:fix-windows-select-capacity
Oct 9, 2026
Merged

youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:fix-windows-select-capacity

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Scope

Match Python 3.14's Windows select.select() capacity of 512 entries. RustPython currently uses the Windows SDK default of 64.

This draft deliberately starts with a regression-only commit. Its Windows RustPython snippet is expected to fail on the current baseline; that failure will establish native-platform evidence before the implementation is added to the same draft branch. The existing workflow runs the CPython reference and RustPython on Windows. The implementation and subsequent verification will remain in this PR's commit history and checks.

Regression

  • Ordinary local socket pairs, with no external network service.
  • Successful readiness selection for 65 entries on all supported hosts.
  • Successful readiness selection for 512 entries on Windows.
  • Windows rejection of a 513-entry input remains required.
  • Existing select regression assertions stay unchanged.

Evidence at draft creation

  • CPython 3.14 explicitly defines Windows FD_SETSIZE as 512: selectmodule.c.
  • The focused snippet passes through the repository's pytest runner on CPython 3.14.7 and the current Linux RustPython baseline.
  • The existing Windows CI environment has already run this snippet's 4096-socket setup successfully on both interpreters. The new capacity assertions still require their own Windows result.
  • Normal repository commit hooks pass.

This is a Python 3.14 compatibility extraction from #8954. No Python 3.15 API or test-expectation changes are included.

AI assistance: OpenAI Codex assisted with source comparison, regression design, implementation preparation, and automated verification under the user's direction. No manual Windows validation is claimed.

Add local-socket readiness coverage for 65 entries and the Windows 512-entry limit, preserving 513-entry rejection. This regression-only commit intentionally leaves the current Windows 64-entry defect visible before the implementation is added.

AI assistance covered regression design, CPython 3.14 source comparison, and automated Linux baseline/reference testing. No manual Windows validation is claimed.

Assisted-by: Codex:model-version-unavailable
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eafeccab-b928-4a40-b895-d6317d64a220

📥 Commits

Reviewing files that changed from the base of the PR and between bd8fdb7 and bca89e6.


📒 Files selected for processing (2)
  • crates/host_env/src/select.rs
  • extra_tests/snippets/stdlib_select.py

 ________________________________________
< If it was easy, it'd be called printf. >
 ----------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed

codspeed Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:fix-windows-select-capacity (4de6987) with main (bd8fdb7)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Use a 512-entry WinSock fd_set with checked C layout and scan its returned socket array. Keep the SDK default-size declaration at the FFI boundary only.

The preceding regression-only commit passed CPython 3.14.7 on hosted Windows and failed RustPython at the first 65-socket selection. Windows-GNU host_env cargo check and Clippy with warnings denied pass. The fixed native Windows runtime result remains pending CI.

AI assistance covered source comparison, implementation, regression design, and automated verification. No manual validation is claimed.

Assisted-by: Codex:model-version-unavailable
@youknowone
youknowone marked this pull request as ready for review October 9, 2026 14:25
@youknowone
youknowone merged commit fe984ce into RustPython:main Oct 9, 2026
29 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T14:30:30.420035Z bca89e6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bca89e687c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".



# Windows supports up to 512 entries, above the Windows SDK default of 64.
for count in (65, 512) if sys.platform == "win32" else (65,):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the disallowed test-file changes

This newly added loop introduces test data, control flow, and assertions in a test file, but the root AGENTS.md limits test-file modifications to adding or removing expected-failure markers. Remove this regression block from the test file (or update the repository policy before landing it).

AGENTS.md reference: AGENTS.md:L275-L279

Useful? React with 👍 / 👎.

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.

2 participants