Backend deviations#
This page lists accepted differences between backends and the NumPy reference defined in Backend conformance. A deviation is a backend result that is numerically valid but disagrees with NumPy in a way that matters to users — typically a dtype-promotion choice or a default precision. Tolerance-only differences (eigenvector sign, complex sqrt branch within the per-op tolerance) are not deviations.
Each row gives the op, the affected backend(s), what NumPy does, what the backend does, the workaround, and a link to the test that pins the current behavior. When a deviation is removed, the entry stays as a historical note for one minor release.
Accepted deviations#
Op |
Backend(s) |
NumPy behavior |
Backend behavior |
Workaround / test |
|---|---|---|---|---|
|
JAX (default) |
Python floats → |
Python floats → |
Set |
|
Torch |
Python floats → |
Python floats → |
Call |
|
JAX (default) |
NEP 50: promote to |
Keep |
Pre-promote operands with |
|
Torch |
Auto-promotes the real operand to complex; produces a complex result. |
Raises |
Pre-promote the real operand with
|
|
Torch |
Returns a zero array of the matching real dtype. |
Raises |
Guard with |
|
All backends (within tolerance) |
Ascending by eigenvalue. |
Ascending by eigenvalue across NumPy/JAX/Torch/CuPy, but eigenvector signs and complex phases differ. |
Tests compare via the eigenvalue identity |
|
All backends (within tolerance) |
Principal branch. |
Same principal branch; output may differ by ULPs near the branch cut. |
Per-op tolerance loosened to |
|
JAX, Torch |
SciPy |
Numerically valid result; small drift near extreme dynamic ranges. |
Per-op tolerance |
|
JAX, Torch |
SciPy CSR/CSC/COO; full support. |
Best-effort or unsupported; |
Convert to a dense path or do sparse work in NumPy. Pinned in
|
|
NumPy, Torch, CuPy |
n/a (not native). |
Fallback Python loop; semantics match JAX’s |
Parity vs JAX’s native |
|
NumPy, Torch, CuPy |
n/a. |
|
Use |
Closed deviations#
None for 0.4.0.
Reading the workaround column#
The workaround is a code change inside SpaceCore or in user code that restores NumPy-equivalent behavior. It is not an apology for the deviation: each row’s deviation is a documented backend choice, and removing it would require changing the backend, not SpaceCore. If a deviation surprises you, file an issue with the failing test so the matrix entry in Backend conformance can be tightened or a new row added.
Cross-references#
Backend conformance — the normative matrix every deviation refers back to.
Dtype and Scalar-Field Behavior — dtype promotion contract.
Conversion Policy — cross-backend conversion rules and the complex-to-real refusal.
docs/dev/0.4.0-phase-a-inventory.mdsection A6 — the gap inventory this page closes.