Skip to content

Reject conflicting member layouts in multiple inheritance - #9041

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-slotted-base-layout-conflicts
Oct 10, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-slotted-base-layout-conflicts

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Reject multiple-inheritance bases with conflicting slot-member layouts, matching CPython 3.14. RustPython's prefix member cells do not change basicsize, so include member_count when choosing a solid base.

Extracted from #8954 without its broader layout-assignment changes. Existing native payload/layout safeguards are preserved. The existing type snippet covers conflicting base orderings, an empty-slot-compatible base, and a shared-slot diamond.

Validation:

AI-assisted implementation, tests, and review with OpenAI Codex. Kept as a draft for CI and maintainer review.

Extract the Python 3.14-compatible solid-base check from RustPython#8954. Prefix member cells contribute to instance layout even though they do not change basicsize. Include member_count in shape comparison while preserving all native layout safeguards, and cover conflicting and compatible bases in the existing type snippet.

Assisted-by: OpenAI Codex:model identifier unavailable
@coderabbitai

coderabbitai Bot commented Oct 10, 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: be6ab164-3296-4b91-872f-448a0c559f44

📥 Commits

Reviewing files that changed from the base of the PR and between 3af5f8a and fddd43d.


📒 Files selected for processing (2)
  • crates/vm/src/builtins/type.rs
  • extra_tests/snippets/builtin_type.py

 __________________________________________________________________________________________________
< Estimate to avoid surprises. Estimate before you start. You'll spot potential problems up front. >
 --------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ 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.

@youknowone
youknowone marked this pull request as ready for review October 10, 2026 10:34
@youknowone
youknowone merged commit 9c8b745 into RustPython:main Oct 10, 2026
21 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 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-10T10:39:34.681671Z fddd43d 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: fddd43d269

ℹ️ 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".

Comment on lines +761 to +764
with assert_raises(TypeError):

class Conflict(Left, Right):
pass

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-logic block

This appended scenario changes test logic and assertions in extra_tests/snippets/builtin_type.py, but the root AGENTS policy explicitly limits test-file modifications to adding or removing expected-failure decorators and related TODO comments. Remove this block or obtain an explicit policy exception before landing it.

AGENTS.md reference: AGENTS.md:L273-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