FrankenNumPy

Docs/Evidence

Parity Status

parity_green below means the family's conformance suites pass against NumPy; it is not a claim that no divergence remains. Known open gaps (2026-09-23), each tracked under epic deadlock-audit-rc0923-epic-71qy3:

  • allocation failure outside the NEP 18 dispatcher and ufunc objects surfaces as a catchable PanicException, not MemoryError; the float16 routes of setdiff1d/searchsorted widen to float32 and can raise MemoryError under a memory cap NumPy fits (.31 residual).
  • cov / corrcoef: the native no-FMA Gram path engages only where it measured faster than NumPy (fewer than 48 variables at small work; 256-511 variables with at least 2,048 observations; 512 or more variables only with a serial BLAS) and differs from NumPy in the last bits there (bounds in ledger row DIV-COV-GRAM-NO-FMA); every other shape returns NumPy's bytes. Peak memory matches NumPy's: 1.0002x on a (32768, 8) operand, and both raise MemoryError at the same address-space cap (.7, guarded by cov_and_corrcoef_peak_memory_stays_within_numpys).
  • Fixed 2026-09-24 (bead .8, found by keyword/dtype/layout sweeps against NumPy): take(mode="clip") with a list index; argwhere and unravel_index result layouts; lexsort on keys holding ±0.0 or sign-bit NaNs; unique_counts/unique_inverse/unique_all keep NaNs apart; float16 unique/union1d keep NumPy's zero; einsum(..., optimize=True) returns NumPy's type, layout and bits; float64 trace sums the diagonal in NumPy's order.
  • Fixed 2026-09-24 (bead .29): the sum-family reductions (nansum, nanmean, var, std, nanvar, nanstd, norms, masked_sum, and their float32/float16 lane forms) follow the installed NumPy's reduction tree, including NumPy before 2.3, which sums in 8192-element chunks; nan-reductions of Python lists and byte-swapped arrays match NumPy; norm(x, ord=±1) over matrices adds columns in NumPy's order; importing fnp_python no longer appends to NumPy's own __all__ lists (numpy.strings, numpy.char, numpy.testing, numpy.lib), which also made it importable under NumPy 2.2.
  • Fixed 2026-09-24 (bead .5): every NumPy ufunc name is an fnp object that passes isinstance(x, numpy.ufunc), reports NumPy's nin/nout/nargs/identity/signature/types, and whose __call__ (out=/where=/dtype=/casting=), reduce, accumulate, outer, reduceat and at return NumPy's bytes over eight dtypes.
  • Fixed 2026-09-24 (bead .31): a failed allocation raises MemoryError through the NEP 18 dispatcher and ufunc objects instead of aborting the interpreter; min/max of bool arrays (which never reached their bool kernel and were 5,000x slower than NumPy at 2**23 elements), histogram of bool, the set operations, extract, logical_not, isposinf/isneginf, convolve/correlate, ediff1d, count_nonzero, bitwise_count and roll stopped building float64 copies of narrow operands.
  • Fixed 2026-09-24 (bead .8): ndarray subclasses (np.matrix, MaskedArray, memmap, user subclasses) get NumPy's result class, mask and matrix rules (trace of a MaskedArray used to count masked elements); empty, 0-d and length-1 operands never panic (argmin(axis=0) of a (4, 0) array, cov of a (0, 4) one) and match NumPy across all callables; concatenate(arrays, None) flattens; np.complex128/np.complex64 endpoints of linspace/geomspace/logspace keep their imaginary part; percentile/quantile with a 1-element or (1, 1) q no longer depend on the installed NumPy; eye/identity refuse a bool size; trapz/in1d emit NumPy's DeprecationWarning; float var/std along an axis and float16 cumprod emit NumPy's floating-point warnings (.26).
  • Fixed 2026-09-24 (bead .26): the native kernels report NumPy's floating-point events. Affected: degrees/rad2deg, sinc, unwrap, diff, ediff1d, gradient, i0, kron, outer, cov, sum, trace, trapezoid, polyval, vander, nansum, nanprod, nanvar, nanstd, and the complex/float16 cumsum/cumprod/prod routes. On inf/NaN/overflowing inputs these returned NumPy's values without NumPy's RuntimeWarning, and did not raise under errstate(all='raise'). A non-finite native result now goes to NumPy, and nancumsum/nancumprod replay their float64/float32 events exactly. Probed by array_functions_match_numpy_fp_warnings_and_errors (16,797 cells, three errstate modes) and large_complex_and_float16_accumulations_report_fp_events_like_numpy.
  • Fixed 2026-09-24 (bead .20): a NaN written into an array while sort, argsort, unique, searchsorted or sort_complex was working on it made fnp raise PanicException. Two ways to cause this: another thread's np.copyto, which releases the GIL, or a patched np.empty. fnp now returns, as NumPy does. Also fixed next to those sites:
    • 29 numpy.strings/numpy.char functions raised ValueError on 0-d string arrays;
    • ravel_multi_index silently wrapped an overflowing size;
    • ediff1d accepted a float to_end on a list;
    • take/put mishandled uint64 indices;
    • histogram_bin_edges(bins=None) returned edges;
    • linalg.cholesky(upper=None) raised TypeError.
  • Added 2026-09-24 (bead .30): PCG64, PCG64DXSM and Philox have NumPy's advance(delta) (stream-exact, returns self); SFC64 no longer exposes jumped.
  • Fixed 2026-09-24 (bead .16): median/percentile/quantile now return NumPy's NaN payload; nansum along the only axis of a 1-D float64 array matches NumPy's bits; float64 average is byte-identical to NumPy (its native kernels summed in their own order); the dot/inner/matmul/tensordot/vdot signed-zero tests are re-enabled.
Feature family Status
numpy.__all__ Python surface (499/499 names on the numpy<2.5 CI oracle) parity_green (structurally locked)
NumPy 2.0+ API (unique_all/counts/inverse/values, cumulative_sum/prod, matrix_transpose, vecdot, permuted, trapezoid, unstack) parity_green
Shape/stride/view semantics parity_green
Broadcasting legality parity_green
Dtype promotion/casting parity_green
Core math (ufunc) parity_green
Reductions (NaN-propagating) parity_green
Sorting (NaN-last) parity_green
Set operations parity_green
Indexing parity_green
Polynomials (5 families) parity_green
Statistics parity_green
FFT parity_green (17 of 18 Python entry points delegate to numpy.fft)
String arrays parity_green
Masked arrays parity_green
Datetime/timedelta parity_green
Linear algebra parity_green
Random generation parity_green
I/O (npy/npz) parity_green
Financial parity_green
Scimath parity_green

See docs/planning/FEATURE_PARITY.md for the live matrix with evidence links.


This section in the README on GitHub