Repository navigation
perf: float64 Maximum and Minimum on go-simd/floats v0.26.0 kernels - #128
Merged
Merged
Conversation
Bump go-simd/floats to v0.26.0 and make kernels.Maximum and Minimum its Maximum and Minimum: a vector kernel where there is one, the builtin max/min loop elsewhere. Every caller goes through them (same-shape, scalar, repeated and broadcast operands in binOp); Clip does not use them. Results are bit for bit the builtin's for numbers and zeros; a NaN gives a NaN, whose choice is target-dependent, which is all the old loop promised. Tests: bit identity against the builtin (+-0 in both orders, +-Inf, subnormals, random), lengths 0-33 and above ParThreshold, out = a and out = b, NaN results as is-NaN. On 10^5 float64, cfarm420 one core, with the result allocation: Maximum 139-150 -> 76-82 us, Minimum 141-151 -> 76-81 us; 2 allocs/op and 803 kB unchanged. Refs #98 Refs #118 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 15, 2026
tannevaled
added a commit
to go-ndarray/docs
that referenced
this pull request
Nov 15, 2026
Every mirrored page, hugo.yaml (version and baseURL /docs/0.46/) and the README now point at v0.46.0. Re-synced from the v0.46.0 source, the only mirrored one that changed since v0.45.0: performance.md (docs/perf.md: float64 Maximum/Minimum on go-simd/floats v0.26.0, 139-151 to 76-82 us per 1e5). The other pages are only relabelled. The table was not re-measured: the home page still quotes the one measured at 37c1b86 (185 slower, 54 faster, 17 tied). performance-history.md is left alone. Refs go-ndarray/ndarray#128 Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
tannevaled
added a commit
to go-ndarray/go-ndarray.github.io
that referenced
this pull request
Nov 15, 2026
The card says "library · v0.46.0" and the playground builds against ndarray v0.46.0; its tests pass. The stats are unchanged: the table was not re-measured. Refs go-ndarray/ndarray#128 Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Float64
MaximumandMinimumnow run on the go-simd/floats v0.26.0 kernels (go.mod bumped from v0.23.0).kernels.Maximumandkernels.Minimumare thin wrappers overfloats.Maximumandfloats.Minimum, so every caller changes with them: the same-shape fast path, the scalar and repeated-operand paths and the general broadcast inbinOp, andMaximumInto-style forms do not exist.Clipdoes not use them (it isfloats.ClampScalar). Where floats has no vector kernel it is the builtinmax/minloop, as before. Other dtypes are unchanged.Correctness.
TestMaximumMinimumFloatscompares with the builtinmax/minbit for bit (±0 in both orders, ±Inf, subnormals, extremes, random bit patterns) on lengths 0 to 33,ParThreshold- 1,ParThreshold+ 37 and 10^5, without = aandout = baliasing. NaN results are compared as is-NaN, which is all the old loop guaranteed (the builtin's NaN choice is target-dependent): a NaN in either operand, including a signalling NaN and both operands NaN, gives a NaN. The 100% coverage gate holds locally, andTestPerfinbench/passes (allocation counts unchanged).Measured (
go test -bench MaxMin, newbenchmarks/maxmin_bench_test.go), 10^5 float64 including the result allocation, cfarm420 (AMD EPYC 7773X),GOMAXPROCS=1,taskset -c 9, a test binary of main (2ffe02d) against one of this branch, four interleaved rounds of 1 s, 1-minute load 3.97 at the start and 3.56 at the end:No NumPy ratio is claimed: these are Go against Go, and the table has not been rerun on this change. README and docs/perf.md (Since the table) are updated.
Refs #98
Refs #118
🤖 Generated with Claude Code