From 91166fa8c4cc06911713854f4fd266e562e93e54 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 11 Oct 2026 20:24:17 +0200 Subject: [PATCH] docs for ndarray v0.12.0: /docs/0.12/, Repr is NumPy's, decoder audit - params.ndarray.version v0.12.0 (and baseURL), so CI publishes /docs/0.12/ as latest; earlier versions stay. - scripts/sync-mirrors.sh at v0.12.0: dtypes, linalg, random, roadmap links now point at the tag. - security.md re-synced by hand: v0.12.0's SECURITY.md adds the decoder guarantee and its audit entry (FuzzUnmarshalBinary); the one file reference is rewritten as a GitHub link, and a diff against the source shows only the documented rewrites. - Home: Repr prints what NumPy 2.5.3's repr prints, checked against NumPy's own test strings (ndarray#49). Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- content/en/_index.md | 2 +- content/en/dtypes.md | 2 +- content/en/linalg.md | 4 ++-- content/en/random.md | 8 ++++---- content/en/roadmap.md | 4 ++-- content/en/security.md | 20 +++++++++++++++++++- hugo.yaml | 4 ++-- 8 files changed, 32 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 004db1b..a2069ca 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ describes**: | Source | Published under | | --- | --- | -| branch `main`, with `params.ndarray.version: v0.11.0` in `hugo.yaml` | `https://go-ndarray.github.io/docs//`, here `/docs/0.11/` | +| branch `main`, with `params.ndarray.version: v0.12.0` in `hugo.yaml` | `https://go-ndarray.github.io/docs//`, here `/docs/0.12/` | | the newest version | also `https://go-ndarray.github.io/docs/latest/` | `https://go-ndarray.github.io/docs/` redirects to `latest/`. Each push to diff --git a/content/en/_index.md b/content/en/_index.md index c31686f..f6584be 100644 --- a/content/en/_index.md +++ b/content/en/_index.md @@ -47,7 +47,7 @@ WebAssembly, with nothing to install — build a pipeline step by step (creation | Linear algebra | `MatMul`, `Dot`, `Inner`, `Outer`; package `linalg` ([page](linalg.md)): `Solve`, `Inv`, `Det`, `Slogdet`, `Cholesky`, `QR`, `SVD`, `Eigh`, `Eig`, `Lstsq`, `Pinv`, `MatrixRank`, `Norm`, `Cond`, `MatrixPower`, `MultiDot` | | Fourier transforms | package `fft`: `numpy.fft` on arrays (`FFT`/`RFFT`/`FFT2`/`FFTN`/… with `n`/`s`, `axes`, `norm`), over [go-fft](https://github.com/go-fft/fft) | | Random numbers | package `random` ([page](random.md)): PCG64, PCG64DXSM, MT19937, Philox, SFC64; `Generator` (`DefaultRNG`, 40 samplers) and the legacy `RandomState` (`Seed`, `Rand`) | -| Notebooks & storage | `Repr` (prints like NumPy), `Display` (text and HTML), `MarshalBinary`/`UnmarshalBinary` (the same bytes on every architecture) | +| Notebooks & storage | `Repr` (character for character what NumPy 2.5.3's `repr` prints, checked against NumPy's own test strings), `Display` (text and HTML), `MarshalBinary`/`UnmarshalBinary` (the same bytes on every architecture) | | Memory reuse | `NewWorkspace`, `Use`, `Reset`, `Detach` | ## Goroutines (v0.6.0) diff --git a/content/en/dtypes.md b/content/en/dtypes.md index c9631c5..dfb54c9 100644 --- a/content/en/dtypes.md +++ b/content/en/dtypes.md @@ -8,7 +8,7 @@ description: "Why the dtype is a run-time property of one Array type, how arrays tags: [dtypes, numpy] --- -> Mirrored from [`docs/design-dtypes.md`](https://github.com/go-ndarray/ndarray/blob/v0.11.0/docs/design-dtypes.md) at v0.11.0. +> Mirrored from [`docs/design-dtypes.md`](https://github.com/go-ndarray/ndarray/blob/v0.12.0/docs/design-dtypes.md) at v0.12.0. > Status: implemented (Phase 2). Supersedes decision 4 of > [plan-ndarray.md](roadmap.md) ("`float64` first"). diff --git a/content/en/linalg.md b/content/en/linalg.md index bda0fb3..103c17d 100644 --- a/content/en/linalg.md +++ b/content/en/linalg.md @@ -8,9 +8,9 @@ description: "Solve, Inv, Det, Cholesky, QR, SVD, Eig and the rest of numpy.lina tags: [linalg, numpy] --- -> Mirrored from [`docs/linalg.md`](https://github.com/go-ndarray/ndarray/blob/v0.11.0/docs/linalg.md) at v0.11.0. +> Mirrored from [`docs/linalg.md`](https://github.com/go-ndarray/ndarray/blob/v0.12.0/docs/linalg.md) at v0.12.0. -Package [`linalg`](https://pkg.go.dev/github.com/go-ndarray/ndarray@v0.11.0/linalg) gives ndarray arrays the functions of +Package [`linalg`](https://pkg.go.dev/github.com/go-ndarray/ndarray@v0.12.0/linalg) gives ndarray arrays the functions of `numpy.linalg`, written in Go without cgo or assembly of its own: the matrix products it relies on are the ndarray package's packed SIMD GEMM. diff --git a/content/en/random.md b/content/en/random.md index 497eb3f..ee00238 100644 --- a/content/en/random.md +++ b/content/en/random.md @@ -8,9 +8,9 @@ description: "numpy.random with NumPy's numbers for the same seed: the bit gener tags: [random, numpy] --- -> Mirrored from [`docs/random.md`](https://github.com/go-ndarray/ndarray/blob/v0.11.0/docs/random.md) at v0.11.0. +> Mirrored from [`docs/random.md`](https://github.com/go-ndarray/ndarray/blob/v0.12.0/docs/random.md) at v0.12.0. -Package [`random`](https://pkg.go.dev/github.com/go-ndarray/ndarray@v0.11.0/random) is `numpy.random` over go-ndarray arrays. Its goal +Package [`random`](https://pkg.go.dev/github.com/go-ndarray/ndarray@v0.12.0/random) is `numpy.random` over go-ndarray arrays. Its goal is migration: a notebook moved from NumPy to Go keeps its numbers for the same seed. @@ -24,7 +24,7 @@ u, _ := random.Rand(3) // np.random.rand(3) ``` `Example`, `ExampleSeed` and `ExampleGenerator_ChoiceN` in -[`example_test.go`](https://github.com/go-ndarray/ndarray/blob/v0.11.0/random/example_test.go) print NumPy's own numbers. +[`example_test.go`](https://github.com/go-ndarray/ndarray/blob/v0.12.0/random/example_test.go) print NumPy's own numbers. ## What is implemented @@ -118,7 +118,7 @@ random arguments. Used as-is, that made 3% of `np.random.randn` values and 10% of `lognormal` values one ULP off. So `random` rounds `log`, `log1p`, `exp`, `expm1` and `pow` **correctly** -([`libm.go`](https://github.com/go-ndarray/ndarray/blob/v0.11.0/random/libm.go)): a fast evaluation to about 2⁻⁶⁸ with Ziv's +([`libm.go`](https://github.com/go-ndarray/ndarray/blob/v0.12.0/random/libm.go)): a fast evaluation to about 2⁻⁶⁸ with Ziv's rounding test, and a double-double fallback (about 2⁻¹⁰⁰) for the one argument in ~2¹⁵ that needs it. Checked against mpmath at 300 bits on 63,000 arguments (0 misrounded; the committed `libm.json` keeps 8,400), and the fast paths diff --git a/content/en/roadmap.md b/content/en/roadmap.md index 07f633b..bcda650 100644 --- a/content/en/roadmap.md +++ b/content/en/roadmap.md @@ -8,7 +8,7 @@ description: "The plan for go-ndarray and what ships today." tags: [roadmap] --- -> Mirrored from [`docs/plan-ndarray.md`](https://github.com/go-ndarray/ndarray/blob/v0.11.0/docs/plan-ndarray.md) at v0.11.0. +> Mirrored from [`docs/plan-ndarray.md`](https://github.com/go-ndarray/ndarray/blob/v0.12.0/docs/plan-ndarray.md) at v0.12.0. > Goal: a **pure-Go (CGO=0)** NumPy-style N-dimensional array library, as a > **standalone, reusable** module with correct scalar kernels now and a clean @@ -112,7 +112,7 @@ suite (plus the per-arch CI jobs already wired in `.github/workflows/ci.yml`). - **Performance — DONE (beats NumPy on its core ops; matmul at tuned-BLAS parity).** Several levers behind the kernel seam, measured honestly vs NumPy 2.2.4 (see [docs/perf.md](performance.md) and the repo's - [BENCHMARKS.md](https://github.com/go-ndarray/ndarray/blob/v0.11.0/BENCHMARKS.md)): + [BENCHMARKS.md](https://github.com/go-ndarray/ndarray/blob/v0.12.0/BENCHMARKS.md)): - **Multicore.** `Add/Sub/Mul/Div/Map`, `Sum/Max/Min`, the axis reductions, `Concatenate`/`Stack`, and the GEMM fan out across `GOMAXPROCS` above a size threshold (small arrays stay serial). Plus an allocation fix: the diff --git a/content/en/security.md b/content/en/security.md index a454703..f3f2208 100644 --- a/content/en/security.md +++ b/content/en/security.md @@ -8,7 +8,7 @@ description: "How to report a vulnerability, what the library guarantees, and th tags: [security] --- -> Mirrored from [`SECURITY.md`](https://github.com/go-ndarray/ndarray/blob/main/SECURITY.md) at v0.11.0. +> Mirrored from [`SECURITY.md`](https://github.com/go-ndarray/ndarray/blob/main/SECURITY.md) at v0.12.0. ## Reporting @@ -61,12 +61,30 @@ bounds checks do not cover, so they are held to the following: test from NumPy's definitions (Python's `slice.indices`, the broadcasting rule, ...). The library must reject exactly the calls the oracle rejects and never panic. +- **Decoding takes bytes from anywhere.** `UnmarshalBinary` refuses, with an + error wrapping `ErrFormat`, any input whose shape the bytes that follow do + not account for exactly, before it allocates; an array it accepts holds no + more than it was given. `FuzzUnmarshalBinary` ([`marshal_fuzz_test.go`](https://github.com/go-ndarray/ndarray/blob/main/marshal_fuzz_test.go)) + requires that, that it never panics, and that re-encoding is a fixed point. The minimum Go version (`go` in `go.mod`) is kept on a release that fixes the standard library's known vulnerabilities; `govulncheck ./...` reports none. ## Audit log +**2026-10-11 (after v0.11.0, tests only).** v0.10.0 added `UnmarshalBinary`, +whose input may come from a file, a notebook or the network; no entry covered +it. It checks the magic and the dtype, bounds the rank at 64 and each +dimension at `maxSize`, validates the shape, and compares the data length with +the element count by dividing, not multiplying, so a `complex128` shape cannot +overflow the comparison. Only then does it allocate, so the allocation is the +size of the input. `FuzzUnmarshalBinary` holds it to that, never panicking +and re-encoding to a fixed point. It ran 11 million inputs on an M-series Mac +with no failure. A copy that accepted fewer bytes than the shape needs failed +it in 0.09 s (6 bytes decoded as 48 bools), so the fuzzer can see the defect +it guards against. `govulncheck ./...` at go1.27.2 with go-fft v0.23.0 reports +none. + **2026-10-09 (v0.9.1).** New s390x `maxVXE`/`minVXE` kernels, gated on AT_HWCAP VXRS_EXT (z14 and later), each behind its wrapper: from eight elements up, with no pointer arithmetic beyond `len(a)`. On the real z17 they diff --git a/hugo.yaml b/hugo.yaml index edbc4b2..69cd586 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -6,7 +6,7 @@ # have used since the site was built with MkDocs and mike. The CI sets it # through --baseURL, from params.ndarray.version below. This default is the # same build. -baseURL: "https://go-ndarray.github.io/docs/0.11/" +baseURL: "https://go-ndarray.github.io/docs/0.12/" title: "go-ndarray" # themes/hextra is the tannevaled/hextra fork, pinned at a release tag: # upstream Hextra plus opt-in features (partial menu items, combos, @@ -97,7 +97,7 @@ params: # The ndarray release these pages describe. Its minor version is the # documentation's version label (v0.9.1 -> 0.9): the CI reads it here. ndarray: - version: "v0.11.0" + version: "v0.12.0" navbar: displayTitle: true