Skip to content

TST: fix POWER VSX feature mapping (#30801)#31079

Merged
charris merged 1 commit intonumpy:maintenance/2.4.xfrom
charris:backport-20801
Mar 26, 2026
Merged

TST: fix POWER VSX feature mapping (#30801)#31079
charris merged 1 commit intonumpy:maintenance/2.4.xfrom
charris:backport-20801

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Mar 26, 2026

Backport of #30801.

** Problem**
On POWER systems, the CPU feature tests check for a literal "VSX" flag in AT_HWCAP. However, Linux never reports a "VSX" auxv flag. VSX is a baseline capability implied by POWER ISA ≥ 2.06, so the test-side detection incorrectly reports VSX as unavailable, causing false failures on POWER (e.g. Power10,power9).

turns out theres another issue too - on some POWER systems AT_HWCAP shows up in hex format like 0xdc0065c2 instead of the string format with actual flag names. the existing load_flags_auxv() only works with string format so it just fails when its hex.

This PR

  1. Maps VSX to ARCH_2_06, VSX2 to ARCH_2_07, VSX3 to ARCH_3_00, and VSX4 to ARCH_3_1B (fixed typo from ARCH_3_1)
  2. Parses AT_PLATFORM to figure out the POWER generation (power7, power8, power9, power10 etc)
  3. Uses the platform info to add the right ARCH flags based on which POWER version it is
  4. Works on both hex and string AUXV formats now

Changes
1.fixed the features_map with correct ISA levels
2.rewrote load_flags() to check AT_PLATFORM and infer ISA levels from that
3.added _get_platform() helper to get the platform string

Note
test-only change, no runtime behavior modified. should work on both POWER9 and POWER10 now.

Fixes gh-30529

@charris charris added this to the 2.4.4 release milestone Mar 26, 2026
@charris charris added 05 - Testing 08 - Backport Used to tag backport PRs labels Mar 26, 2026
@charris charris merged commit 533a6db into numpy:maintenance/2.4.x Mar 26, 2026
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 - Testing 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants