yes, right,
if length is a multiple of 15, there is an issue.
And there is no primitive for masking on AVX2, those are only available on AVX-256.
if we want to minimize the iterations of the post loop, it should be
var upperBound = length % 15 == 0? length - 15: length - length % 15;
but as you said, i'm not sure the VM will eliminate the bound checks in that case
so your solution seems to be the best var upperBound = length - 15