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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
//! What a retrieve is ASKED with: [`FulltextQuery`] and [`VectorQuery`] — a subject, and the score
//! floor every retrieve must carry.
use Utf8Bytes;
use crate::;
/// The floor a query DEFERRED — what stands in the floor's position while the number is still
/// somebody else's to supply.
///
/// # It is the floor's TYPE, which is what makes the deferral structural
///
/// A query is `Query<…, S, …>` where `S` is the engine's score currency, and a deferred one is
/// `Query<…, Deferred, …>`. So *this query has no floor yet* is a fact about its TYPE rather than a
/// state inside it: an engine-facing door names `<E as VectorEngine>::Score` in that position and a
/// deferred query does not unify with it, which is `E0308` at the call. **The engine boundary
/// therefore cannot be reached with an unresolved floor**, and nothing along the way has to check
/// that it was not.
///
/// The alternative measured against it was an `Option<S>` inside the query. It moves the same
/// question to run time, makes `floor()` an `Option` for every caller including the ones that
/// supplied a number, and leaves the door with a `None` arm it has no honest answer for — a floor
/// is MANDATORY at the engine, so the arm would have to invent one, panic, or grow an error nobody
/// ruled.
///
/// # Who resolves it
///
/// [`VectorQuery::floored`] / [`FoldedQuery::floored`](super::FoldedQuery::floored) — the chain's second
/// step, ruled *查询层传入 > attr 默认*: a caller who wrote a number at the query has one already,
/// and a caller who deferred is answered by the DECLARATION's own floor. The declaration's half is
/// the word an election has not got yet, so today the resolving party is whoever holds a number;
/// the seam is the same either way and is what the emitted face will call.
);
/// A full-text retrieve: the query text, and the minimum score a hit must reach to be returned.
///
/// # The floor is MANDATORY, and the constructor is what enforces it
///
/// It is a positional parameter of [`new`](Self::new) rather than an [`Option`] with a default,
/// because *必须指定* is a property of the signature or it is a property of the documentation. A
/// retrieve is an imprecise search, so an answer with no floor pads its tail with matches nobody
/// would call results; the floor is what makes a SHORT page the honest answer instead.
///
/// # Its type is the ENGINE's, not the framework's
///
/// `S` is [`FulltextEngine::Score`](crate::FulltextEngine::Score) — BM25's `f32` here, a double there, a
/// fused shape at a layer that ranks rather than measures. So the framework never reinterprets it
/// and never normalises it, and the floor's SEMANTICS follow the engine's: a BM25 floor is
/// corpus-relative and a cosine floor is absolute, which is the caller's calibration to make. What
/// the framework asks of the type is one thing, [`PartialOrd`], and it asks it where the comparison
/// happens rather than here.
///
/// # Language is not a parameter HERE, because it is SPENT UPSTREAM
///
/// Multilingual retrieval is still the posture, and its first claim is unchanged: the text may be
/// `"sunset"` and a German transcript carrying that word is a first-class hit, which the retrieve
/// tests assert over a live corpus. What has moved since that posture was written is WHERE language
/// is answered.
///
/// It rides the QUESTION — an annotation stage may fill it in for a caller who wrote none — and it
/// is spent twice before a read reaches this type: at ROUTING, where it chooses the lane, and at
/// WIDENING, where it decides the target list. By the time a question is lowered to a
/// [`FulltextQuery`] it is ONE LANE'S QUESTION ASKED OF ONE ENGINE, and the language has already
/// done all of its work. The missing seat here is therefore a DIVISION OF LABOUR rather than an
/// absence of the concept — and there IS a gate on this path, one layer up:
/// [`lane_for`](crate::lane_for) is it.
///
/// Analyzers are not the ENGINE's configuration either. A lane's EXISTENCE is a declaration fact —
/// the `lanes(…)` word inside a backend block, which mints the roster [`Lanes`](crate::Lanes)
/// publishes — and its analyzer is an assembly one, bound per `(slot, lane)` at boot. Tokenization
/// is chosen by the declaration and the deployment together, and never by a word written at a
/// query.
///
/// The cross-lingual claim keeps its rank and loses its overreach. A multilingual embedding space
/// does put *sunset* and *Sonnenuntergang* in one neighbourhood, so the crossing HOLDS AT RANK, and
/// the vector flavour is still where it lives. At SCORE it is CONDITIONAL: a cross-language pair
/// sits systematically below a same-language one, so a floor calibrated on same-language hits
/// prunes exactly the crossings the claim is about. This number therefore does two jobs at once —
/// it keeps the tail clean, and it is what a cross-lingual reader has to calibrate against the
/// CROSSING rather than against the corpus.
/// A vector retrieve: the query embedding, and the minimum score a neighbour must reach.
///
/// # The input rides [`Embedding<E, N, Space>`](Embedding), so the width is checked where it is BUILT
///
/// `knn` takes a bare `&[R::Element]` at the store seam and checks nothing about its length — the
/// width is the declared column's, and the one place a runtime length meets a compile-time width is
/// [`Embedding::new`]. A query built as an `Embedding<f32, 768>` has 768 coordinates or was never
/// constructed, so this type carries that proof to the seam rather than re-deriving it.
///
/// # The SPACE rides through untouched, and the door is where it is spent
///
/// `Space` is the embedding's third parameter carried forward and defaulted the same way ([`Anon`]),
/// so `VectorQuery<f32, f32, 768>` is the type it always was and every existing query is unchanged.
/// What it buys is at the far end: an emitted `retrieve_by_<field>` names the space its own elected
/// column was declared in, so asking a `Clip` column with a query somebody built in another space is
/// `E0308` AT THE CALL — the same refusal the width already gives, one axis over, for the mismatch a
/// width cannot see.
///
/// The parameter is spelled `Space` here rather than `S` because `S` is taken, by the SCORE — the
/// letter follows [`FulltextQuery<S>`](FulltextQuery)'s and the axis keeps its full name where they
/// would collide.
///
/// # The floor is what makes `k` a ceiling instead of a promise
///
/// An ANN search always answers with `k` neighbours however poor they are — that is what nearest
/// means. The floor is the whole quality gate: it converts *k results* into *at most k results,
/// none of them noise*, and a page coming back under-full is the ruling's own intent rather than a
/// defect to pad around.
/// The three are written rather than derived, for [`Embedding`]'s own reason: a derive bounds every
/// parameter it sees, and `Space` is a marker holding nothing that a sealed `pub struct Clip(());`
/// derives nothing for. A derived trio would take [`Debug`], [`Clone`] and equality off exactly the
/// queries that name a space.