Skip to content

YantrikDB

v0.9.2 Bugfix

This release fixes issues for SREs watching stability and regressions.

✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

agent-memory ai-agents anthropic claude-code cognitive-memory database
+12 more
embeddings hnsw knowledge-graph llm llm-memory mcp memory persistent-memory python rust semantic-memory vector-db

Affected surfaces

breaking_upgrade

Summary

AI summary

Updates Fix, Root cause, and https://github.com/yantrikos/yantrikdb/issues/60 across a mixed release.

Changes in this release

Bugfix High

Fixes panic caused by NaN-valued embeddings during recall() or procedure(action="surface").

Fixes panic caused by NaN-valued embeddings during recall() or procedure(action="surface").

Source: llm_adapter@2026-07-15

Confidence: high

Bugfix Medium

Adds zero-norm and NaN guard to hnsw cosine_distance norm check.

Adds zero-norm and NaN guard to hnsw cosine_distance norm check.

Source: granite4.1:30b@2026-07-15-audit

Confidence: low

Bugfix Medium

Replaces custom float sort comparators with f64::total_cmp for IEEE total order.

Replaces custom float sort comparators with f64::total_cmp for IEEE total order.

Source: granite4.1:30b@2026-07-15-audit

Confidence: low

Full changelog

v0.9.2 — patch

Fixes #60: a NaN-valued embedding could panic the process during recall() / procedure(action="surface").

Root cause (two bugs compounding)

  1. hnsw.rs cosine_distance()''s zero-norm guard used norm == 0.0, which misses NaN (NaN == 0.0 is false) — so a NaN embedding produced a NaN score with no interception.
  2. Sort comparators used partial_cmp(..).unwrap_or(Ordering::Equal), which is not a valid total order once NaN mixes with finite scores. Rust ≥ 1.81''s driftsort detects the broken transitivity and panics ("user-provided comparison function does not correctly implement a total order"), killing the call and leaving MCP sessions returning -32602.

Fix

  • hnsw norm guard is now !(norm > 0.0) — catches NaN, zero, and negatives; distance is always finite.
  • Crate-wide sweep: every float sort comparator (117 sites across 40 files, including the recall_profiled profiling-gated duplicates and the hnsw heap Ord impls) now uses f64::total_cmp — IEEE totalOrder, never panics, order-identical to partial_cmp for all finite values.
  • Regression tests: NaN/zero-norm distance guard + end-to-end recall with a NaN embedding mixed into finite candidates.

Credit: reported by @blue-mtn-dog with an exceptional root-cause analysis — traced to exact source lines against the v0.9.1 tag, including the driftsort total-order precondition.

Published to PyPI (pip install -U yantrikdb) and crates.io (yantrikdb).

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

Share this release

Track YantrikDB

Get notified when new releases ship.

Sign up free

About YantrikDB

All releases →

Related context

Earlier breaking changes

  • v0.9.3 `recall_demand` isolation is namespace‑keyed and disabled on encrypted databases, purging legacy rows via migration.
  • v0.7.20 `correct()` now mutates in place, preserving rid and adding revision history (BREAKING CHANGE).
  • v0.7.9 Pure-additive; existing engines keep English models on v0.1.0.

Beta — feedback welcome: [email protected]