You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(bgz17): guard SIMD gather over-read on final distance-matrix row
The AVX2/AVX-512 batch palette lookup uses an i32 gather with scale=2 over
the u16 distance matrix, loading each lane's target u16 PLUS the following
u16 into the high half (masked off). On the last valid index of dm_data
(query==k-1, candidate k-1) that high half reads one u16 past the backing
slice — an out-of-bounds read.
Guard both the AVX2 and AVX-512 paths: when the row's worst-case over-read
(row_offset + k, candidate k-1's high half) is not strictly inside dm_data,
route the whole batch through the scalar path, which only ever touches
row_offset + c. Affects at most the final row of a tight k×k matrix
(<=1/k of queries).
Adds test_batch_last_row_full_width regression: k=64 (exact multiple of
both SIMD widths), last row, full-width batch including candidate k-1.
https://claude.ai/code/session_01D2WSmezQBNC3bUdHuGfGmo
0 commit comments