1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! [`Fusion`] — WHICH fold runs over the member lists, and the one member v1 ships.
/// The fusion strategy a fused retrieve runs.
///
/// # One variant, and the shape is what makes the second one cheap
///
/// v1 ships reciprocal rank fusion and nothing else. It is an enum rather than a bare `k` because
/// the vocabulary is the FRAMEWORK's — a closed set of folds this crate implements, the way
/// [`Dedup`](crate::retrieve::Seen)'s two mechanisms are — and a second member is then an arm plus
/// a match, at every call site the compiler can find. Spelling it as a `k` today would make the
/// second fold a signature change instead.
///
/// # The families this type refuses BY NAME
///
/// CombSUM, CombMNZ, weighted score interpolation — every fold that ADDS or averages the members'
/// SCORES — are refused, and the refusal is the whole reason the parameter is a rank and not a
/// score. A BM25 relevance and a cosine similarity are two currencies; adding them produces a number
/// whose ordering depends on which engine happened to be scaled larger, which is not a ranking of
/// anything. Normalising first only moves the problem: a min-max normalisation over one query's
/// returned window is a function of the window, so the same document scores differently depending on
/// what else came back.
///
/// A CUSTOM fold — a trait seam a third party implements — is deferred to demand rather than
/// refused. Nothing here forecloses it: an open seam arrives as one more variant carrying the
/// implementor, and this type is where it would land.
///
/// Per-modality WEIGHTS are a named future knob, and the shape they take is additive: RRF's own term
/// gains a coefficient, `wᵢ / (k + rank)`. That is a widening of [`Rrf`](Self::Rrf) rather than a new
/// member, and it is not built because no ruling has set what a weight means.
///
/// # `#[non_exhaustive]`, and what it costs whom
///
/// The two paragraphs above both end in *one more variant*, so the attribute is the accurate
/// statement rather than a precaution. It costs a DOWNSTREAM `match` a wildcard arm and costs this
/// crate's own fold nothing, the attribute being invisible inside the crate that defines it — and no
/// downstream `match` is expected anyway: a client BUILDS one of these and the emitted face passes
/// it through, which is the direction the attribute leaves untouched.
/// The fold a fused retrieve runs when its caller names none.