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
{{ message }}
Repository navigation
[Bug]: IVFFLAT index creation panics on vectors containing NaN or Infinity #28688
dropdatabase if exists repro_ivf_nonfinite;
createdatabaserepro_ivf_nonfinite;
use repro_ivf_nonfinite;
createtablet(id bigintprimary key, v vecf32(3));
insert into t values
(1, '[1,2,3]'),
(2, '[0,0,0]'),
(3, '[NaN,0,0]'),
(4, '[2,1,0]');
createindexix using ivfflat on t(v)
lists=2
op_type 'vector_l2_ops'
kmeans_train_percent 100
kmeans_max_iteration 20;
实际行为
ERROR 20101 (HY000): internal error: panic runtime error: index out of range [-8]:
runtime.panicBounds64
runtime.panicBounds
github.com/matrixorigin/matrixone/pkg/container/vector.(*Vector).UnionOne
github.com/matrixorigin/matrixone/pkg/sql/colexec/productl2.probeRun[...]
Activity
Ariznawlll commentedon Sep 11, 2026
补充类型范围:同一问题也影响新窄向量类型
VECF16和VECBF16。VECF16(3)含[Inf,0,0]时,CREATE INDEX ... USING IVFFLAT进入相同的productl2.probeRun -> Vector.UnionOne、index out of range [-8]路径。VECBF16(3)含[NaN,0,0]时进入相同路径。因此触发范围不是仅限
VECF32/VECF64,而是所有允许携带非有限分量且由 IVFFLAT 支持的浮点向量类型;整数窄向量VECINT8/VECUINT8不存在该输入。环境仍为 main47d72b104a15e212c983e9ecdbeb7f44ecf7a0b8。Ariznawlll commentedon Sep 11, 2026
最新 main 复验:
7013fbbd6e152ba31da2d3dbba7012ac7f8b8462(其中包含 #28622 的 IVF 计划读取/执行观测改动),使用全新本地 2CN/1TN/1Log 数据目录。VECF32+NaN:连续 3 次均返回index out of range [-8]的内部 panic。VECF32++Inf:进入同一 panic 路径。因此该问题在当前最新 main 仍存在,新合入的 IVF 改动未改变该触发路径。
fix(vector): reject NaN/Inf vector elements at the cast boundary (#28688
cpegeric commentedon Sep 14, 2026
please verify
Ariznawlll commentedon Sep 15, 2026
测试版本
main:0c3a04f390adaf6281fd592a49778ea5b1155e67原问题验证
向向量表插入
NaN后创建 IVFFLAT 索引;当前在写入阶段返回受控错误vector element cannot be NaN or Inf,服务未退出。Happy Path 覆盖
覆盖有限 float 向量的写入、IVFFLAT 索引创建和索引元数据存在性。
Unhappy Path 覆盖
覆盖 NaN/Infinity 非有限元素,确认拒绝发生在建索引前且不会 panic。
白盒验证
公开 SQL 路径已覆盖关键输入校验与索引创建边界。
回归测试
已加入 MOTR:
issue_28688_ivfflat_nonfinite,见 motr#176。测试证据
新 MOTR 用例连续运行 3 轮成功;NaN 拒绝、有限行保留及 IVFFLAT 创建均稳定通过。
测试结论
测试通过。
fix(vector): reject NaN/Inf vector elements at the cast boundary (mat…
fix(vector): reject NaN/Inf vector elements at the cast boundary (mat…
fix(vector): reject NaN/Inf vector elements at the cast boundary (mat…
revert(hnsw): drop the Add-time stored-vector validation