feat: add opt-in Highway SIMD support to DSUMPW - #15106
Draft
teddygood wants to merge 5 commits into
Draft
Conversation
Add optional Highway download, checksum verification, extraction, and
header installation tests using the existing dependency Make rules.
Keep Highway out of the default development dependency installation.
Verified a fresh parallel installation and rejection of an invalid
checksum before extraction. Existing DSUMPW package tests pass.
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown_pkg_readmes
status: na
- task: lint_markdown_docs
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Build the upstream hwy target as a reusable static library and export
its headers, compile definitions, and link dependencies as metadata.
Add runtime linkage and metadata checks alongside installation docs.
Verified fresh GCC builds with and without libatomic, CTest, seven
metadata assertions, and filename lint tests.
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Select the Highway kernel through the native manifest and link the
prepared runtime from GYP. Keep the existing C implementation when the
backend is unset, and preserve the pairwise reduction grouping.
Add native parity and manifest checks with build documentation.
Verified 175 assertions for GCC and Clang Release and Debug, GCC with
libatomic, and the restored default build. Missing-runtime configuration
and 14 integration assertions also pass.
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: passed
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Add a static Wasm entry for the shared DSUMPW kernel and propagate
backend sources and definitions through the DMEANPW manifest chain.
Build C and C++ inputs separately while retaining scalar defaults.
Check pointers, special values, and definition resolution failures.
Fresh scalar and Highway builds each pass 106 assertions. Verified
22 integration assertions, backend switching, definition invalidation,
and 79 assertions for legacy scalar DASUM.
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: passed
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Contributor
|
👋 Hi there! 👋 And thank you for opening your first pull request! We will review it shortly. 🏃 💨 Getting Started
Next Steps
Running Tests LocallyYou can use # Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"
# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR. If you have any further questions while waiting for a response, please join our Zulip community to chat with project maintainers and other community members. We appreciate your contribution! Documentation Links |
teddygood
marked this pull request as draft
September 8, 2026 17:39
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.
Description
This pull request:
With
SIMD_BACKEND=highway, inputs withN > 128and unit stride use Highway, preserving the existing addition order and C interface. Default builds still use C without requiring Highway or CMake. Highway builds require C++17, and Wasm requires a SIMD-capable runtime. See the [installation guide](https://github.com/teddygood/stdlib/blob/feature/dsumpw-highway-review/tools/make/lib/install/README.md#highway) for native build requirements and options.I chose Highway mainly for how it handles multiple CPU targets. The DSUMPW comparisons with direct intrinsics, SIMDe, and xsimd gave similar throughput. xsimd also supports runtime dispatch, but my prototype needed separate SSE2 and AVX2 build targets and compiler flags. Highway handles target generation and native dispatch, which I expect to make adding more kernels easier.
Both xsimd and Highway worked in Wasm. This implementation shares the Highway kernel between native and Wasm builds, though it requires C++17 and additional build setup.
Related Issues
This pull request has the following related issues:
blas/daxpy#13068) (Highway/DAXPY draft)Questions
Does the shared Highway runtime and opt-in build setup fit stdlib's build system?
Other
Performance
Measured with
benchmark.ndarray.native.jsandbenchmark.module.ndarray.jsin the following environment:Each path and backend was measured in six independent runs. Throughput is the median of per-run medians of three repetitions.
Highway/default C throughput for each path:
Measurements used repeated calls after warmup. Wasm uses Module.ndarray with inputs already in Wasm memory, excluding module initialization and copying JavaScript typed arrays into Wasm memory.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
I used GPT-6 Astra to generate and refine tests and benchmarks.
@stdlib-js/reviewers