Skip to content

Align partial construction and state controls - #9679

Merged
youknowone merged 3 commits into
RustPython:mainfrom
youknowdot:partial-state-controls-group-20261103
Nov 5, 2026
Merged

youknowone merged 3 commits into
RustPython:mainfrom
youknowdot:partial-state-controls-group-20261103

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

  • Keep nested partial keyword dictionaries isolated and flatten only partials whose instance dictionary remains absent.
  • Recognize native Placeholder values, validate trailing placeholders before flattening, and reuse shared constructor argument binding with lazy instance-dictionary allocation.
  • Validate restored state before tuple-subclass callbacks or state changes, preserve supplied instance dictionary identity, and copy keyword subclasses without rehashing stored keys.
  • Preserve absent versus allocated-empty dictionaries in reduction.

Invalid state is rejected before mutation. Successful field replacement remains sequential, matching CPython rather than claiming transactional reentrant updates.

Reference: CPython 3.15.0 partial construction and state restoration.

Validation

  • Eight bounded CPython 3.15 reference groups passed, including fresh-dictionary, flattening, callback, identity, and invalid-state cases.
  • Independent source review caught and resolved an eager-dictionary allocation issue; final formatting and whitespace checks passed.
  • Final focused VM, host-env and stdlib check and strict Clippy with rustpython-stdlib/threading passed. Normal repository commit hooks passed.
  • RustPython runtime, full workspace/C-API suites, and cross-platform execution were not run. No test, Lib, workflow, or marker edits.

AI assistance: OpenAI Codex performed source comparison, implementation, reference probes, and independent source review; model version was not exposed.

Preserve nested keyword ownership and lazy instance dictionaries, use
native Placeholder identity, and share constructor argument binding.
Validate restored state before callback conversion, retain instance dict
identity, and copy stored keyword entries without rehashing keys.

Assisted-by: OpenAI Codex:model version not exposed
PosArgs exposes its borrowed slice through AsRef rather than as_slice.

Assisted-by: OpenAI Codex:model version not exposed
Avoid a redundant strong reference when constructing a nonnested partial.

Assisted-by: OpenAI Codex:model version not exposed
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

@codspeed

codspeed Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:partial-state-controls-group-20261103 (d41e7e0) with main (0b081b0)

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. ↩

@youknowone
youknowone marked this pull request as ready for review November 5, 2026 02:13
@youknowone
youknowone merged commit 3c708b9 into RustPython:main Nov 5, 2026
21 checks passed
@chatgpt-codex-connector

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 ⚠️ Failed 2026-11-05T02:13:45.268561Z
We couldn’t complete this review. Comment @codex review to try again.
d41e7e0 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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