Loading the parity record
Fetching the measured run — the pinned upstream oracle, every symbol and every case.
Fetching the measured run — the pinned upstream oracle, every symbol and every case.
Parity / numpy
Every number on this page was produced by running both implementations over the same cases: the real numpy package pinned at 2.2.6 answers first, and its answer is the expectation the Go port is held to. Nothing is a hand-written expectation, so a new upstream release re-scores the port on its own. See numpy for the port's own documentation. Source: github.com/malcolmston/numpy.
Not a generic diagram: every node below names an artefact of this harness — the pinned package it installed, the runner files it started, the case files it streamed, and the counts it wrote out.
| Case group | Cases | Match | Mismatch | Group parity |
|---|---|---|---|---|
| arithmetic | 57 | 0 | 0 | 0.0% |
| shape | 45 | 0 | 0 | 0.0% |
| sorting | 45 | 0 | 0 | 0.0% |
| reductions | 39 | 0 | 0 | 0.0% |
| creation | 28 | 0 | 0 | 0.0% |
| statistics | 25 | 0 | 0 | 0.0% |
| linalg | 19 | 0 | 0 | 0.0% |
| slicing | 18 | 0 | 0 | 0.0% |
| broadcasting | 14 | 0 | 0 | 0.0% |
| cumulative | 11 | 0 | 0 | 0.0% |
Every exported symbol of the upstream package, and what the port offers for it. The upstream list is derived mechanically, never from a README: python3 -c "import numpy as np; print([n for n in dir(np) if not n.startswith('_') and callable(getattr(np, n))])" # 462 public callables
python3 -c "import numpy as np; print([n for n in dir(np.ndarray) if not n.startswith('_')])" # 74 public ndarray attributes. A symbol with no case is untested, never a match.
| Upstream symbol | Go symbol | Status | Cases | Note |
|---|---|---|---|---|
| numpy.absolute | numpy.NDArray.Abs | match | abs | |
| numpy.add | numpy.NDArray.Add, numpy.NDArray.AddScalar | match | add-2d, add-scalar, inf-arithmetic, bcast-3x1-1x4, bcast-2x3-row, bcast-scalarish, … (9 total) | |
| numpy.all | numpy.NDArray.All | match | all-true, all-false | |
| numpy.allclose | numpy.NDArray.AllClose | match | allclose-true, allclose-false | |
| numpy.any | numpy.NDArray.Any | match | any-true, any-false | |
| numpy.arange | numpy.Arange | match | arange-0-10-1, arange-frac, arange-neg-step, arange-empty, arange-wrong-dir, arange-zero-step | |
| numpy.arccos | numpy.NDArray.Arccos | match | arccos | |
| numpy.arcsin | numpy.NDArray.Arcsin | match | arcsin, arcsin-domain | |
| numpy.arctan | numpy.NDArray.Arctan | match | arctan | |
| numpy.arctan2 | numpy.NDArray.Arctan2 | match | arctan2-quadrants | |
| numpy.argmax | numpy.NDArray.Argmax | differs | argmax-1d, argmax-ties, argmax-2d-flat, argmax-empty, argmax-with-nan | port skips NaN; numpy returns the NaN's index (argmax-with-nan) |
| numpy.argmin | numpy.NDArray.Argmin | match | argmin-1d, argmin-ties, argmin-empty | |
| numpy.argsort | numpy.NDArray.Argsort | differs | argsort-1d, argsort-stable-dupes, argsort-2d-flat, argsort-with-nan | port's comparator collapses on NaN and returns the identity permutation (argsort-with-nan) |
| numpy.array | numpy.FromNested | match | from-nested-2d, from-nested-3d | |
| numpy.array_equal | numpy.NDArray.Equal | match | array-equal-true, array-equal-shape | |
| numpy.broadcast_to | numpy.NDArray.BroadcastTo | differs | broadcast-to-3x4, broadcast-to-1d, broadcast-to-add-axis, broadcast-to-bad, broadcast-to-shrink | port accepts a shape with *fewer* dims than the input and silently returns the wrong array; numpy raises |
| numpy.cbrt | numpy.NDArray.Cbrt | match | cbrt | |
| numpy.ceil | numpy.NDArray.Ceil | match | ceil | |
| numpy.clip | numpy.NDArray.Clip | differs | clip, clip-inverted | port panics when min > max; numpy silently returns max |
| numpy.concatenate | numpy.Concatenate | match | concat-axis0, concat-axis1, concat-1d, concat-bad-shape, concat-bad-axis | |
| numpy.cos | numpy.NDArray.Cos | match | cos | |
| numpy.cosh | numpy.NDArray.Cosh | match | cosh | |
| numpy.cross | numpy.NDArray.Cross | match | cross-3x3, cross-bad-len | |
| numpy.cumprod | numpy.NDArray.Cumprod | match | cumprod-1d, cumprod-2d-flat, cumprod-zero | |
| numpy.cumsum | numpy.NDArray.Cumsum | match | cumsum-1d, cumsum-2d-flat, cumsum-negatives, cumsum-empty | |
| numpy.diag | numpy.Diag | match | diag-from-1d, diag-from-2d, diag-3d-error | |
| numpy.diagonal | numpy.NDArray.Diagonal | match | diagonal-k0, diagonal-k1, diagonal-km1, diagonal-1d-error | |
| numpy.diff | numpy.NDArray.Diff | match | diff-1d, diff-2d-flat, diff-single, diff-empty | |
| numpy.divide | numpy.NDArray.Div, numpy.NDArray.DivScalar | match | div-2d, div-by-zero, div-scalar, div-scalar-zero | |
| numpy.dot | numpy.NDArray.Dot | differs | dot-1d, dot-2d, dot-1d-mismatch, dot-1d-2d | port requires matching ndim and returns a shape (1) array for the 1-D/1-D case; numpy returns a 0-d scalar and supports mixed 1-D/2-D |
| numpy.equal | numpy.NDArray.EqualMask, numpy.NDArray.EqualScalar | match | equal-mask, equal-scalar, equal-mask-nan | |
| numpy.exp | numpy.NDArray.Exp | match | exp, exp-overflow | |
| numpy.expand_dims | numpy.NDArray.ExpandDims | match | expand-dims-0, expand-dims-1, expand-dims-neg1, expand-dims-bad | |
| numpy.expm1 | numpy.NDArray.Expm1 | match | expm1 | |
| numpy.eye | numpy.Eye | match | eye-3, eye-3x4-k1, eye-4x3-km1 | |
| numpy.flip | numpy.NDArray.Flip | match | flip-axis0, flip-axis1, flip-axis-neg, flip-bad-axis | |
| numpy.floor | numpy.NDArray.Floor | match | floor | |
| numpy.fmod | numpy.NDArray.Mod | match | mod-signs, mod-zero | |
| numpy.full | numpy.Full | match | full-2x3, full-neg | |
| numpy.greater | numpy.NDArray.Greater, numpy.NDArray.GreaterScalar | match | greater, greater-scalar | |
| numpy.greater_equal | numpy.NDArray.GreaterEqual | match | greater-equal | |
| numpy.hypot | numpy.NDArray.Hypot | match | hypot | |
| numpy.identity | numpy.Identity | match | identity-4 | |
| numpy.less | numpy.NDArray.Less, numpy.NDArray.LessScalar | match | less, less-scalar | |
| numpy.less_equal | numpy.NDArray.LessEqual | match | less-equal | |
| numpy.linalg.norm | numpy.NDArray.Norm | match | norm-1d, norm-2d-frobenius | |
| numpy.linspace | numpy.Linspace | match | linspace-endpoint, linspace-open, linspace-one, linspace-zero, linspace-negative-num | |
| numpy.log | numpy.NDArray.Log | match | log, log-zero-neg | |
| numpy.log10 | numpy.NDArray.Log10 | match | log10 | |
| numpy.log1p | numpy.NDArray.Log1p | match | log1p | |
| numpy.log2 | numpy.NDArray.Log2 | match | log2 | |
| numpy.matmul | numpy.NDArray.MatMul | differs | matmul-2x3-3x2, matmul-3x3, matmul-identity, matmul-mismatch, matmul-1d-2d, matmul-3d-error | port requires both operands to be exactly 2-D; numpy promotes 1-D operands and batches >2-D |
| numpy.max | numpy.NDArray.Max, numpy.NDArray.MaxAxis | differs | max-all, max-axis0, max-axis1-keepdims, max-axis-bad, max-with-nan, max-axis-with-nan | port skips NaN; numpy propagates it (max-with-nan) |
| numpy.maximum | numpy.NDArray.Maximum | match | maximum, maximum-nan | |
| numpy.mean | numpy.NDArray.Mean, numpy.NDArray.MeanAxis | match | mean-all, mean-axis0, mean-axis1-keepdims, mean-axis-3d, mean-precision | |
| numpy.median | numpy.NDArray.Median | differs | median-odd, median-even, median-2d, median-empty, median-with-nan | port skips NaN and panics on an empty array; numpy yields NaN in both cases |
| numpy.min | numpy.NDArray.Min, numpy.NDArray.MinAxis | differs | min-all, min-axis0, min-axis1, min-with-nan | port skips NaN; numpy propagates it (min-with-nan) |
| numpy.minimum | numpy.NDArray.Minimum | match | minimum, minimum-bcast | |
| numpy.multiply | numpy.NDArray.Mul, numpy.NDArray.MulScalar | match | mul-2d, mul-scalar, bcast-2x3-col | |
| numpy.ndarray.T | numpy.NDArray.T | match | transpose-2d | |
| numpy.ndarray.__getitem__ | numpy.NDArray.Slice, numpy.NDArray.At, numpy.NDArray.MaskSelect | match | slice-2d-block, slice-full-axis, slice-1d, slice-neg-start, slice-neg-stop, slice-neg-both, … (21 total) | |
| numpy.ndarray.flatten | numpy.NDArray.Flatten | match | flatten-2d | |
| numpy.ndarray.ndim | numpy.NDArray.Ndim | match | ndim-3d | |
| numpy.ndarray.ravel | numpy.NDArray.Ravel | match | ravel-3d, ravel-transposed | |
| numpy.ndarray.reshape | numpy.NDArray.Reshape | match | reshape-6-to-3x2, reshape-infer, reshape-infer-first, reshape-to-3d, reshape-bad-size, reshape-two-infer | |
| numpy.ndarray.shape | numpy.NDArray.Shape | match | shape-3d | |
| numpy.ndarray.size | numpy.NDArray.Size | match | size-3d | |
| numpy.ndarray.transpose | numpy.NDArray.Transpose | match | transpose-3d | |
| numpy.negative | numpy.NDArray.Neg | match | neg | |
| numpy.not_equal | numpy.NDArray.NotEqualMask | match | not-equal-mask | |
| numpy.ones | numpy.Ones | match | ones-3d, ones-1d | |
| numpy.ones_like | numpy.OnesLike | match | ones-like | |
| numpy.outer | numpy.NDArray.Outer | match | outer-2x3, outer-flattens | |
| numpy.percentile | numpy.NDArray.Percentile | match | percentile-0, percentile-25, percentile-50, percentile-90, percentile-100, percentile-2d, … (8 total) | |
| numpy.power | numpy.NDArray.Pow, numpy.NDArray.PowScalar | match | pow-2d, pow-neg-base-frac, pow-scalar | |
| numpy.prod | numpy.NDArray.Prod, numpy.NDArray.ProdAxis | match | prod-all, prod-with-zero, prod-axis0, prod-axis1-keepdims | |
| numpy.ptp | numpy.NDArray.Ptp | match | ptp | |
| numpy.quantile | numpy.NDArray.Quantile | match | quantile-quarter, quantile-half, quantile-out-of-range | |
| numpy.reciprocal | numpy.NDArray.Reciprocal | match | reciprocal, reciprocal-zero | |
| numpy.roll | numpy.NDArray.Roll | match | roll-pos, roll-neg, roll-2d-flat | |
| numpy.round | numpy.NDArray.Round | match | round-half-even | |
| numpy.searchsorted | numpy.NDArray.SearchSorted | match | searchsorted-mid, searchsorted-exact, searchsorted-below, searchsorted-above | |
| numpy.sign | numpy.NDArray.Sign | match | sign, sign-nan | |
| numpy.sin | numpy.NDArray.Sin | match | sin | |
| numpy.sinh | numpy.NDArray.Sinh | match | sinh | |
| numpy.sort | numpy.NDArray.Sort | differs | sort-1d, sort-dupes, sort-2d-flat, sort-with-nan, sort-neg-zero | port sorts NaN first, numpy sorts NaN last (sort-with-nan) |
| numpy.sqrt | numpy.NDArray.Sqrt | match | sqrt, sqrt-negative | |
| numpy.square | numpy.NDArray.Square | match | square | |
| numpy.squeeze | numpy.NDArray.Squeeze | differs | squeeze-mid, squeeze-col, squeeze-all-ones | port returns a 1-D length-1 array where numpy returns a 0-d array |
| numpy.stack | numpy.Stack | match | stack-axis0, stack-axis1, stack-2d-axis1, stack-mismatch | |
| numpy.std | numpy.NDArray.StdAxis, numpy.NDArray.Std, numpy.NDArray.StdDDof | match | std-axis0, std-axis1-keepdims, std-axis-3d, std-axis-bad, std-pop, std-2d, … (8 total) | |
| numpy.subtract | numpy.NDArray.Sub, numpy.NDArray.SubScalar | match | sub-2d, sub-scalar, inf-minus-inf, bcast-3d-row | |
| numpy.sum | numpy.NDArray.Sum, numpy.NDArray.SumAxis | match | sum-all, sum-3d, sum-axis0, sum-axis1, sum-axis0-keepdims, sum-axis1-keepdims, … (12 total) | |
| numpy.tan | numpy.NDArray.Tan | match | tan | |
| numpy.tanh | numpy.NDArray.Tanh | match | tanh | |
| numpy.trace | numpy.NDArray.Trace | match | trace-3x3, trace-2x3, trace-1d-error | |
| numpy.transpose | numpy.NDArray.Transpose | match | transpose-perm, transpose-perm-2, transpose-bad-perm, transpose-short-perm | |
| numpy.trunc | numpy.NDArray.Trunc | match | trunc | |
| numpy.unique | numpy.NDArray.Unique | differs | unique-1d, unique-2d, unique-negzero, unique-with-nan | port keeps every NaN and sorts them first; numpy collapses NaN to one trailing entry (unique-with-nan) |
| numpy.var | numpy.NDArray.Var, numpy.NDArray.VarDDof | differs | var-pop, var-2d, var-ddof1, var-ddof-too-big | VarDDof panics when N-ddof <= 0; numpy warns and yields inf |
Every case the harness streamed to both runners, with the exact upstream symbol and Go symbol it exercised. A deliberate, documented difference is a deviation and is counted apart from a mismatch.
| Case | Group | Upstream symbol | Go symbol | Status | Note |
|---|---|---|---|---|---|
| add-2d | arithmetic | numpy.add | numpy.NDArray.Add | match | |
| sub-2d | arithmetic | numpy.subtract | numpy.NDArray.Sub | match | |
| mul-2d | arithmetic | numpy.multiply | numpy.NDArray.Mul | match | |
| div-2d | arithmetic | numpy.divide | numpy.NDArray.Div | match | |
| div-by-zero | arithmetic | numpy.divide | numpy.NDArray.Div | match | expects Infinity / -Infinity / NaN sentinels |
| pow-2d | arithmetic | numpy.power | numpy.NDArray.Pow | match | |
| pow-neg-base-frac | arithmetic | numpy.power | numpy.NDArray.Pow | match | NaN on both sides |
| mod-signs | arithmetic | numpy.fmod | numpy.NDArray.Mod | match | Go math.Mod == numpy.fmod, NOT numpy.mod |
| mod-zero | arithmetic | numpy.fmod | numpy.NDArray.Mod | match | |
| add-scalar | arithmetic | numpy.add | numpy.NDArray.AddScalar | match | |
| sub-scalar | arithmetic | numpy.subtract | numpy.NDArray.SubScalar | match | |
| mul-scalar | arithmetic | numpy.multiply | numpy.NDArray.MulScalar | match | |
| div-scalar | arithmetic | numpy.divide | numpy.NDArray.DivScalar | match | |
| div-scalar-zero | arithmetic | numpy.divide | numpy.NDArray.DivScalar | match | |
| pow-scalar | arithmetic | numpy.power | numpy.NDArray.PowScalar | match | |
| neg | arithmetic | numpy.negative | numpy.NDArray.Neg | match | |
| abs | arithmetic | numpy.absolute | numpy.NDArray.Abs | match | |
| sqrt | arithmetic | numpy.sqrt | numpy.NDArray.Sqrt | match | |
| sqrt-negative | arithmetic | numpy.sqrt | numpy.NDArray.Sqrt | match | NaN sentinel expected |
| cbrt | arithmetic | numpy.cbrt | numpy.NDArray.Cbrt | match | |
| square | arithmetic | numpy.square | numpy.NDArray.Square | match | |
| reciprocal | arithmetic | numpy.reciprocal | numpy.NDArray.Reciprocal | match | |
| reciprocal-zero | arithmetic | numpy.reciprocal | numpy.NDArray.Reciprocal | match | Infinity sentinels |
| exp | arithmetic | numpy.exp | numpy.NDArray.Exp | match | |
| exp-overflow | arithmetic | numpy.exp | numpy.NDArray.Exp | match | Infinity |
| expm1 | arithmetic | numpy.expm1 | numpy.NDArray.Expm1 | match | |
| log | arithmetic | numpy.log | numpy.NDArray.Log | match | |
| log-zero-neg | arithmetic | numpy.log | numpy.NDArray.Log | match | -Infinity then NaN |
| log1p | arithmetic | numpy.log1p | numpy.NDArray.Log1p | match | |
| log2 | arithmetic | numpy.log2 | numpy.NDArray.Log2 | match | |
| log10 | arithmetic | numpy.log10 | numpy.NDArray.Log10 | match | |
| sin | arithmetic | numpy.sin | numpy.NDArray.Sin | match | |
| cos | arithmetic | numpy.cos | numpy.NDArray.Cos | match | |
| tan | arithmetic | numpy.tan | numpy.NDArray.Tan | match | |
| arcsin | arithmetic | numpy.arcsin | numpy.NDArray.Arcsin | match | |
| arcsin-domain | arithmetic | numpy.arcsin | numpy.NDArray.Arcsin | match | NaN |
| arccos | arithmetic | numpy.arccos | numpy.NDArray.Arccos | match | |
| arctan | arithmetic | numpy.arctan | numpy.NDArray.Arctan | match | |
| sinh | arithmetic | numpy.sinh | numpy.NDArray.Sinh | match | |
| cosh | arithmetic | numpy.cosh | numpy.NDArray.Cosh | match | |
| tanh | arithmetic | numpy.tanh | numpy.NDArray.Tanh | match | |
| floor | arithmetic | numpy.floor | numpy.NDArray.Floor | match | |
| ceil | arithmetic | numpy.ceil | numpy.NDArray.Ceil | match | |
| trunc | arithmetic | numpy.trunc | numpy.NDArray.Trunc | match | |
| round-half-even | arithmetic | numpy.round | numpy.NDArray.Round | match | banker's rounding on both sides |
| sign | arithmetic | numpy.sign | numpy.NDArray.Sign | match | |
| sign-nan | arithmetic | numpy.sign | numpy.NDArray.Sign | match | |
| clip | arithmetic | numpy.clip | numpy.NDArray.Clip | match | |
| clip-inverted | arithmetic | numpy.clip | numpy.NDArray.Clip | mismatch | min > max: the port panics, numpy silently returns max |
| maximum | arithmetic | numpy.maximum | numpy.NDArray.Maximum | match | |
| maximum-nan | arithmetic | numpy.maximum | numpy.NDArray.Maximum | match | numpy.maximum propagates NaN |
| minimum | arithmetic | numpy.minimum | numpy.NDArray.Minimum | match | |
| minimum-bcast | arithmetic | numpy.minimum | numpy.NDArray.Minimum | match | |
| hypot | arithmetic | numpy.hypot | numpy.NDArray.Hypot | match | |
| arctan2-quadrants | arithmetic | numpy.arctan2 | numpy.NDArray.Arctan2 | match | |
| inf-arithmetic | arithmetic | numpy.add | numpy.NDArray.Add | match | |
| inf-minus-inf | arithmetic | numpy.subtract | numpy.NDArray.Sub | match | NaN |
| bcast-3x1-1x4 | broadcasting | numpy.add | numpy.NDArray.Add | match | |
| bcast-2x3-row | broadcasting | numpy.add | numpy.NDArray.Add | match | |
| bcast-2x3-col | broadcasting | numpy.multiply | numpy.NDArray.Mul | match | |
| bcast-scalarish | broadcasting | numpy.add | numpy.NDArray.Add | match | |
| bcast-3d-2d | broadcasting | numpy.add | numpy.NDArray.Add | match | |
| bcast-3d-row | broadcasting | numpy.subtract | numpy.NDArray.Sub | match | |
| bcast-incompatible | broadcasting | numpy.add | numpy.NDArray.Add | match | must FAIL on both sides |
| bcast-incompatible-2d | broadcasting | numpy.add | numpy.NDArray.Add | match | must FAIL on both sides |
| broadcast-to-3x4 | broadcasting | numpy.broadcast_to | numpy.NDArray.BroadcastTo | match | |
| broadcast-to-1d | broadcasting | numpy.broadcast_to | numpy.NDArray.BroadcastTo | match | |
| broadcast-to-add-axis | broadcasting | numpy.broadcast_to | numpy.NDArray.BroadcastTo | match | |
| broadcast-to-bad | broadcasting | numpy.broadcast_to | numpy.NDArray.BroadcastTo | match | must FAIL on both sides |
| broadcast-to-shrink | broadcasting | numpy.broadcast_to | numpy.NDArray.BroadcastTo | mismatch | must FAIL on both sides |
| bcast-where | broadcasting | numpy.where | numpy.Where | match | |
| zeros-2x3 | creation | numpy.zeros | numpy.Zeros | match | |
| zeros-1d | creation | numpy.zeros | numpy.Zeros | match | |
| ones-3d | creation | numpy.ones | numpy.Ones | match | |
| ones-1d | creation | numpy.ones | numpy.Ones | match | |
| full-2x3 | creation | numpy.full | numpy.Full | match | |
| full-neg | creation | numpy.full | numpy.Full | match | |
| arange-0-10-1 | creation | numpy.arange | numpy.Arange | match | |
| arange-frac | creation | numpy.arange | numpy.Arange | match | |
| arange-neg-step | creation | numpy.arange | numpy.Arange | match | |
| arange-empty | creation | numpy.arange | numpy.Arange | match | |
| arange-wrong-dir | creation | numpy.arange | numpy.Arange | match | empty result, not an error |
| arange-zero-step | creation | numpy.arange | numpy.Arange | match | must FAIL on both sides |
| linspace-endpoint | creation | numpy.linspace | numpy.Linspace | match | |
| linspace-open | creation | numpy.linspace | numpy.Linspace | match | |
| linspace-one | creation | numpy.linspace | numpy.Linspace | match | |
| linspace-zero | creation | numpy.linspace | numpy.Linspace | match | |
| linspace-negative-num | creation | numpy.linspace | numpy.Linspace | match | must FAIL on both sides |
| eye-3 | creation | numpy.eye | numpy.Eye | match | |
| eye-3x4-k1 | creation | numpy.eye | numpy.Eye | match | |
| eye-4x3-km1 | creation | numpy.eye | numpy.Eye | match | |
| identity-4 | creation | numpy.identity | numpy.Identity | match | |
| zeros-like | creation | numpy.zeros_like | numpy.ZerosLike | match | |
| ones-like | creation | numpy.ones_like | numpy.OnesLike | match | |
| from-nested-2d | creation | numpy.array | numpy.FromNested | match | |
| from-nested-3d | creation | numpy.array | numpy.FromNested | match | |
| shape-3d | creation | numpy.ndarray.shape | numpy.NDArray.Shape | match | |
| ndim-3d | creation | numpy.ndarray.ndim | numpy.NDArray.Ndim | match | |
| size-3d | creation | numpy.ndarray.size | numpy.NDArray.Size | match | |
| cumsum-1d | cumulative | numpy.cumsum | numpy.NDArray.Cumsum | match |