Skip to content

convert vello_cpu to use #[simd] - #1875

Draft
Shnatsel wants to merge 5 commits into
linebender:mainfrom
Shnatsel:fearless-simd-1.0-dev-upgrade
Draft

Shnatsel wants to merge 5 commits into
linebender:mainfrom
Shnatsel:fearless-simd-1.0-dev-upgrade

Conversation

@Shnatsel

@Shnatsel Shnatsel commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

demonstrates how linebender/fearless_simd#347 applies to vello_cpu

x86 build times are unchanged, surprisingly.

No performance regressions from this PR. The initial conversion introduced some, but sticking #[inline(always)] on 3 functions fixed it - that's commit de2e4c1

I'm seeing performance improvements for fills:

fine/fill/opaque_short_u8_sse4_2
                        time:   [5.9306 ns 5.9947 ns 6.0566 ns]
                        change: [-19.952% -19.305% -18.819%] (p = 0.00 < 0.05)
                        Performance has improved.

fine/fill/opaque_short_u8_avx2
                        time:   [4.4478 ns 4.4540 ns 4.4601 ns]
                        change: [-32.146% -30.706% -29.160%] (p = 0.00 < 0.05)
                        Performance has improved.

fine/fill/opaque_long_u8_avx2
                        time:   [14.128 ns 14.207 ns 14.296 ns]
                        change: [-41.763% -41.529% -41.232%] (p = 0.00 < 0.05)
                        Performance has improved.
fine/strip/solid_long_u8_avx2
                        time:   [67.304 ns 67.348 ns 67.394 ns]
                        change: [-20.794% -20.736% -20.670%] (p = 0.00 < 0.05)
                        Performance has improved.

@LaurenzV

LaurenzV commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Seems like it somehow negatively affects WASM size for vello_cpu? Any idea why?

@Shnatsel

Shnatsel commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Hmm, 20% raw size increase but 3.8% increase gzipped; probably added something repetitive that gzip can easily remove.

I'll see what I can do to investigate.

@Shnatsel

Shnatsel commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Codex bisected the regression to linebender/fearless_simd@ff8ee04

I've reverted that commit, let me re-run the benchmarks

@Shnatsel

Shnatsel commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author
fine/fill/opaque_long_u8_avx2
                        time:   [13.623 ns 13.624 ns 13.625 ns]
                        change: [-43.012% -42.974% -42.939%] (p = 0.00 < 0.05)
                        Performance has improved.

This performance improvement stays, the other fill improvements are gone. I'll see what I can do about that. Also, one more regression appeared that I'll need to address.

@Shnatsel

Shnatsel commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Fixed pixmap/unpremultiply/opaque benchmark regression.

The short AVX2 paths vary in timings between runs, so the earlier 20% improvement was spurious.

Results as of 1d34528: fine/fill/opaque_long_u8_avx2 improves by 40%, all other run-by-default benchmarks are neutral.

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