Skip to content

Add wasm32 simd128 dedup - #25

Merged
RagnarGrootKoerkamp merged 6 commits into
rust-seq:masterfrom
bede:wasm-dedup
Oct 24, 2026
Merged

RagnarGrootKoerkamp merged 6 commits into
rust-seq:masterfrom
bede:wasm-dedup

Conversation

@bede

@bede bede commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

LLM-written wasm32 simd128 intrinsics for dedup. Second (large -160 line) commit merges NEON and wasm32 simd128 paths delivering speedups in both paths in a microbenchmark. Discussed with @RagnarGrootKoerkamp but touches lots of your code @imartayan.

NEON before  NEON after   wasm before  wasm after
1.00x        1.18-1.25x   1.00x        1.13-1.20x

bede and others added 6 commits October 23, 2026 19:46
Share one implementation over a small per-arch v128 module and a
const-generated 256-entry shuffle table, replacing the hand-written
UNIQSHUF_NEON table and wasm per-half compaction. Use a lane shift
(vext / i32x4_shuffle) for the preceding-element rotation.

Dedup microbench: ~1.2x on NEON, ~1.15x throughput on wasm (wasmtime).
Microbenchmark: append_unique_vals, append_unique_vals_2 and
append_filtered_vals over 64Ki non-decreasing u32x8 vectors (mean run
lengths 1-30), best of 200 runs.
Use to_bitmask() and a generic lane shift; both lower to addv / ext on
NEON. wide's swizzle is single-register, so NEON keeps vqtbl2q_u8.
@RagnarGrootKoerkamp
RagnarGrootKoerkamp merged commit 41c84f5 into rust-seq:master Oct 24, 2026
2 checks passed
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