Skip to content

Fix dtype layout tests on 32-bit targets - #564

Open
heiserhorn wants to merge 1 commit into
PyO3:mainfrom
heiserhorn:fix-i386-dtype-layout
Open

Fix dtype layout tests on 32-bit targets#564
heiserhorn wants to merge 1 commit into
PyO3:mainfrom
heiserhorn:fix-i386-dtype-layout

Conversation

@heiserhorn

Copy link
Copy Markdown

Make dtype alignment and aligned-record layout tests portable to 32-bit targets.

On i386, NumPy reports 4-byte alignment for the tested scalar and subarray dtypes, and the aligned record has itemsize 16 and alignment 4. The tests currently hard-code the 64-bit values 8 and 24, causing dtype::tests::test_dtype_methods_record and related tests to fail on i386.

The library behavior is unchanged; the assertions now select the expected values using target_pointer_width. This addresses the i386 failure observed while packaging rust-numpy 0.28.0 in Debian.

@heiserhorn

Copy link
Copy Markdown
Author

The Debian i386 validation is now complete: a clean sbuild of rust-numpy 0.28.0-4 passes with the dtype-layout patch applied.

The follow-up i386 failure was a separate exact borrow-flag-count assertion in borrow::shared::tests::borrow_multiple_arrays (left: 2, right: 1). It is documented in issue #565, with the Debian-side portability patch and successful i386 build details:
#565

Debian MR !1317 now contains both patches in signed commit cd5eb68c16:
https://salsa.debian.org/rust-team/debcargo-conf/-/merge_requests/1317

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.

1 participant