Skip to content

feat(exp,simd): adding experimental SIMD operators#232

Merged
samber merged 8 commits intomainfrom
feat/exp-simd
Feb 27, 2026
Merged

feat(exp,simd): adding experimental SIMD operators#232
samber merged 8 commits intomainfrom
feat/exp-simd

Conversation

@samber
Copy link
Owner

@samber samber commented Feb 26, 2026

Min,Max,Sum,Clamp,ReduceSum,ReduceMin,ReduceMax

See #231

poke @d-enk

Copilot AI review requested due to automatic review settings February 26, 2026 21:10
@samber samber added enhancement Request or implementation of a new feature or improvement. operator Related to Operator logic or components (chainable transformation in reactive programming) plugin Development or maintenance of a plugin or extension in plugins/ directory. performance Issues or pull requests related to measuring or improving performance. go Pull requests that update go code labels Feb 26, 2026
@claude
Copy link

claude bot commented Feb 26, 2026

Claude finished @samber's task in 2m 3s —— View job


SIMD PR Review

  • Read implementation files
  • Review documentation structure
  • Check for bugs/issues
  • Verify against contribution guidelines
  • Post findings

Code Quality

The implementation is well-structured:

  • Follows ro's patterns correctly (context propagation, unsafe observables, teardown handling)
  • Good CPU feature detection with caching
  • Proper type parameter usage (~int8 etc. for named type support)
  • Comprehensive test coverage per codecov (65.04% maintained)
  • Package rename from simd to rosimd avoids import conflicts

Issues Found

1. Misleading Benchmark Summary (inline comment)

  • BENCHMARK.md summary claims SIMD is faster but shows an example where it's 3-4x slower (ReduceSumUint64/xlarge)
  • Consider using AddInt8/xlarge which shows actual ~1.5x speedup with AVX-512

2. CI Workflow License Step (test.simd.yml:36-40)

  • Already noted - references non-existent paths (ee/fixtures/license/...)
  • This will cause CI to fail

3. Documentation Issues (already noted in previous reviews)

  • Stray # in docs/docs/plugins/exp-simd.md:14
  • Missing fmt imports in doc examples

Performance Notes

SIMD shows mixed results:

  • Add/Sub: ~1.5x faster on large datasets with AVX-512
  • Reduce operations: Often slower due to scalar conversion overhead
  • The scalar↔vector conversion API adds overhead that may offset SIMD gains

Overall

Solid implementation. Main concerns:

  1. Fix the CI workflow (remove license prep step)
  2. Update benchmark summary to reflect reality or use a better example
  3. Address the documentation formatting issues (already noted)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds experimental SIMD (Single Instruction Multiple Data) operators to the ro reactive observables library, leveraging Go 1.26's experimental SIMD support for high-performance data processing on AMD64 processors.

Changes:

  • Implements SIMD-accelerated operators: Add, Sub, Min, Max, Clamp, ReduceSum, ReduceMin, ReduceMax
  • Supports SSE (128-bit), AVX2 (256-bit), and AVX-512 (512-bit) instruction sets with automatic CPU feature detection
  • Adds conversion operators for transforming between scalar and SIMD vector types
  • Includes comprehensive test suite and benchmarks for all variants
  • Provides extensive documentation in README and docs/ directory

Reviewed changes

Copilot reviewed 30 out of 36 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
plugins/exp/simd/simd.go Package documentation and empty file for non-AMD64 fallback
plugins/exp/simd/cpu_amd64.go CPU feature detection (AVX, AVX2, AVX-512)
plugins/exp/simd/errors.go Error definitions (ErrClampLowerLessThanUpper)
plugins/exp/simd/math_sse.go SSE math operators (128-bit vectors)
plugins/exp/simd/math_avx2.go AVX2 math operators (256-bit vectors)
plugins/exp/simd/math_avx512.go AVX-512 math operators (512-bit vectors)
plugins/exp/simd/conversion_sse.go SSE scalar/vector conversion operators
plugins/exp/simd/conversion_avx2.go AVX2 scalar/vector conversion operators
plugins/exp/simd/conversion_avx512.go AVX-512 scalar/vector conversion operators
plugins/exp/simd/*_test.go Comprehensive test suites for all implementations
plugins/exp/simd/go.mod Module definition requiring Go 1.26
plugins/exp/simd/README.md Detailed package documentation with usage examples
docs/data/plugin-simd-*.md Documentation for each SIMD operator
docs/docs/plugins/exp-simd.md Plugin overview documentation
go.work Updated workspace to Go 1.26 and added simd plugin
README.md Added SIMD plugin to plugin list
.github/workflows/test.simd.yml CI workflow for SIMD tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.04%. Comparing base (1a3a9be) to head (b5335c7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #232   +/-   ##
=======================================
  Coverage   65.04%   65.04%           
=======================================
  Files          95       95           
  Lines        9104     9104           
=======================================
  Hits         5922     5922           
  Misses       3088     3088           
  Partials       94       94           
Flag Coverage Δ
unittests 65.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samber samber merged commit 1d3b970 into main Feb 27, 2026
14 of 15 checks passed
@samber samber deleted the feat/exp-simd branch February 27, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Request or implementation of a new feature or improvement. go Pull requests that update go code operator Related to Operator logic or components (chainable transformation in reactive programming) performance Issues or pull requests related to measuring or improving performance. plugin Development or maintenance of a plugin or extension in plugins/ directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants