Make borrow-state tests portable to 32-bit targets

Open Beginner friendly
#565 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
numpy, rust
Domain
testing-qa

Research direction

Start with the borrow-state tests and locate the assertions on the process-global n_flags count. Run the no-feature test suite on a 32-bit target and compare it with a 64-bit target, keeping the array-count and safety checks intact. Done means the exact count checks no longer fail because of architecture-specific registry behavior.

Written by the indexing model from the issue text.

Description

The borrow-state tests assert exact values of the process-global borrow-flag count. On Debian i386, the no-feature test suite can observe an additional registered flag and fails with an assertion such as left: 2, right: 1, while the array-count and safety checks remain valid.

The exact n_flags assertions should either be made architecture-independent or limited to targets where the underlying registry behavior is deterministic. This was found while packaging rust-numpy 0.28.0 for Debian unstable.

A Debian-side patch currently gates the exact n_flags assertions to 64-bit targets while preserving the other borrow-state checks. The corresponding i386 build passes with that patch.

Dominant language
Rust
Stars
1.4k
Forks
141
Avg merge
16m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PyO3/rust-numpy

All issues in PyO3/rust-numpy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.