Skip to content

feat: align CPU providers with the WheelNext reference plugins - #10

Merged
achimnol merged 1 commit into
mainfrom
topic/wheelnext-cpu-features
Aug 9, 2026
Merged

feat: align CPU providers with the WheelNext reference plugins#10
achimnol merged 1 commit into
mainfrom
topic/wheelnext-cpu-features

Conversation

@achimnol

@achimnol achimnol commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

Aligns the two CPU detection providers with the WheelNext / PEP 817 reference implementations (wheelnext/provider-variant-x86-64, wheelnext/provider-variant-aarch64) so the emitted feature vocabulary matches them as closely as possible.

  • aarch64: real hardware detection. Replaces the hardcoded arch = v8 property with an Armv8.x/v9.x version ladder computed from HWCAP flags via golang.org/x/sys/cpu, emitted as version = 9.0a/8.5a/8.4a/…/8a following the WheelNext value scheme (v8.1 FEAT_LSE/RDM/CRC32, v8.2 FEAT_DPB, v8.3 FEAT_JSCVT/FCMA/LRCPC, v8.4 FEAT_DIT/FHM, v9.0 FEAT_SVE2; Armv9.0 compliance implies Armv8.5, so 8.5a is emitted alongside 9.0a).
  • Per-feature properties on both CPU providers. Each supported CPU flag becomes its own property with value on (x86_64 :: sha_ni :: on, aarch64 :: sve2 :: on, …). The feature lists are taken verbatim from the reference plugins' all_features (56 x86 features, 43 aarch64 features), and detection parses /proc/cpuinfo (flags/Features) via a new shared helper in pkg/providers/cpuinfo.go. Host flags outside the reference list are ignored so the vocabulary stays identical to upstream. On non-Linux hosts only the level/version ladder is emitted, matching archspec's Linux-only feature detection.
  • Upstream's "btiecv" and "asimdrdmatomics" entries are concatenation typos (dead entries that can never match); they are carried as their separated archspec features bti/ecv and asimdrdm/atomics.
  • DESIGN.md §7 provider table updated accordingly.

Breaking change

The aarch64 namespace no longer emits arch = v8; images labeled with the old schema will not match. No in-repo fixtures, demo profiles, or e2e flows used the old schema.

Test plan

  • go test ./... — new table-driven tests: TestSupportedVersions (version ladder incl. missing-prerequisite downgrade), TestParseCPUFlags (canned x86/arm64 cpuinfo, bugs line not misparsed), TestOnFeatures (reference-list intersection).
  • go vet ./..., amd64 build + arm64 cross-build.
  • Manual variant detect on an amd64 host: emits level :: v4,v3,v2,v1 plus 56 reference flags as on.

https://claude.ai/code/session_01EPVqgoDSoJ5Xx3jZ6d1AbX

aarch64: replace the hardcoded arch=v8 property with real detection —
the Armv8.x/v9.x version ladder is computed from HWCAP flags
(golang.org/x/sys/cpu), emitted as version = 9.0a/8.5a/…/8a following
the WheelNext provider-variant-aarch64 value scheme.

Both CPU providers additionally emit one property per supported CPU
flag (feature = "on"), with the feature vocabulary taken verbatim from
the WheelNext reference plugins' all_features lists and detected by
parsing /proc/cpuinfo (Linux; omitted elsewhere). Upstream's "btiecv"
and "asimdrdmatomics" entries are concatenation typos and are carried
as their separated archspec features.

Breaking: the aarch64 namespace no longer emits arch=v8; images
labeled with the old schema will not match.

Claude-Session: https://claude.ai/code/session_01EPVqgoDSoJ5Xx3jZ6d1AbX
@achimnol
achimnol merged commit 046b4b8 into main Aug 9, 2026
2 checks passed
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