Skip to main content
2026-08-30

numpy-ts v1.7.0

Performance release: new WASM SIMD kernels, lower per-call overhead, and the NumPy-compatibility fixes found along the way.numpy-ts is now roughly 1.3x faster than NumPy over the suite (see benchmarks for more details). Coverage grew from 2,390 to 3,513 cases, sweeping every operation across all applicable dtypes.

Breaking

  • einsum_path returns [Array<string | number[]>, string]. The path now carries NumPy’s 'einsum_path' marker as its first element, so the runtime output matches np.einsum_path exactly. Callers indexing into the path must skip element 0; path.slice(1) as number[][].
  • real, real_if_close, round/around (integer input, decimals >= 0) and apply_along_axis now return views, matching NumPy. Writes to a result or to an apply_along_axis callback argument. Call .copy() if you relied on the old copying behavior. base is set on exactly the results that alias, so it is a reliable test rather than a dtype guess. See views and copies.

New WASM SIMD kernels

all_equal (every dtype but float16, with equal_nan variants), compare, rounding, isinf, lcm and bulk_mem; gcd extended to uint32/int64/uint64; bitwise_count now uses i8x16.popcnt, and roll/pad/tile use bulk memory operations. tensordot reshapes to 2-D and delegates to matmul instead of running its own contraction loop.

Fixed

  • 64-bit integer precision in 20+ operations that routed int64/uint64 through a double, collapsing values above 2^53, including bitwise_and/or/xor returning 0 on broadcast and add/subtract/multiply off by one with a size-1 operand. union1d, setxor1d, tensordot and gcd/lcm no longer throw on 64-bit input.
  • reshape/ravel on a sliced view dropped the source offset and returned row-shifted results with no error raised.
  • Stale WASM buffers: iscomplex, isnan, isinf and isnat could return all-true from a recycled buffer the fast path never wrote to.
  • Wrong results from array_equiv on complex input, integer power with a negative array exponent, rint on a non-contiguous integer view, place/putmask with a plain mask or scalar values, and searchsorted on its JS fallback path.
  • Narrow-dtype accumulation now matches NumPy for nancumprod on complex64, nanstd/nanvar on float16, and around/round scaling on float32/float16.
  • Several WASM memory leaks and a latent use-after-free in apply_over_axes. Heap exhaustion now warns once instead of silently degrading to JS-backed arrays.

Internals

ArrayStorage.size is computed once in the constructor rather than on every access; WASM regions register with the FinalizationRegistry once per allocation instead of once per sharing ArrayStorage; and ArrayStorage.empty zeroes bool buffers so predicates can no longer read stale heap.
2026-07-16

numpy-ts v1.6.0

Compile-time dtype typing across the public API. NDArray<D> now tracks its dtype through nearly every operation at zero runtime cost, so results report their exact dtype (add(int32Arr, float32Arr)NDArray<'float64'>) and element access is typed per dtype (bigint for int64/uint64, Complex for complex, number otherwise). See Compile-time dtype tracking.

Breaking

  • Floating-point reductions now preserve narrow floats instead of widening to float64, matching NumPy. std, var, median, percentile, quantile, and the nan* family return float16/float32 for float16/float32 input; var/std on complex64 return float32; round/around upcast bool → float16. Add an explicit .astype('float64') if you relied on the old output.

Notes

  • Validation test suite pinned to NumPy 2.4 (numpy>=2.4,<2.5).
2026-06-19

numpy-ts v1.5.0

Performance release. A large batch of element-wise and reduction operations move from JavaScript into hand-written Zig/WASM SIMD kernels, and the project’s tooling migrates from npm to pnpm.numpy-ts is now, on average 1.25x faster than native NumPy!

Breaking

  • Dropped support for Node 20, which has reached end-of-life. numpy-ts now requires Node 22 or later.

New WASM SIMD kernels

The following operations now run through vectorized WASM kernels (previously JS fallbacks), with integer and complex dtype variants where applicable:
  • Trigonometric: sin, cos, tan
  • Hyperbolic: sinh, cosh, tanh
  • Inverse trig / hyperbolic: arctan, arctan2, arcsinh, arccosh, arctanh
  • Exp / log family: exp, exp2, expm1, log, log1p, logaddexp, logaddexp2
  • Other element-wise: power, heaviside, modulo, sinc
  • Signal: convolve, correlate (relaxed-FMA variants)
  • Strided reductions: argmin, argmax, prod
  • Cumulative: cumsum, cumprod
These share new common SIMD utilities for transcendental functions and complex arithmetic, and redundant relaxed-FMA kernel variants were removed.

Tooling & CI

  • Migrated the toolchain from npm to pnpm (workspaces, CI, and pnpm publish via OIDC Trusted Publishing). Thanks @cyfung1031!
  • Fixed missing DType type export from numpy-ts entrypoint, thanks to @OSquiddy!
  • Validation tests moved from a per-test NumPy process to a per-worker NumPy “server” for faster oracle comparisons.
  • Dependency bumps across dev and bench tooling.
2026-05-16

numpy-ts v1.4.0

NumPy-compatibility release. A wide set of public functions gain the kwargs / overloads they were missing relative to NumPy, and several signatures accept ArrayLike so plain number[] no longer needs np.array(...) wrapping.Small (2-5%) performance regressions due to additional correctness checks which will be optimized in a later release.

Breaking

  • meshgrid (numpy-ts/core only) - default indexing is now 'xy' (NumPy-compatible). Previously core/meshgrid had no options and effectively produced 'ij' shapes. If you import meshgrid from numpy-ts/core and relied on the old behavior, pass { indexing: 'ij' } explicitly. Importers from numpy-ts (the full API) are unaffected - that wrapper already defaulted to 'xy'.

New kwargs / overloads

  • Reductions where / initial / dtype - sum, prod, max/amax, min/amin, all, any now accept a ReductionOpts bag as a 4th argument for masked reductions, seeded accumulation, and dtype-controlled accumulation.
  • argmin / argmax - accept keepdims?: boolean (NumPy 1.22+).
  • ptp - axis widened to number | number[], consistent with the other reductions.
  • average - new returned?: boolean. When true, returns [avg, sum_of_weights] matching np.average(..., returned=True).
  • concatenate / concat - axis widened to number | null. axis=null flattens each input and concatenates along axis 0.
  • diff - new prepend? and append? arguments (ArrayLike).
  • interp - new period?: number for circular/phase data; xp is normalized into [0, period) and wraps at the boundary.
  • gradient - per-axis spacing can now be a 1-D coordinate array (non-uniform second-order central-difference), not just a scalar.
  • apply_along_axis - accepts trailing ...args forwarded to func1d, matching np.apply_along_axis(func1d, axis, arr, *args).
  • pad - pad_width and constant_values accept the full NumPy broadcast forms (scalar, [n], [before, after], per-axis scalars, [[b, a]], per-axis pairs, mixed). New exported types PadWidthArg and PadValueArg.
  • meshgrid - MeshgridOptions { indexing?, sparse?, copy? } bag. sparse: true returns open grids; copy: false returns broadcast views.
  • block - accepts nested sequences (NestedNDArrays[]) with NumPy’s innermost-to-outer axis semantics. Flat-list calls behave identically.

ArrayLike widening

These now accept plain number[], nested arrays, and scalars in addition to NDArrayCore. Behavior for existing NDArray callers is unchanged.
  • take - indices: ArrayLike (scalar, 1-D, 2-D, or 3-D). Output preserves the shape of indices.
  • where - x and y are ArrayLike. Also fixes a falsy-zero bug: where(cond, x, 0) now honors the 0 branch instead of falling through to the indices form.
  • select - condlist, choicelist, and defaultVal widened to ArrayLike / ArrayLike[].
  • bincount, digitize, histogram, histogram2d, histogramdd - data, weights, and bin arguments are ArrayLike.
2026-04-17

numpy-ts v1.3.2

Patch release with a couple of bug fixes and improvements:
  • Fixed issue with [Symbol.dispose] not working properly on Safari & old runtimes
  • Added wasmFreeBytes to public exports to allow memory usage checks
2026-04-16

numpy-ts v1.3.1

Patch release with new WASM kernels, performance improvements, and export fixes.
  • New WASM kernels: conj, deg2rad, modf, packbits, nanquantile, argwhere, and float32 SVD
  • Optimized WASM SIMD for argmin/argmax int16/uint16 paths
  • Reduced WASM base threshold for earlier WASM dispatch on smaller arrays
  • Export fixes: configureWasm, wasmConfig, and hasFloat16 now exported from core and full entrypoints
  • Benchmark runner refactored from if-else chain to dictionary lookup
2026-04-13

numpy-ts v1.3.0

This is the first release where numpy-ts is faster than native NumPy on average1.13x across 7,200 benchmarks, leading in 12 of 18 categories. See the Performance Overview for the full breakdown.v1.3.0 gets there by moving array storage into WebAssembly linear memory for true zero-copy WASM kernel execution, ships a new memory-management API, and brings a stack of NumPy compatibility fixes.
  • WASM-backed array storage: Arrays now live directly in a shared WebAssembly memory pool (default 256 MiB). WASM kernels operate on these pointers with zero copy-in/copy-out overhead.
    • Bandwidth-bound operations (add, multiply, bitwise) see up to 2.6x improvement
    • Compute-bound operations (matmul, svd) see minimal change (already kernel-dominated)
    • Graceful fallback to JS TypedArrays when the pool is full
    • Comes with new dispose() and configureWasm() methods for manual memory management and pool configuration
  • Browser bundle is ESM. Load via <script type="module"> or import(). See the CDN section.
  • Default dtype changes:
    • arange() now defaults to float64 (was int32 for integer args), matching zeros/ones/linspace. Pass dtype explicitly to opt out.
    • full() integer inference: out-of-range integers now infer to int64 instead of float64. In-range integers still infer to int32.
    • Index-returning APIs return float64 instead of int64 (argsort, argmax/min, argwhere, nonzero, unravel_index, indices, …) — deliberate NumPy divergence to avoid BigInt friction.
  • array() now accepts TypedArray inputs.
  • Various slice correctness fixes (thanks @BorisTheBrave):
    • Added `vindex: vectorized multi-dimensional indexing matching NumPy’s integer array indexing semantics. See Advanced Indexing. (#94)
    • Slice now supports '...' (ellipsis) and 'newaxis' tokens for compact multi-dim slicing. See Slicing & Indexing. (#84)
  • in1d deprecated (matches NumPy 2.4) — use isin.
2026-03-27

numpy-ts v1.2.0

The DX release! v1.2.0 brings some quality-of-life upgrades:
  • Added float16 dtype support:
    • New half-precision dtype with native Float16Array on modern runtimes (Node 23+, Chrome 127+) and Float32Array fallback on older runtimes. Full NPY round-trip support.
  • Complete random module rewrite:
    • Entire np.random module rewritten as Zig-compiled WASM. Now matches NumPy’s random output bit-for-bit for all distributions with both legacy (MT19937) and modern (PCG64) APIs.
    • Random functions are now ~6x faster on average.
  • Simplified bundles:
    • Removed CJS bundle. The package is now ESM-only (dist/numpy-ts.node.cjs removed).
    • All 22 file I/O functions now available from import from 'numpy-ts' — works on Node, Bun, and Deno. numpy-ts/node is deprecated (still works as an alias).
    • 2 build outputs (down from 5) — tree-shakeable ESM + browser IIFE
  • Performance optimizations across the board - yielding an average 20% speedup.
  • Cross-runtime test coverage: all 10,000+ tests now run on Node, Bun, Deno, and Chromium
2026-03-19

numpy-ts v1.1.0

The performance release! v1.1.0 introduces Zig-compiled WASM microkernels that transparently accelerate compute- and memory-bound operations across the library. numpy-ts remains lightweight, tree-shakeable, and zero-config - just faster.
  • Implemented 97 WASM-accelerated operations compiled from Zig with 128-bit SIMD
    • WASM kernels are embedded as base64, synchronously initialized, and individually tree-shakeable
    • Acceleration is fully transparent: same API, same results, no configuration needed
  • Generally sped up the entire library by ~8x:
    • Arithmetic: ~23x faster (65x slower than NumPy → 2.75x)
    • Linear Algebra: ~19x faster (61x → 3.2x)
    • Logic: ~27x faster (48x → 1.8x)
    • Manipulation: ~9x faster (15x → 1.6x)
    • Gradient: ~60x faster (30x slower → 2x faster than NumPy)
    • FFT: ~3x faster (22x → 8x)
    • Random: ~6x faster (11x → 1.9x)
    • Indexing: ~5.5x faster (12x → 2.2x)
  • Added bracket indexing (arr[i], arr[i][j], arr[i] = val) on all NDArray instances via Proxy
  • Added multi-axis reductions: amin, amax, median, all, any, nanmin, nanmax now accept axis: number[]
  • Added batched linear algebra: eig, eigh, eigvals, eigvalsh, cholesky, pinv, slogdet, matrix_norm support [..., n, n] batch inputs
  • Added unique axis parameter: find unique rows, columns, or slices along any axis
  • Added apply_along_axis ND support: now works with arrays of any dimensionality
  • Unified slice() implementation: moved from duplicated logic in NDArrayCore/NDArray to a single shapeOps.slice() function, and added sliceKeepDim() for rank-preserving slicing (thanks @BorisTheBrave)
  • Revamped benchmark suite to thoroughly test all functions and dtype combinations
  • Added WASM Acceleration guide
  • Added AI Disclosure page
2026-02-20

numpy-ts v1.0.0

The first stable release of numpy-ts, providing a comprehensive NumPy implementation for TypeScript and JavaScript.
  • 476 of 507 NumPy functions implemented (94% API coverage)
  • Full test suite with 6,000+ tests validated against NumPy
  • Zero dependencies: pure TypeScript, no native modules or WebAssembly
  • Universal runtime support for Node.js, Bun, Deno, and browsers
  • Tree-shakeable ESM build for minimal bundle sizes
Full changelog available here
2026-02-17

numpy-ts v0.13.1

Final v0.x release before v1.0!
  • String repr fixes for 1.0 by @dupontcyborg in #48
Full changelog available here
2026-02-16

numpy-ts v0.13.0

  • Implemented fft functions by @dupontcyborg in #42
  • Implemented all missing random distribution functions (36 functions) by @dupontcyborg in #43
  • Pre-1.0.0 improvements by @dupontcyborg in #44
  • Refactored library to be tree-shakeable by @dupontcyborg in #46
Full changelog available here
2025-12-22

numpy-ts v0.12.0

  • Added missing functions for reductions, array creation, and array manipulation by @dupontcyborg in #37
  • Added missing functions for statistics, bit operations, and set operations by @dupontcyborg in #38
  • Implemented complete linear algebra coverage (100%) by @dupontcyborg in #39
  • Implemented other math and utilities functions by @dupontcyborg in #40
  • Implemented polynomial and type checking functions by @dupontcyborg in #41
Full changelog available here
2025-12-17

numpy-ts v0.11.0

  • Added fancy indexing (iindex/bindex) and document NumPy divergences by @dupontcyborg in #34
  • Added complex number support (complex64, complex128) by @dupontcyborg in #35 & #36
Full changelog available here
2025-12-12

numpy-ts v0.10.0

  • Implemented statistics functions (bincount, digitize, histogram, histogram2d, histogramdd, correlate, convolve, cov, corrcoef) by @dupontcyborg in #27
  • Implemented np.random module with 17 functions by @dupontcyborg in #28
  • Implemented logic functions for 100% category coverage by @dupontcyborg in #29
  • Full API tracking by @dupontcyborg in #30
  • Implemented feature gap analysis and missing NDArray properties by @dupontcyborg in #31
  • Implemented miscellaneous missing methods by @dupontcyborg in #32
  • Bumped workflow Node versions to 24 by @dupontcyborg in #33
Full changelog available here
2025-12-09

numpy-ts v0.9.0

  • Implemented numpy.linalg module (19 functions) by @dupontcyborg in #24
  • Implemented exponential and gradient functions by @dupontcyborg in #25
  • Implemented rounding and set operations with full NumPy compatibility by @dupontcyborg in #26
Full changelog available here
2025-12-05

numpy-ts v0.8.0

  • Added missing I/O functions by @dupontcyborg in #22
  • Implemented sorting and searching functions by @dupontcyborg in #23
Full changelog available here
2025-12-03

numpy-ts v0.7.0

  • Added indexing functions to achieve 100% Indexing API coverage by @dupontcyborg in #20
  • Added bitwise operations (bitwise_and, bitwise_or, bitwise_xor, bitwise_not, invert, left_shift, right_shift, packbits, unpackbits) by @dupontcyborg in #21
Full changelog available here
2025-12-02

numpy-ts v0.6.0

  • Added missing minor functions by @dupontcyborg in #16
  • Implemented missing arithmetic and linear algebra functions by @dupontcyborg in #17
  • Implemented complete array creation and manipulation functions by @dupontcyborg in #18
  • Implemented remaining reductions by @dupontcyborg in #19
Full changelog available here
2025-12-01

numpy-ts v0.5.0

  • Add NPY and NPZ file format support by @dupontcyborg in #12
  • Add array manipulation and advanced functions for NumPy parity by @dupontcyborg in #13
  • Api + README cleanup by @dupontcyborg in #14
  • Trigonometric & hyperbolic functions by @dupontcyborg in #15
Full changelog available here
2025-11-26

numpy-ts v0.4.0

  • Custom BLAS by @dupontcyborg in #11
Full changelog available here
2025-11-25

numpy-ts v0.3.0

  • Arithmetic improvements by @dupontcyborg in #7
  • Removed stdlib ndarray and implemented our own by @dupontcyborg in #9
  • Updated README by @dupontcyborg in #10
Full changelog available here
2025-10-27

numpy-ts v0.2.0

  • Remaining arithmetic by @dupontcyborg in #3
  • Improved unit test coverage by @dupontcyborg in #4
  • Potential fix for code scanning alert no. 10: Workflow does not contain permissions by @dupontcyborg in #5
  • v0.2.0 by @dupontcyborg in #6
Full changelog available here
2025-10-27

numpy-ts v0.1.0

First release of numpy-ts!Full changelog available here