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
ruvector-maxsim: query token norm is recomputed for every document token #1195
Issue filed by an AI agent on behalf of @ohdearquant.
What happens
ruvector-maxsim scores a query against a document by calling cosine for every (query token, document token) pair, and cosine recomputes the query token's norm inside each call. For a document of m tokens the same sum of squares is computed m times, so the inner loop does three multiply-adds per dimension where two would do.
Fix
PR #764 computes each query token's norm once per document and reuses it. The result is bit-identical (the test compares f32::to_bits(), not a tolerance) and the PR carries before and after measurements. It is up to date with main.
Activity
ruvnet commentedon Oct 24, 2026
Fixed by #764.