What problem does it solve?
Writing or reviewing vectorized .NET code is error-prone: remainder handling, unsigned offset underflow, GC holes from stray references, and untested fallback paths cause subtle bugs. This Skill distills the dotnet/runtime vectorization guidelines into concrete authoring, testing, and review checklists.
Core Features & Use Cases
- Authoring checklist: Structure code from Vector128<T> down to scalar fallbacks, use span-based loads/stores, handle empty buffers via MemoryMarshal.GetReference, and guard against nuint underflow.
- Testing checklist: Cover Vector256/Vector128/scalar paths, toggle acceleration with DOTNET_EnableAVX2=0 and DOTNET_EnableHWIntrinsic=0, and use BoundedMemory to catch out-of-bounds reads.
- Review checklist: Verify correctness against the scalar contract, remainder handling, memory safety, cross-platform consistency, and benchmark-backed performance claims.
- Use Case: When vectorizing a scalar search algorithm with Vector128<byte>, apply the checklist to overlap the final vector for the remainder, guard with IsHardwareAccelerated, and validate with BoundedMemory tests under each DOTNET_Enable* setting.
Quick Start
Ask the AI to review or write a vectorized implementation of your algorithm using Vector128<T> with proper remainder handling and hardware-acceleration fallbacks.