Skip to content

fix: add SumsOf2 fallback for Highway < 1.1.0#669

Closed
KimYannn wants to merge 1 commit into
OpenGene:masterfrom
KimYannn:fix/hwy-sumsof2-compat
Closed

fix: add SumsOf2 fallback for Highway < 1.1.0#669
KimYannn wants to merge 1 commit into
OpenGene:masterfrom
KimYannn:fix/hwy-sumsof2-compat

Conversation

@KimYannn

Copy link
Copy Markdown
Member

Summary

  • Add compile-time fallback for SumsOf2 when building against Highway < 1.1.0
  • On Highway >= 1.1.0, uses the native hn::SumsOf2 with zero overhead
  • Fallback implements pairwise widen-and-add via store/scalar-add/load, used only in the quality metrics reduction path (not inner-loop hot path)

Test plan

  • Verified simd.o compiles cleanly with Highway 1.3.0 (native path)
  • Verify build on a system with Highway < 1.1.0 (e.g. Ubuntu 22.04 apt package)
  • Run testSimd() to confirm correctness on both paths

🤖 Generated with Claude Code

SumsOf2 (pairwise widen-and-add) was introduced in Highway 1.1.0 but
some distro packages ship older versions.  Add a compile-time fallback
that implements the same semantics via store/scalar-add/load, gated on
HWY_MAJOR/HWY_MINOR.  On Highway >= 1.1.0 the native op is used with
zero overhead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@KimYannn

Copy link
Copy Markdown
Member Author

Superseded by #670 which includes this fix plus additional optimizations.

@KimYannn KimYannn closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant