Repository navigation
Account for SimpleQueue buffer capacity in sizeof - #9415
Merged
youknowone merged 1 commit intoOct 28, 2026
Merged
Conversation
Follow Rust container memory accounting and migrate the canonical Python 3.15 queue tests with scripts/update_lib. Mark only the CPython-specific object-layout size assertion as expectedFailure through explicit updater metadata. Assisted-by: OpenAI Codex: model version unavailable
Contributor
|
Caution Review failedThe pull request is closed. Finishing Touches
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. Comment |
Contributor
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/queue.py dependencies:
dependent tests: (19 tests)
Legend:
|
youknowone
approved these changes
Oct 28, 2026
youknowone
marked this pull request as ready for review
October 28, 2026 08:33
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
youknowdot
pushed a commit
to youknowdot/RustPython
that referenced
this pull request
Oct 28, 2026
Integrate main 07b1cdb after the earlier unpublished main merge, carrying landed RustPython#9415 through RustPython#9420. Preserve queue accounting, fcntl/ioctl buffers, resource limits, complex memoryview and array formats, and Windows registry compatibility with their canonical tests. The automatic Cargo.lock merge adds the stdlib half dependency while preserving the existing Ruff parser vendor override. Other incoming and residual paths remain byte-for-byte with their respective parents. The updater suite passed 226 tests; affected-file hooks passed. No fresh local Rust build or interpreter runtime was run. Local cspell remains deferred to exact-head CI under the user's instruction. AI assistance covered source integration, review and validation. Assisted-by: dot: model version not exposed
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
SimpleQueue's allocated ring-buffer storage in__sizeof__, using the existing Rust container convention: Rust payload size plus buffer capacity times element-reference size.test_queuefrom canonical CPython 3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc) usingscripts/update_lib migrate, then its explicit JSON patch machinery.CSimpleQueueTest.test_simplequeue_sizeof: this assertion encodes CPython'ssimplequeueobjectlayout (?nnPnnP), which differs from Rust's queue and optional semaphore layout. The test is otherwise canonical. No global skips, helper changes, or fabricated CPython memory size.Source comparison
CPython
Modules/_queuemodule.ccounts its object size plus ring capacity;Doc/library/sys.rstexcludes objects merely referred to. Rust'sPyList.__sizeof__uses payload size plus allocation capacity, whilesys.getsizeofadds the Rust object header. The new queue implementation follows those Rust conventions and takes its existing buffer lock. It performs no allocation, traversal, or queue-algorithm change.Validation
cargo fmt --all -- --check: passed.PYTHONPATH=scripts python3 -m unittest discover -s scripts/update_lib/tests).host_env,threading) and stdlib+host_env Clippy: passed.For exact head
cb78d62429f7311ac9dd0a0d4f75bcc60d6dca22, correctness CI passed (14 passed jobs, 2 expected skips), and Lib Dependencies Check passed. Local runtime limitations above remain unchanged. This remains a draft for maintainer review.AI-assisted implementation and source review.