mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-30 03:53:34 +00:00
This commit fixes a critical P0 bug where HNSW indexes on ruvector columns would crash PostgreSQL with a segmentation fault when using parameterized queries (prepared statements, ORMs, application drivers). Root Cause: - Query vector extraction failed for parameterized queries - Code fell back to zero vector without validation - Zero vector caused segfault during HNSW search Changes: - Add multi-method query vector extraction pipeline 1. Direct RuVector::from_polymorphic_datum() 2. Text parameter conversion for parameterized queries 3. Validated varlena fallback with dimension checking - Add query_valid flag to track extraction success - Add validation before search execution: - Reject empty/invalid query vectors with clear errors - Reject all-zero vectors (invalid for similarity search) - Validate dimension match between query and index - Apply same fixes to IVFFlat for consistency Testing: - Added regression tests for parameterized queries - Added tests for zero vector error handling - Added tests for dimension mismatch errors - Added 384-dimension production-scale tests Fixes: #141 See: docs/adr/ADR-0027-hnsw-parameterized-query-fix.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| attention | ||
| bin | ||
| dag | ||
| distance | ||
| embeddings | ||
| gated_transformer | ||
| gnn | ||
| graph | ||
| healing | ||
| hybrid | ||
| hyperbolic | ||
| index | ||
| integrity | ||
| learning | ||
| quantization | ||
| routing | ||
| sparse | ||
| tenancy | ||
| types | ||
| workers | ||
| lib.rs | ||
| operators.rs | ||