Skip to content

Initial yup_simd#107

Merged
kunitoki merged 5 commits into
mainfrom
dev/simd
May 30, 2026
Merged

Initial yup_simd#107
kunitoki merged 5 commits into
mainfrom
dev/simd

Conversation

@kunitoki
Copy link
Copy Markdown
Owner

@kunitoki kunitoki commented May 29, 2026

Initial implementation of the yup_simd module, providing SIMD-accelerated operations for audio and graphics processing.

Changes Made

  • SIMDRegister: Template SIMD register wrapper over xsimd, with type aliases Float4, Float8, Double2, Double4 and support for arithmetic operators, reductions (sum, hmax), mulAdd, aligned/unaligned load and store.
  • AffineTransformOperations: SIMD-accelerated 2D affine transform of point arrays (separate and in-place variants).
  • ColorVectorOperations: SIMD-accelerated pixel operations — premultiplyARGB, premultiplyRGBA, format conversions (ARGB→RGBA, grayscale→RGBA, RGB→RGBA), and lerpRows.
  • ComplexVectorOperations: SIMD-accelerated complex multiplication, multiply-accumulate, and power spectrum (AVX+FMA, SSE, and NEON paths).
  • FloatVectorOperations: SIMD-accelerated float/double array operations (add, subtract, multiply, divide, clip, min, max, abs, negate, reductions, conversions, denormal handling).
  • Vec2f / Vec4f: Lightweight SIMD-backed vector types for 2D geometry and RGBA colour.

Testing

Comprehensive unit tests added for all classes in tests/yup_simd/, targeting near-100% coverage:

  • yup_SIMDRegister.cpp: ~35 tests covering all methods and type aliases including partial batch sizes.
  • yup_AffineTransformOperations.cpp: 9 tests with a scalar reference implementation for correctness verification (separate/in-place, identity, translation, scale, edge cases).
  • yup_ColorVectorOperations.cpp: 25+ tests covering all conversion functions with edge cases (alpha=0/255, zero-pixel no-ops, lerp at t=0/0.5/1).
  • yup_ComplexVectorOperations.cpp: 17 tests covering multiply, multiplyAccumulate, and powerSpectrum with single pairs, unit vectors, Pythagorean triples, and large buffers.
  • yup_Vec.cpp: 37 tests for Vec2f and Vec4f covering arithmetic, dot product, length, normalization, lerp, premultiplied alpha, and load/store.
  • tests/CMakeLists.txt: yup_simd added to target_modules so all tests are compiled and run.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 76.40449% with 105 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.80%. Comparing base (2ae4d72) to head (8d19bd3).

Files with missing lines Patch % Lines
...dio_gui/displays/yup_SpectrumAnalyzerComponent.cpp 15.23% 89 Missing ⚠️
modules/yup_graphics/imaging/yup_Image.cpp 0.00% 15 Missing ⚠️
modules/yup_dsp/metering/yup_LevelProcessor.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
+ Coverage   75.29%   75.80%   +0.50%     
==========================================
  Files         597      602       +5     
  Lines       60462    60841     +379     
==========================================
+ Hits        45527    46121     +594     
+ Misses      14935    14720     -215     
Files with missing lines Coverage Δ
...audio_gui/displays/yup_SpectrumAnalyzerComponent.h 92.30% <100.00%> (+2.30%) ⬆️
...s/yup_dsp/convolution/yup_PartitionedConvolver.cpp 92.92% <100.00%> (+1.80%) ⬆️
modules/yup_dsp/utilities/yup_DspMath.cpp 100.00% <100.00%> (ø)
modules/yup_graphics/graphics/yup_Color.h 93.93% <ø> (ø)
...ules/yup_graphics/primitives/yup_AffineTransform.h 99.00% <ø> (ø)
...yup_simd/buffers/yup_AffineTransformOperations.cpp 100.00% <100.00%> (ø)
...les/yup_simd/buffers/yup_ColorVectorOperations.cpp 100.00% <100.00%> (ø)
...s/yup_simd/buffers/yup_ComplexVectorOperations.cpp 100.00% <100.00%> (ø)
...les/yup_simd/buffers/yup_FloatVectorOperations.cpp 96.71% <100.00%> (+64.70%) ⬆️
modules/yup_simd/types/yup_SIMDRegister.h 100.00% <100.00%> (ø)
... and 4 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ae4d72...8d19bd3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kunitoki
Copy link
Copy Markdown
Owner Author

@copilot Implement yup_simd module unit tests that are meaningful and that exercise all the changed classes extensively, try to aim at increasing coverage near 100%

Copy link
Copy Markdown

Copilot AI commented May 29, 2026

@copilot Implement yup_simd module unit tests that are meaningful and that exercise all the changed classes extensively, try to aim at increasing coverage near 100%

Implemented comprehensive unit tests for all yup_simd classes. Here's what was added (commit Add comprehensive yup_simd unit tests for all classes):

  • tests/CMakeLists.txt: Added yup_simd to target_modules so the tests are actually compiled.
  • yup_SIMDRegister.cpp: ~35 tests covering default ctor, zero(), broadcast(), element access, arithmetic operators (+, -, *, /, +=, *=), min, max, abs, sum, hmax, mulAdd, aligned/unaligned load/store, all type aliases (Float4, Float8, Double2, Double4), and partial/non-power-of-2 sizes.
  • yup_AffineTransformOperations.cpp: 9 tests with a scalar reference helper — separate src/dst, in-place, identity transform, pure translation, pure scale, single point, zero points, large buffer (100 pts), and 3-point scalar tail path.
  • yup_ColorVectorOperations.cpp: 25+ tests covering premultiplyARGB/premultiplyRGBA with alpha=0/255/half, convertARGBtoRGBA (in-place, zero pixels, edge cases), convertGrayscaleToRGBA, convertRGBToRGBA, and lerpRows at t=0/0.5/1 and with zero/multiple pixels.
  • yup_ComplexVectorOperations.cpp: 17 tests covering multiply (single pair, identity, conjugate, large buffer), multiplyAccumulate (zero input, single pair, large buffer), and powerSpectrum (zero/unit vectors, zero pairs, Pythagorean triples, large buffer).
  • yup_Vec.cpp (new): 37 tests for Vec2f (ctor, +, *, dot, length, normalized, zero vector) and Vec4f (ctor, +, scalar *, element-wise *, lerp at 0/0.5/1/0.25, premultiplied with alpha=0/0.5/1, load/store).

Copilot AI changed the title Initial yup_simd Initial yup_simd May 29, 2026
@kunitoki kunitoki merged commit 186fd60 into main May 30, 2026
40 checks passed
@kunitoki kunitoki deleted the dev/simd branch May 30, 2026 20:13
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.

2 participants