Repository navigation
Validate native subclass object layouts - #8905
Conversation
Assisted-by: Codex:GPT-6
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: RustPython/RustPython/.coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe pyclass derive macro now checks native subclass field offsets, payload offsets, and object alignment. BASICSIZE uses payload layout, PyDict and _IOBase have 8-byte alignment, and tests cover aligned payload size and inherited and derived getters. ChangesNative subclass layout
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No identified layout or allocation issue blocks merging. The compile-fail examples and wasm32 behavior remain unexecuted in the supplied evidence. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new checks appear to prevent incompatible native subclass layouts rather than expose a new runtime entry point. The change still warrants review because it can affect which native subclasses build and how their size is reported, particularly across target architectures. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
#[pyclass(base = ...)]to reject incompatible payload offsets and insufficient object alignment at compile time. Reject enums with a native base.dictand the I/O base payloads to eight bytes so their native subclasses satisfy the checks on wasm32, including theOrderedDict.get()failure reported in fix: OrderedDict.get() crashes on wasi #8896, without boxing their storage.BASICSIZE.AI assistance
Written with Codex (GPT-6), reviewed by a human before submission.
Summary by CodeRabbit