Skip to content

Conversation

@charris
Copy link
Member

@charris charris commented Sep 6, 2025

Backport #29697.

This PR continues the work from #29678 to improve CPU feature detection in the Meson build system, specifically for the s390x architecture.

Problem:
The current detection for VXE and VXE2 is ambiguous:

  • VXE2: The regex 'VX.*' is overly greedy and could match any string containing “VX”.
  • VXE: The simple match for 'VX' could incorrectly enable VXE on systems that only support VX.

These ambiguities may cause NumPy to compile with unsupported CPU instructions, risking Illegal Instruction crashes or performance issues.

Solution:
This PR replaces the fragile patterns with precise regular expressions using word boundaries (\b):

  • VXE → '\\bvxe\\b'
  • VXE2 → '\\bvxe2\\b'

No changes are made to the feature hierarchy, compiler flags, or test code.

@charris charris added this to the 2.3.3 release milestone Sep 6, 2025
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Sep 6, 2025
@charris charris merged commit f024265 into numpy:maintenance/2.3.x Sep 6, 2025
75 checks passed
@charris charris deleted the backport-29697 branch September 6, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants