Contributing¶
go-simd follows the same conventions as the author's other Go organizations.
Hard rules¶
- Pure Go,
CGO_ENABLED=0, stable Go, noGOEXPERIMENT. cgo wrappers of C SIMD libraries are faster still but out of scope — this is the pure-Go tier. - Drop-in or nothing. A stdlib-facing package must produce byte-identical output (and byte-identical errors, where the stdlib returns them) for all input. The SIMD path handles whole aligned blocks; the tail delegates to the standard library so results match exactly.
- Generated assembly, not hand-written. Kernels are emitted by
go-asmgen; the
*_gen.goare//go:build ignoreand the resulting.sis committed. go-asmgen is a build-time tool, never a runtime dependency. - 100% statement coverage of the Go code, enforced as a CI gate on every arch job. Every dispatch branch (AVX2 / SSE / POPCNT / scalar fallback) is driven by a force test on the native runner.
- Honest numbers. Report wins, parities, and non-SIMD outcomes alike. Headline benchmarks come from native CI, never from emulation; Rosetta is never trusted for AVX2.
- English only for all repository content (issues, PRs, commits, comments).
Adding or changing a kernel¶
- Survey the prior art (see methodology) so the comparison is against the real state of the art.
- Write the generator, not the
.s. Drive go-asmgen to emit the kernel for each target arch; commit the generated.s. - Prove correctness with a table test (boundaries, every error class) and a
Fuzz*differential target against the stdlib/oracle reference — comparing value and error. Add a force test that drives each dispatch branch directly. - Validate on real hardware — native amd64 (real AVX2, not Rosetta), native arm64, riscv64/loong64 under QEMU.
- Model and measure —
llvm-mcafor the cycle model, then native-CI benchmarks for the headline numbers. Update the README's honest results table. - Confirm 100% coverage:
Regenerating the assembly¶
Each repo documents its exact regenerate command; the shape is:
go get github.com/go-asmgen/asmgen@latest
go generate ./... # or: go run <name>_gen.go
go mod edit -droprequire github.com/go-asmgen/asmgen
go mod tidy
Documentation¶
This site is built with MkDocs Material and versioned with mike; see the docs repo README for local preview and release commands. The organization landing page lives in go-simd.github.io (Hugo).