Skip to content

Commit 47f8c24

Browse files
committed
Release v0.2.5: Fix buffer overread in compare_batch for unaligned dimensions
1 parent bcc9d3e commit 47f8c24

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

‎RELEASE_NOTES.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Release Notes
22

3+
## deglib v0.2.5
4+
5+
### Overview
6+
deglib v0.2.5 fixes a critical buffer overread bug in the AVX512 and AVX2 batch distance calculation kernels (`compare_batch`) for vector dimensions that require dual-SIMD and residual/tail processing (such as dimension 784 in MNIST / Fashion-MNIST, or other dimensions where $\text{dim} \pmod{32} \neq 0$ or $\text{dim} \pmod{64} \neq 0$).
7+
8+
---
9+
10+
### 🐛 Bug Fixes
11+
12+
* **SIMD Batch Distance Stepping (`compare_batch`):** Fixed chunk step and loop iteration counts in `HasDualSimd` blocks across `fp32_l2.h`, `fp32_ip.h`, `int8_l2.h`, and `uint8_l2.h`:
13+
* `L2Float_AVX512` / `InnerProductFloat_AVX512`: Dual-SIMD chunk count corrected to $\frac{\text{dim}}{32}$ (processing two 16-float vectors per iteration) instead of $\frac{\text{dim}}{16}$.
14+
* `L2Float_AVX2` / `InnerProductFloat_AVX2`: Dual-SIMD chunk count corrected to $\frac{\text{dim}}{16}$ (processing two 8-float vectors per iteration) instead of $\frac{\text{dim}}{8}$.
15+
* `L2Int8_AVX512` / `L2UInt8_AVX512`: Dual-SIMD chunk count corrected to $\frac{\text{dim}}{64}$ (processing two 32-byte vectors per iteration) instead of $\frac{\text{dim}}{32}$.
16+
* `L2Int8_AVX2` / `L2UInt8_AVX2`: Dual-SIMD chunk count corrected to $\frac{\text{dim}}{32}$ (processing two 16-byte vectors per iteration) instead of $\frac{\text{dim}}{16}$.
17+
* Prevents reading out-of-bounds memory in the subsequent `HasSimd` and `HasTail` branches, eliminating segmentation faults (Exit Code 139) and NaN distance calculations during graph construction and search on datasets with unaligned dimensions.
18+
19+
---
20+
21+
### 🧪 Testing
22+
23+
* **Unaligned Dimension Test Coverage:**
24+
* Added parameterized tests in Python (`test_build_unaligned_dimensions`) covering dimensions `48`, `80`, `100`, and `784` across `FP32_L2` and `FP32_InnerProduct`.
25+
* Expanded C++ distance test suite (`test_fp32_l2`, `test_fp32_inner_product`, `test_int8_l2`, `test_uint8_l2`) with unaligned dimension coverage in `VariousDims` and `MatchesSingleCompare`.
26+
27+
---
28+
329
## deglib v0.2.4
430

531
### Overview

‎python/src/deglib/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
)
2121
from .distances import FloatSpace, Metric
2222

23-
__version__ = "0.2.4"
23+
__version__ = "0.2.5"
2424

2525
__all__ = [
2626
"DynamicExplorationGraph",

0 commit comments

Comments
 (0)