GCC Code Coverage Report


Directory: src/
File: src/index/posting_build.h
Date: 2026-11-18 16:12:57
Exec Total Coverage
Lines: 35 35 100.0%
Functions: 3 3 100.0%
Branches: 3 4 75.0%

Line Branch Exec Source
1 /*
2 * Copyright (c) 2026 Tiger Data, Inc.
3 * Licensed under the PostgreSQL License. See LICENSE for details.
4 *
5 * posting_build.h - Posting list construction
6 *
7 * Vector-to-cluster assignment (tree descent, SOAR, boundary
8 * replication) and streaming page builder. Used by both standalone
9 * and PostgreSQL builds. No PostgreSQL dependencies.
10 */
11
12 #ifndef PRISM_POSTING_BUILD_H
13 #define PRISM_POSTING_BUILD_H
14
15 #include <stdbool.h>
16 #include <stdint.h>
17
18 #include "algo/hkmeans.h"
19 #include "core/atomics.h"
20 #include "core/memory.h"
21 #include "core/types.h"
22 #include "index/posting_page.h"
23 #include "index/query_scan.h"
24 #include "index/storage.h"
25 #include "quant/rabitq.h"
26
27 /* Opaque: the cluster-keyed sorter (defined in parallel_build.h). */
28 typedef struct PrismSorter PrismSorter;
29
30 /* ----------------------------------------------------------------
31 * Vector-to-cluster assignment
32 * ---------------------------------------------------------------- */
33
34 #define PRISM_INVALID_CLUSTER UINT32_MAX
35
36 typedef struct PrismAssignParams
37 {
38 Dimension dim;
39 DistanceMetric metric;
40 double soar_lambda;
41 double boundary_epsilon;
42 } PrismAssignParams;
43
44 typedef struct PrismBuildAssignment
45 {
46 uint32_t primary;
47 uint32_t secondary;
48 const float *enc_vector;
49 } PrismBuildAssignment;
50
51 /*
52 * Beam parameters of the build-time leaf-candidate pool. The page-backed
53 * assign path routes each row with nprobe = PRISM_SECONDARY_TOPK, then
54 * exact-re-ranks those leaf finalists against their head pages'
55 * full-precision pt_centroids: the primary is the exact-nearest finalist,
56 * the boundary cluster the exact 2nd-nearest, and SOAR's
57 * orthogonality-amplified search scans all of them exactly (its optimum
58 * need not be the nearest-by-distance leaf, but it is always among the
59 * near ones). The in-RAM assign path (prism_build_assign_vector) descends
60 * the exact float tree with the same widths.
61 *
62 * TOPK 32 / BEAM_WIDTH 64: with the internal levels scored exactly (see
63 * PRISM_BUILD_CENTROID_BEAM_SCALE below), leaf assignment quality is bounded
64 * by how often the true nearest leaf sits inside the estimated top-TOPK of
65 * the exactly-chosen parents' children; widening 8/16 -> 32/64 measurably
66 * recovers assignment recall at acceptable build cost.
67 */
68 #define PRISM_SECONDARY_TOPK 32
69 #define PRISM_SECONDARY_BEAM_WIDTH 64
70
71 /*
72 * Build-time centroid routing accuracy.
73 *
74 * The build assigns every vector exactly once, so it routes the centroid
75 * descent for accuracy, not query speed. It must NOT inherit the
76 * query-tuned prism.centroid_beam_scale, which trades recall for QPS: a
77 * small beam_scale makes the beam narrower than the PRISM_SECONDARY_TOPK
78 * candidates the secondary (boundary/SOAR) search requests, loosening
79 * clustering and permanently lowering query recall.
80 *
81 * BEAM_SCALE = 1.0 makes beam_w = nprobe = PRISM_SECONDARY_TOPK, i.e. the
82 * descent keeps as many candidates as the secondary search returns. This
83 * matches the build query-state buffers (beam_results / centroid_scratch
84 * are sized for max_nprobe = PRISM_SECONDARY_TOPK). The query-tuned default
85 * (0.25) instead yields beam_w = 2, far narrower than the k candidates the
86 * descent must produce.
87 *
88 * 1.0 needs no slack above that: the build descent scores the INTERNAL
89 * tree levels against the exact float centroids collected while the tree
90 * streamed to pages (PrismExactInternalCentroids), so the kept parents are the
91 * true top-beam_w — there is no estimate noise at those levels for a wider
92 * beam to paper over. (Widening was only ever a half-measure for that
93 * noise: beam scale 4 recovered about half the misassignment loss at 4x
94 * the descent cost; exact internal scoring removes the cause.) The leaf
95 * level keeps the 1-bit estimates — it is far too large to collect — and
96 * its noise is absorbed by the exact re-rank of the TOPK finalists above.
97 *
98 * ERROR_SCALE = 0 matches the query default; with exact internal scoring
99 * the bounds are exact (error = 0) and pruning slack is meaningless. It
100 * must stay 0 here — a positive error_scale in the single-candidate refine
101 * route (nprobe = 1) overflows the beam-search candidate buffer and
102 * corrupts the build.
103 */
104 #define PRISM_BUILD_CENTROID_BEAM_SCALE 1.0f
105 #define PRISM_BUILD_CENTROID_ERROR_SCALE 0.0f
106
107 typedef struct PrismBuildWorkerBufs
108 {
109 float *norm_buf; /* [dim] for cosine normalization */
110 float *residual_buf; /* [dim] for SOAR residual computation */
111 uint32_t *cand_leaves; /* [PRISM_SECONDARY_TOPK] beam candidates */
112 Distance *cand_dists; /* [PRISM_SECONDARY_TOPK] candidate distances */
113 } PrismBuildWorkerBufs;
114
115 PrismBuildWorkerBufs prism_build_worker_bufs_create(Dimension dim);
116 void prism_build_worker_bufs_free(PrismBuildWorkerBufs *bufs);
117
118 PrismBuildAssignment prism_build_assign_vector(
119 const HKMeansResult *tree,
120 const float *vec,
121 const PrismAssignParams *params,
122 PrismBuildWorkerBufs *bufs);
123
124 /* ----------------------------------------------------------------
125 * Page-backed build routing (unified with the query/insert path)
126 *
127 * Routes each vector to its posting list exactly as a query does --
128 * prism_query_route over the centroid pages -- then exact-re-ranks the TOPK
129 * leaf finalists against their head pages' full-precision pt_centroids
130 * (the primary is the exact-nearest finalist), encodes the RaBitQ
131 * residual against the chosen list's pt_centroid and streams it to the
132 * cluster-keyed sorter (primary + optional SOAR / boundary secondary).
133 * Shared by the serial build and the parallel posting workers. The
134 * descent is the query's; on top of it the build exact-re-ranks the
135 * finalists (queries re-rank their probe set instead, inserts keep the
136 * plain estimate route). The centroid and head pages must already be
137 * written when this runs.
138 * ---------------------------------------------------------------- */
139 typedef struct PrismBuildRouteCtx
140 {
141 PrismQueryState *qs; /* routing state (not owned) */
142 PrismSorter *sorter; /* cluster-keyed output (not owned) */
143 const RaBitQParams *rq_params; /* not owned */
144 VsStorage *storage; /* head-page reads (not owned) */
145 BlockNumber first_posting; /* see prism_leaf_head_blkno */
146 Dimension dim;
147 double soar_lambda;
148 double boundary_epsilon;
149
150 /* Owned scratch (allocated in init, freed in cleanup). */
151 float *cand_pt; /* [PRISM_SECONDARY_TOPK * dim] gathered pt_centroids */
152 uint32_t *cand_leaf; /* [PRISM_SECONDARY_TOPK] leaf per candidate */
153 Distance *cand_dist; /* [PRISM_SECONDARY_TOPK] candidate distances */
154 float *pt_r; /* [dim] rotated residual scratch */
155 RaBitQData *enc_buf; /* RaBitQ encode output */
156 RaBitQScratch enc_scratch;
157 char *entry; /* [prism_posting_entry_size(dim)] */
158
159 /* Counters. */
160 double indtuples;
161 double soar_dupes;
162 } PrismBuildRouteCtx;
163
164 void prism_build_route_ctx_init(
165 PrismBuildRouteCtx *ctx,
166 PrismQueryState *qs,
167 PrismSorter *sorter,
168 const RaBitQParams *rq_params,
169 VsStorage *storage,
170 BlockNumber first_posting,
171 Dimension dim,
172 double soar_lambda,
173 double boundary_epsilon);
174
175 void prism_build_route_ctx_cleanup(PrismBuildRouteCtx *ctx);
176
177 /* Route one vector, encode, and stream its entries to the sorter. Returns
178 * true when a secondary (SOAR / boundary) replica was also emitted. */
179 bool prism_build_route_emit(
180 PrismBuildRouteCtx *ctx, const float *vec, ItemPointerData tid);
181
182 /*
183 * Shared refine kernels: the serial and parallel refine passes route,
184 * filter, and average identically -- only the accumulator ownership
185 * (private vs striped-locked DSM) differs, so that add stays with the
186 * caller.
187 *
188 * prism_refine_route_row routes one row page-backed (k=1, exactly as the
189 * query and insert paths do), maps the head back to its leaf, and returns
190 * the vector to accumulate (the normalized copy in scratch for cosine) --
191 * or NULL when the row routed nowhere or outside [tile_lo, tile_hi).
192 * *out_idx is the tile-relative leaf index.
193 */
194 const float *prism_refine_route_row(
195 struct PrismQueryState *qs,
196 BlockNumber first_posting,
197 const float *vec,
198 Dimension dim,
199 bool cosine,
200 float *scratch,
201 uint32_t tile_lo,
202 uint32_t tile_hi,
203 uint32_t *out_idx);
204
205 /*
206 * Divide one tile's sums by their counts and hand each refined leaf mean to
207 * write_head (leaves with no routed rows keep their sample-trained head).
208 * scratch is a caller-owned [dim] float buffer.
209 */
210 typedef void (*PrismLeafWriteFn)(void *ctx, uint32_t leaf, const float *vec);
211
212 /*
213 * Shared leaf-head writer: writes leaf's posting-list head page (at the
214 * formula-derived block first_posting + leaf * stride) carrying pt_centroid =
215 * P^T * centroid -- the encode reference the scan reads -- and, for a
216 * spilled layout, the reference pages that follow it. Used as the
217 * PrismLeafWriteFn of both the streaming tree write and the refine pass, by
218 * the serial build and the parallel leader alike. pt is caller-owned [dim]
219 * scratch.
220 */
221 typedef struct PrismHeadWriteCtx
222 {
223 VsStorage *storage;
224 const RaBitQParams *rq_params;
225 Dimension dim;
226 bool fastscan;
227 BlockNumber first_posting; /* leaf c's head = first_posting + c *
228 * stride */
229 uint32_t stride; /* prism_posting_reference_pages(dim) */
230 float *pt; /* [dim] scratch */
231 VsMemCtx leaf_ctx; /* one head's builder, reset after it */
232 } PrismHeadWriteCtx;
233
234 /* Stack-init/cleanup pair: allocates/frees the scratch. */
235 static inline void
236 360 prism_head_write_ctx_init(
237 PrismHeadWriteCtx *h,
238 VsStorage *storage,
239 const RaBitQParams *rq_params,
240 Dimension dim,
241 bool fastscan,
242 BlockNumber first_posting)
243 {
244 360 h->storage = storage;
245 360 h->rq_params = rq_params;
246 360 h->dim = dim;
247 360 h->fastscan = fastscan;
248 360 h->first_posting = first_posting;
249 360 h->stride = prism_posting_reference_pages(dim);
250 360 h->pt = vs_alloc((size_t)dim * sizeof(float));
251 360 h->leaf_ctx = vs_memctx_create(vs_memctx_current(), "prism leaf head");
252 360 }
253
254 static inline void
255 360 prism_head_write_ctx_cleanup(PrismHeadWriteCtx *h)
256 {
257 360 vs_memctx_delete(h->leaf_ctx);
258 360 vs_free(h->pt);
259 360 }
260
261 void prism_write_leaf_head(void *arg, uint32_t leaf, const float *centroid);
262
263 /*
264 * Build-time page-backed router base: the same PrismIndexBase the query and
265 * insert paths build, so the build scan routes each row identically. Both
266 * back-ends must construct it the same way -- this is the one place. The
267 * caller owns pt_global_mean ([dim], filled with the rotated global mean)
268 * and frees it after prism_query_state_cleanup.
269 */
270 static inline void
271 434 prism_build_router_base_init(
272 PrismIndexBase *base,
273 RaBitQParams *params,
274 VsStorage *storage,
275 Dimension dim,
276 uint8_t nlevels,
277 BlockNumber first_centroid,
278 DistanceMetric metric,
279 PrismCentroidFormat centroid_format,
280 int fastscan_bits,
281 double error_scale,
282 double beam_scale,
283 uint32_t fan_out,
284 uint32_t nlist,
285 uint64_t rabitq_seed,
286 const float *global_mean,
287 float *pt_global_mean)
288 {
289 434 memset(base, 0, sizeof(*base));
290 434 base->params = params;
291 434 base->pt_global_mean = pt_global_mean;
292 434 vs_rabitq_rotate(params, global_mean, base->pt_global_mean);
293 434 base->rabitq_seed = rabitq_seed;
294 434 base->centroid_storage = storage;
295 434 base->posting_storage = storage;
296 434 base->page_base = NULL;
297 434 base->dim = dim;
298 434 base->nlevels = nlevels;
299 434 base->first_centroid = first_centroid;
300 434 base->metric = metric;
301 434 base->centroid_format = centroid_format;
302 726 base->fastscan = (centroid_format == PRISM_CENTROID_FMT_FASTSCAN)
303 ? fastscan_bits
304
2/2
✓ Branch 0 taken 108 times.
✓ Branch 1 taken 326 times.
434 : 0;
305 434 base->centroid_error_scale = error_scale;
306 434 base->centroid_beam_scale = beam_scale;
307
1/2
✓ Branch 0 taken 142 times.
✗ Branch 1 not taken.
434 base->fan_out = (uint8_t)(fan_out <= UINT8_MAX ? fan_out : UINT8_MAX);
308 434 base->nlist = nlist;
309 434 }
310
311 void prism_refine_write_means(
312 const double *sums,
313 const uint64_t *counts,
314 uint32_t lo,
315 uint32_t hi,
316 Dimension dim,
317 float *scratch,
318 PrismLeafWriteFn write_head,
319 void *write_head_ctx);
320
321 /* ----------------------------------------------------------------
322 * Page format ops — the only part that differs between formats
323 *
324 * write_entry: add one encoded entry to the in-memory page.
325 * Returns false if the page is full and needs flushing first.
326 * reinit_page: re-initialize the page buffer after a flush.
327 * finalize: called before the last flush (e.g., write partial
328 * fastscan group).
329 * cleanup: free format-specific scratch buffers.
330 * ---------------------------------------------------------------- */
331
332 struct PrismPostingBuilder;
333
334 typedef struct PrismPostingPageOps
335 {
336 bool (*write_entry)(
337 struct PrismPostingBuilder *b,
338 ItemPointerData tid,
339 float f_add,
340 float f_rescale,
341 float f_error,
342 const uint8_t *bits);
343 void (*reinit_page)(struct PrismPostingBuilder *b);
344 void (*finalize)(struct PrismPostingBuilder *b);
345 void (*cleanup)(struct PrismPostingBuilder *b);
346 } PrismPostingPageOps;
347
348 /* Fastscan group staging buffer */
349 typedef struct FsGroupStage
350 {
351 ItemPointerData tids[VS_FASTSCAN_GROUP];
352 float f_add[VS_FASTSCAN_GROUP];
353 float f_rescale[VS_FASTSCAN_GROUP];
354 float f_error[VS_FASTSCAN_GROUP];
355 uint32_t count;
356 } FsGroupStage;
357
358 /* ----------------------------------------------------------------
359 * Unified builder state
360 * ---------------------------------------------------------------- */
361
362 typedef struct PrismPostingBuilder
363 {
364 /* Common fields */
365 VsStorage *storage;
366 const RaBitQParams *params;
367 Dimension dim;
368 uint32_t cluster_id;
369 const float *centroid;
370
371 BlockNumber head_blkno;
372 BlockNumber prev_blkno;
373 bool is_first;
374
375 /*
376 * Head-metadata bookkeeping. owns_head is set for head builders (those
377 * that produce the START page) and drives whether finish() stamps the
378 * head's live_count / tail_blkno. n_entries counts every entry added
379 * through this builder, so a head builder that holds the whole chain
380 * (serial build, and the parallel leader's head builder when no
381 * continuations were streamed) stamps an exact live_count with no walk.
382 */
383 bool owns_head;
384 uint32_t n_entries;
385
386 char mem_page[BLCKSZ] __attribute__((aligned(8)));
387 bool page_dirty;
388 /* Head page was adopted from storage (see
389 * prism_posting_builder_adopt_head): when nothing is appended, the
390 * on-disk head is already final and is neither rewritten nor
391 * restamped. */
392 bool adopted_head;
393
394 BlockNumber fixed_first_blkno;
395
396 /*
397 * Spilled layout (prism_posting_spilled): the head's START and MIDDLE
398 * pages carry a page each of the encode reference and no entries, and
399 * the END page the rest of it followed by the first entries. ref_copy is
400 * the builder's own copy of the reference, since the caller's buffer is
401 * not required to outlive finish(); NULL for an inline layout.
402 *
403 * end_pending says mem_page is the END page, which is written even when
404 * it holds no entries, at end_blkno when that is set.
405 */
406 bool spilled;
407 uint32_t ref_pages;
408 float *ref_copy;
409 bool end_pending;
410 BlockNumber end_blkno;
411
412 RaBitQData *enc_buf;
413 RaBitQScratch enc_scratch;
414
415 /* Page format dispatch */
416 const PrismPostingPageOps *page_ops;
417
418 /*
419 * Format-specific state (only fastscan uses this). Group metadata goes
420 * straight into mem_page. The page's run of the code stream is staged in
421 * page_codes and copied in after the metadata when the page is flushed
422 * (see the fastscan page format in posting_page.h).
423 *
424 * deferred holds the metadata of groups whose codes ended on the current
425 * page but which did not fit there, ndeferred of them. They open the next
426 * page. deferred_lanes is the vector count of each.
427 */
428 struct
429 {
430 FsGroupStage grp;
431 uint8_t *bits_buf;
432 uint8_t *codes_buf; /* one packed group */
433 uint8_t *page_codes; /* current page's code bytes */
434 uint8_t *deferred;
435 uint32_t deferred_lanes[PRISM_FASTSCAN_MAX_INFLIGHT_GROUPS - 1];
436 uint32_t ndeferred;
437 uint32_t page_ngroups; /* groups with metadata on the page */
438 uint32_t page_code_bytes; /* code bytes staged for the page */
439 } fs;
440 } PrismPostingBuilder;
441
442 /*
443 * Initialize for AoS page format. Encodes vectors with RaBitQ.
444 */
445 void prism_posting_builder_init(
446 PrismPostingBuilder *builder,
447 VsStorage *storage,
448 const RaBitQParams *params,
449 Dimension dim,
450 uint32_t cluster_id,
451 const float *centroid,
452 const float *pt_centroid);
453
454 /*
455 * Initialize for fastscan page format. When params and centroid
456 * are non-NULL, use _add() to encode raw vectors. When both are
457 * NULL, use _add_encoded() for pre-encoded data (AoS conversion).
458 */
459 void prism_posting_builder_init_fastscan(
460 PrismPostingBuilder *builder,
461 VsStorage *storage,
462 const RaBitQParams *params,
463 Dimension dim,
464 uint32_t cluster_id,
465 const float *centroid,
466 const float *pt_centroid);
467
468 /*
469 * Format-dispatching init: fastscan page format when fastscan is true,
470 * AoS otherwise. Same arguments as the two inits above.
471 */
472 void prism_posting_builder_init_fmt(
473 PrismPostingBuilder *builder,
474 VsStorage *storage,
475 const RaBitQParams *params,
476 Dimension dim,
477 uint32_t cluster_id,
478 const float *centroid,
479 const float *pt_centroid,
480 bool fastscan);
481
482 /*
483 * Adopt the pre-written (empty) posting-list head at head_blk and append
484 * into it. The page-backed build writes each head before the posting scan
485 * (the scan routes and encodes against its pt_centroid); adopting appends
486 * to that same page instead of constructing a second head that must agree
487 * with it, and a cluster that receives no entries keeps its on-disk head
488 * untouched. Entries must arrive pre-encoded (prism_posting_entry_add).
489 */
490 void prism_posting_builder_adopt_head(
491 PrismPostingBuilder *builder,
492 VsStorage *storage,
493 const RaBitQParams *params,
494 Dimension dim,
495 uint32_t cluster_id,
496 BlockNumber head_blk,
497 bool fastscan);
498
499 /*
500 * Pin the first page to a specific block number. The first flush
501 * writes to this block; later pages are appended via new_page.
502 */
503 void prism_posting_builder_set_first_blkno(
504 PrismPostingBuilder *builder, BlockNumber blkno);
505
506 /*
507 * Derive RaBitQ error bound from encoding factors.
508 */
509
510 /*
511 * Add a raw vector. Encodes with RaBitQ relative to centroid.
512 */
513 void prism_posting_builder_add(
514 PrismPostingBuilder *builder,
515 ItemPointerData tid,
516 const float *vector);
517
518 /*
519 * Add a raw vector, optionally stamping it unreachable: estimated distance
520 * +inf with zero error, so every scan prunes it before it can enter the top-k
521 * threshold heap. For vectors with no defined distance under the index metric
522 * (a zero-norm vector under cosine) -- see mark_entry_unreachable in
523 * posting_build.c for why a naive encoding is actively harmful. The row stays
524 * indexed; it just can never be a result.
525 */
526 void prism_posting_builder_add_ex(
527 PrismPostingBuilder *builder,
528 ItemPointerData tid,
529 const float *vector,
530 bool unreachable);
531
532 /*
533 * Add a pre-encoded entry. No RaBitQ encoding — data is already
534 * quantized. Works with both AoS and fastscan formats.
535 */
536 void prism_posting_builder_add_encoded(
537 PrismPostingBuilder *builder,
538 ItemPointerData tid,
539 float f_add,
540 float f_rescale,
541 float f_error,
542 const uint8_t *bits);
543
544 BlockNumber prism_posting_builder_finish(PrismPostingBuilder *builder);
545
546 void prism_posting_builder_cleanup(PrismPostingBuilder *builder);
547
548 /* ----------------------------------------------------------------
549 * Compact posting entry for the cluster-sorted build path.
550 *
551 * A fixed-size blob keyed (externally) by cluster id, carrying the RaBitQ code
552 * so the sort moves ~108 bytes/vector instead of dim*4. Layout:
553 * [ItemPointerData tid][float f_add][float f_rescale][float f_error]
554 * [uint8 sign_bits[(dim+7)/8]]
555 * prism_posting_entry_encode() fills it (relative to the assigned cluster
556 * centroid); prism_posting_entry_add() replays it into a builder via
557 * add_encoded. Used by both the serial (build.c) and parallel
558 * (sort-seam) builds, so the format has a single definition.
559 * ---------------------------------------------------------------- */
560 Size prism_posting_entry_size(Dimension dim);
561
562 void prism_posting_entry_encode(
563 const RaBitQParams *params,
564 const float *vec,
565 const float *centroid,
566 Dimension dim,
567 RaBitQData *enc_buf, /* scratch, VS_RABITQ_DATA_SIZE(dim) */
568 RaBitQScratch *scratch, /* scratch, scratch_init(dim) */
569 ItemPointerData tid,
570 void *out_entry); /* prism_posting_entry_size(dim) bytes */
571
572 /*
573 * Page-backed twin of prism_posting_entry_encode: encodes from a pre-computed
574 * rotated residual (pt_query - pt_centroid) instead of a float vector +
575 * centroid. Used by the page-backed build, where pt_centroid is read from the
576 * posting head page (no in-RAM float centroids).
577 */
578 void prism_posting_entry_encode_from_pt(
579 const RaBitQParams *params,
580 const float *pt_residual,
581 Dimension dim,
582 RaBitQData *enc_buf,
583 RaBitQScratch *scratch,
584 ItemPointerData tid,
585 void *out_entry);
586
587 void prism_posting_entry_add(
588 PrismPostingBuilder *builder, const void *entry, Dimension dim);
589
590 /* ----------------------------------------------------------------
591 * Flat builder — one buffer per cluster (standalone benchmark)
592 * ---------------------------------------------------------------- */
593
594 typedef struct PrismFlatPostingBuilder
595 {
596 const RaBitQParams *params;
597 Dimension dim;
598 uint32_t cluster_id;
599 const float *centroid;
600
601 char *buf;
602 uint32_t max_entries;
603
604 RaBitQData *enc_buf;
605 } PrismFlatPostingBuilder;
606
607 void prism_flat_posting_builder_init(
608 PrismFlatPostingBuilder *builder,
609 const RaBitQParams *params,
610 Dimension dim,
611 uint32_t cluster_id,
612 const float *centroid,
613 uint32_t count);
614
615 void prism_flat_posting_builder_add(
616 PrismFlatPostingBuilder *builder,
617 ItemPointerData tid,
618 const float *vector);
619
620 char *prism_flat_posting_builder_finish(PrismFlatPostingBuilder *builder);
621
622 void prism_flat_posting_builder_cleanup(PrismFlatPostingBuilder *builder);
623
624 #endif /* PRISM_POSTING_BUILD_H */
625