Stress-Testing Strided Tensors: 8,187 View Ops Under Miri
Exposing negative strides, transpositions, and multi-axis slicing to randomized mutation fuzzing.
Negative strides combined with non-zero byte offsets caused an integer underflow in raw pointer arithmetic during reverse slicing.
Raw pointers must always calculate offsets in signed isize before applying to the base NonNull<T> pointer.
Stress-Testing Strided Tensors: 8,187 View Ops Under Miri
Negative strides combined with non-zero byte offsets caused an integer underflow in raw pointer arithmetic during reverse slicing.
Raw pointers must always calculate offsets in signed isize before applying to the base NonNull<T> pointer.
Strided memory layouts are notoriously error-prone in native C/C++/Rust engines. If your stride math is off by even one byte, you end up reading past buffer bounds.
To guarantee correctness before moving to CUDA, we built a custom view-op fuzzer generating:
- Random rank dimensions ($1 \le r \le 6$)
- Permutations, transpositions, and reverse slices
- Multi-dimensional negative strides
The 8,187 Fuzzing Campaign
We ran 8,187 randomized operation chains under AddressSanitizer and Miri. The outcome:
[8,187 ops] full multi-axis fuzz suite completed.
Zero panics, zero segfaults, zero memory corruption.