Repository navigation
Fix 32-bit member layout assertions and address member descriptor review - #8882
Conversation
Member definitions carry an internal `PY_ATOMIC` flag taken from `MemberLayout::ATOMIC`, and loads use an atomic access only for atomic storage; extension members never set it. `XMLParser` publishes its new state, `entity` and `target` only after every handler lookup succeeds. `subs_parameters` reads type names only for the error. The unraisable hook prints `<unknown>` when `__module__` fails or is not a str. The builtin function `__reduce__` decides on the bound object alone. Assisted-by: Grok:4.7 Assisted-by: Claude:claude-opus-5-5
The tp_flags assertion compared AtomicU64 with u64 alignment, which differs on i686. The kevent assertion required usize, isize, c_ulong and c_long to be 64-bit. Both now check only what the member cells need. Assisted-by: Grok:4.7 Assisted-by: Claude:claude-opus-5-5
|
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 (7)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThis pull request adds typed member flags and atomic storage selection for member descriptors. It also changes XML parser initialization, native function reduction, TypeVarTuple substitution errors, unraisable-hook formatting, and pointer-width checks. ChangesAtomic member storage
XMLParser initialization
Native function reduction
TypeVarTuple substitution errors
Unraisable hook formatting
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue is established that would prevent merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The descriptor changes warrant design review because they affect extension-facing behavior and concurrent access. The reviewed paths preserve the relevant access controls, and no introduced security issue was established. Some affected behavior remains only partially covered. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 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 |
PY_READONLY, PY_AUDIT_READ, PY_RELATIVE_OFFSET and PY_ATOMIC become the repr(transparent) PyMemberFlags. C extension flags are read with from_bits_retain. Assisted-by: Grok:4.7 Assisted-by: Claude:claude-opus-5-5
Follow-up to #8857. This is the part of #8873 that does not depend on bitflagset; #8873 keeps only the bitflagset switch.
Changes
cargo check(it failed on Expose more attributes as member descriptors #8857):tp_flagslayout assertion comparedAtomicU64alignment withu64alignment, which differ on i686.__flags__is read as anAtomicU64, so only that layout is asserted now.select.keventassertion requiredusize/isize/c_ulong/c_longto be 64-bit. It now only requires that pointer-sized values fit into the 64-bit cells.PY_ATOMICflag onPyMemberDef: a member is loaded atomically only when its storage is atomic. C extension members never set it._elementtree: new state,entityandtargetare published only after every handler lookup succeeds.genericalias: type names are computed only on the error path.<unknown>without a.when__module__is missing or not a str.builtin_function_or_method.__reduce__looks only at the bound object, likemeth_reduce.Test
cargo checkon i686-unknown-linux-gnu: vm, and the full feature set except sqlite (whose C build needs a sysroot locally)crates/capiteststest_types test_descr test_class test_builtin test_xml_etree test_genericalias test_sys test_pickle🤖 Generated with Claude Code
Summary by CodeRabbit