pub const RECENCY_WEIGHT: f64 = 0.002;Expand description
G12-recency — additive recency weight. Must satisfy two constraints:
- Small enough to never override a clear RRF signal: a gap of > RECENCY_WEIGHT between two hits’ RRF scores means the stronger RRF hit always wins.
- Large enough to break exact ties: any hit with a higher
write_cursor(more recent) gets RECENCY_WEIGHT × 1.0 > 0 nudge and wins a tied comparison.
Value 0.002 satisfies the near-tie-nudge contract with respect to the
committed test (recency_does_not_override_a_clear_rrf_signal):
the test’s RRF gap is 0.01, which is larger than 0.002, so recency
never overrides it. Note: this value is larger than the minimum
vector-only rank-step at deep ranks (~0.00101 for adjacent ranks near
the bottom), so recency can flip a single-rank vector difference at
deep ranks — by design, recency is a near-tie nudge, and “near-tie”
is scoped to the test gap (0.01), not to every possible rank step.
0.8.1 Slice 10 fix: the previous value 0.5/RRF_K ≈ 0.01667 violated
the test gap constraint (it exceeded 0.01). Lowered to 0.002.