Repository navigation
Add the Array API development skill - #989
Open
Alexboiboi wants to merge 1 commit into
Open
Alexboiboi wants to merge 1 commit into
Alexboiboi wants to merge 1 commit into
Conversation
This was referenced Aug 29, 2026
Alexboiboi
force-pushed
the
feat/skill-array-api
branch
from
August 29, 2026 22:42
c3cec05 to
abf976d
Compare
8 tasks
Alexboiboi
force-pushed
the
feat/skill-array-api
branch
from
August 31, 2026 20:08
93f8907 to
1b50aa1
Compare
A repository skill for implementing and reviewing Magpylib's Array API work: namespace dispatch at a stable boundary, kernel ports, per-capability claims with the tests that back them, and two bundled references -- the current official guidance, and an inventory of prior Magpylib Array API work. All five contract decisions -- target version, compatibility delivery, rollout gate, mixed inputs, capability matrix -- are posed as open questions with a recommended default, so merging the skill does not ratify a maintainer decision by merge rather than by discussion. Version facts come from changelogs and the installed `__array_api_version__`, not from project landing pages: `array-api-compat` has targeted 2025.12 since 1.14.0 (2026-02-26) while its landing page still says 2024.12. An older target is pinned through `set_array_api_strict_flags` when chosen deliberately. Tests use `array_api_extra.testing` rather than `numpy.testing`, which forces every comparison onto NumPy and defeats the point of a converted kernel (raised by @lucascolley on #792). Those assertions check namespace, dtype, shape and device, so a NumPy reference must be converted into the namespace under test first; lazy functions are tagged with `lazy_xp_function` plus `patch_lazy_xp_functions`. The repository-specific guidance comes from #981: `xpx.at` for the 389 indexed assignments in `_src/fields/`, `special_el3.py` rather than `field_BH_cylinder_segment.py` as the hard file, the existing `xp`/`any_` seam in `special_cel.py`, the lazy cost of the data-dependent `cel` loop, and today's silent coercion of foreign arrays to host. The CI rule is reconciled with CPU-only runners. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Alexboiboi
force-pushed
the
feat/skill-array-api
branch
from
August 31, 2026 20:22
1b50aa1 to
9c89b03
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #984. Just the Array API skill now —
magpylib-developmentandprimary-source-researchmoved down to #993, where everything else can reference them too.A 192-line
SKILL.mdand two references: current official guidance (108 lines) and an inventory of prior Magpylib Array API work (89 lines). Both carry their own recheck procedure, because version claims and PR status go stale fast.The skill covers three things.
The five decisions to settle before parallel kernel ports start: standard version, dependency delivery, rollout gate, mixed-input semantics, CI-backed capability matrix. All five are posed as questions with a recommended default. Merging this shouldn't ratify a maintainer decision by merge instead of by discussion — the answers belong in the implementing issue.
The port procedure: resolve the namespace once at one boundary, explicit dtype and device, standard promotion, what breaks under JIT and lazy backends, and where compiled NumPy/SciPy calls have to be fenced off.
Evidence per capability. Backend execution, GPU, JAX JIT, lazy, autodiff, precision and NumPy performance are separate claims, and none of them implies another.
The repo-specific parts come from #981:
xpx.atfor the 389 indexed assignments in_src/fields/,special_el3.pybeing the hard file rather thanfield_BH_cylinder_segment.py, thexp/any_seam already sitting inspecial_cel.py, and the 6–16× lazy penalty on the elliptic kernels.Why this one first: it's the prerequisite for reorganising #792. Its own rule — don't start parallel kernel ports while the contract is unresolved — is what the twelve open Array API PRs should be triaged against, so it needs a merged home to point at.
Before merge
SKILL.mdL84–85, "do not … add an independent backend selector": scope it to array namespaces. Formula providers (e.g. pymagba) are decision 6 in Support Array API Standard for Python. #792, still open.