Skip to content

SIMD deinterleave#20

Closed
loic-fejoz wants to merge 2 commits intoFutureSDR:mainfrom
loic-fejoz:feat/perf-deinterleave
Closed

SIMD deinterleave#20
loic-fejoz wants to merge 2 commits intoFutureSDR:mainfrom
loic-fejoz:feat/perf-deinterleave

Conversation

@loic-fejoz
Copy link
Copy Markdown
Collaborator

  • Introduce documentation for AGENTS
  • Use Rust Experimental core::simd to ensure vectorization of Deinterleaving

- Enable #![feature(portable_simd)] and #![feature(specialization)] (Nightly).
- Implement DeinterleaveSupported trait to provide specialized SIMD paths.
- Add SIMD-accelerated deinterleaving for f32, u8, i8, and i16 using a 8-lane configuration.
- Introduce deinterleave_scalar_logic for the base case and tail processing.
- Use a macro to reduce duplication across SIMD-supported types.
- Add comprehensive unit tests covering odd sample counts and multiple types.
- Add a Criterion benchmark to track deinterleaving performance (reaching ~1 Gelem/s).
- Update documentation in AGENTS.md and agent_docs/ to reflect the new performance pattern.
@loic-fejoz loic-fejoz requested a review from ratzrattillo March 21, 2026 21:21
@loic-fejoz loic-fejoz self-assigned this Mar 21, 2026
@loic-fejoz loic-fejoz closed this Mar 21, 2026
}
}

macro_rules! impl_deinterleave_simd {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested, if instead of implementing deinterleave using simd isntruction, this can also be achieved using autovectorization?
AI generated code is usually very good, if reviewd correctly. Still, allowing your agent to check, if the code generated by a non-simd implementation is being autovectorized, might keep the code more readable also for humans.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I did try autovectorization but was not able to achieve this portably. So after several trials, I went to add this explicitly. But if you have hints, maybe I can try again.

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