Skip to content

compute_vecs_l2sq doesn't validate that vecs_l2sq.len() == num_points #937

@arrayka

Description

@arrayka

compute_vecs_l2sq doesn't validate that vecs_l2sq.len() == num_points. If a caller accidentally passes a smaller (or larger) output buffer, this will silently compute the wrong subset and still return Ok(()), which can lead to incorrect clustering/partitioning. Consider checking the output length and returning an error on mismatch.

Originally posted by @Copilot in #933 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions