Skip to main content

Crate khive_score

Crate khive_score 

Source
Expand description

Cross-platform deterministic scoring.

DeterministicScore converts f64 to fixed-point i64 (2^32 scale) for identical ranking across x86_64, ARM64, and WASM.

Vector similarity (dot product, cosine) is not in this crate — it belongs with the embedding implementation (lattice).

Structs§

DeterministicScore
QuantKey
8-byte packed sort key: i32 quantized score + u32 ID prefix.
Ranked
Ranked item: score descending, ID ascending for ties.

Enums§

ScoreError

Functions§

avg_scores
avg_scores_checked
cmp_asc_then_id
Compare scores ascending, lower ID wins ties.
cmp_desc_then_id
Compare scores descending, lower ID wins ties.
max_score
min_score
rrf_score
Reciprocal Rank Fusion score: 1 / (k + rank).
sum_scores
weighted_sum