test: add big-endian architecture Miri validation#150
Conversation
Add powerpc64-unknown-linux-gnu (big-endian) target to the Miri test matrix, aligning with serde_json's QA practices. Changes: - CI: add powerpc64 Miri FFI tests (ffi_smoke, ffi_cursor, ffi_strings, ffi_ops_interleave) using scalar scanner only - Tests: fix c_char signedness for cross-platform compatibility (char is unsigned on PowerPC, signed on x86) - Docs: add ENDIAN NOTE to src/scan/avx2.rs documenting that the AVX2 scanner is x86_64-only and relies on ISA-fixed bit semantics The c_char fix demonstrates the value of big-endian testing: it caught a latent ABI mismatch that would have broken FFI calls on platforms where char defaults to unsigned. Closes #148
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR implements big-endian (PowerPC64) architecture validation in the Miri CI test matrix and improves FFI type safety across the test suite by using ChangesBig-Endian Testing Infrastructure and FFI Type Correctness
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
Add powerpc64-unknown-linux-gnu (big-endian) target to the Miri test matrix, aligning with serde_json's QA practices for endianness validation.
Changes
c_charsignedness for cross-platform compatibility —charis unsigned on PowerPC, signed on x86. Changedas *const i8toas *const c_charin 6 test filessrc/scan/avx2.rsdocumenting that the AVX2 scanner is x86_64-only and relies on ISA-fixed bit semantics rather than memory byte orderWhy the c_char fix matters
The big-endian Miri test immediately caught a latent ABI mismatch: test files were casting byte pointers to
*const i8, but FFI functions expect*const c_char. On PowerPC (and ARM in some configurations),c_charisu8, noti8. This would have broken FFI calls on those platforms.This demonstrates exactly why big-endian testing is valuable — it surfaces cross-platform assumptions that don't manifest on x86_64.
Verification
cargo test --release)make lint)Closes #148
Summary by CodeRabbit
Tests
Documentation