FrankenNumPy

Docs/Guarantees and recipes

NumPy Submodule Coverage Matrix

How each numpy.* submodule is covered by fnp_python. The "Engine" column says whether the call resolves through a Rust kernel or whether it is a tier-3 identity re-export of the live numpy attribute (see Python attribute resolution model). "Overlay" means an fnp module object (fnp_python.X is numpy.X is False) whose names are a mix of NumPy's own objects and fnp functions. Routing below was checked live on 2026-10-08 (numpy 2.4.3) by wrapping the numpy functions before importing fnp_python.

Submodule Engine Notes
numpy (top-level) Mixed Tier-1 native wrappers for the hot surface (sum, mean, var, sort, searchsorted, digitize, where, argwhere, take, put, etc.); tier-3 re-exports for things like np.True_, np.s_, np.newaxis
numpy.fft Mostly delegated Of the 18 entry points only fftfreq is native; the other 17 (rfftfreq, fft, ifft, rfft, irfft, hfft, ihfft, fft2, ifft2, fftn, ifftn, rfft2, irfft2, rfftn, irfftn, fftshift, ifftshift) call numpy.fft (pocketfft). The fnp-ufunc FFT kernels (Cooley–Tukey + Bluestein) serve the Rust API; guarded by fft_and_linalg_python_routing_table_and_negative_controls in conformance_linalg_decomp.rs (bead deadlock-audit-rc0923-epic-71qy3.12)
numpy.linalg Mixed (overlay) 14 conditional routes (matmul, solve, inv, cholesky, eigvalsh, svdvals, pinv, matrix_rank, cond, norm, matrix_norm, lstsq, matrix_power, multi_dot) execute natively inside measured win gates / dtypes and delegate to numpy.linalg outside them; 14 routes (det, slogdet, eigh, eig, eigvals, svd, qr, tensorsolve, tensorinv, vector_norm, matrix_transpose, vecdot, outer, tensordot, diagonal, trace, cross) delegate at the fnp.linalg boundary. Top-level fnp.solve_triangular is a documented FrankenNumPy extension matching scipy.linalg.solve_triangular (native for real and complex). Guarded by fft_and_linalg_python_routing_table_and_negative_controls and linalg_answer_does_not_depend_on_the_operand_container in conformance_linalg_decomp.rs (bead deadlock-audit-rc0923-epic-71qy3.12)
numpy.random Native (overlay) Generator, RandomState, SeedSequence and all 5 bit generators are native Rust classes; distributions run through the ported NumPy algorithms with bit-exact PCG64DXSM parity
numpy.polynomial NumPy + native evaluators and fits (overlay) Each family module (polynomial, chebyshev, legendre, hermite, hermite_e, laguerre) is NumPy's namespace, object for object, except two functions. Its series evaluator (polyval, chebval, legval, hermval, hermeval, lagval) is native and byte-identical to NumPy for float64 arrays and Python floats with 1-D coefficients. Its least-squares fit (polyfit, chebfit, legfit, hermfit, hermefit, lagfit) builds the design matrix and column norms natively, in NumPy's order, and solves with NumPy's own linalg.lstsq, byte-identical for finite float64 / int64 x and y with an int deg, no w and full=False. Other inputs, and rank-deficient fits, go to NumPy. The classes (Polynomial, Chebyshev, …) and polyutils are NumPy's. The Rust-API families live in fnp-ufunc
numpy.ma Overlay fnp module carrying numpy.ma's names, some replaced by fnp functions; the Rust MaskedArray serves the Rust API
numpy.char Overlay fnp module carrying numpy.char's names, some replaced by native fnp functions; the Rust StringArray with the 33 elementwise char functions serves the Rust API
numpy.strings Overlay fnp module carrying numpy.strings' names, some replaced by native fnp functions
numpy.rec Re-export Re-export of upstream numpy.rec (record arrays)
numpy.emath Re-export Re-export of upstream numpy.emath (we also expose scimath natively under top-level)
numpy.matrixlib Re-export Re-export of upstream numpy.matrixlib
numpy.testing Overlay fnp module carrying numpy.testing's names, some replaced by fnp functions
numpy.typing Re-export Re-export of upstream numpy.typing
numpy.ctypeslib Re-export Re-export of upstream numpy.ctypeslib
numpy.core Re-export Re-export of upstream numpy.core (internal compatibility surface)
numpy.f2py Re-export Re-export of upstream numpy.f2py
numpy.lib Overlay fnp module carrying numpy.lib's names, with tier-1 wrappers where there is a native path
numpy.dtypes Overlay fnp module whose public names are all NumPy's own numpy.dtypes objects
numpy.exceptions Overlay fnp module whose public names are all NumPy's own exception classes, so exception identity is preserved

The mixed-tier-3 strategy is what enables the 100% surface guarantee: any name that exists on numpy.<X> exists on fnp_python.<X> automatically when it is exposed through a re-exported submodule. The structural-lock-in test verifies the same property for the top-level numpy.__all__.


This section in the README on GitHub