fix: wasm32 runtime ABI table and setter-site offset after #11784/#11786 - #11800
Conversation
|
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 configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe ABI now provides setter-site offsets for a supplied pointer width. Codegen selects the target-width layout when reading setter-site records and widens 32-bit address fields. ChangesSetter-site layout
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable issue is established for the setter-site layout change; it is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change aligns setter-record reads with the compilation target’s pointer width while preserving existing validation before calling setters. Risk is low, with remaining uncertainty around end-to-end 32-bit execution. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
After #11784 and #11786 landed, main had two wasm32 breakages.
crates/perry-codegen/src/wasm32/runtime_abi.tsvwas stale (wasi-check: "regenerate with scripts/runtime_abi_check.py --emit-wasm-abi"). Regenerated.setter_site.rsassertsoffset_of!(Entry, slot) == abi::SETTER_SITE_SLOT_OFFSET, but the entry holdsusizeaddress fields, so on wasm32 the offsets are 12/16/20, not 16/24/32 (E0080).perry-abinow derives the offsets from the pointer width (setter_site_layout), and the runtime assertions stay and check the native-width constants. Codegen asks for the layout of the target it emits for and loads the address fields as i32 + zext on ILP32. The LP64 constants and emitted IR are unchanged.Checked:
cargo fmt --check,--check-wasm-abi,--check-native,scripts/wasi_check.sh(perry-runtime builds for wasm32-wasip2), nativecargo checkof perry-codegen and perry-runtime, and the setter-site runtime test.Summary by CodeRabbit