.TH "ttypt/cormr.h" 3 "corm" \" -*- nroff -*- .ad l .nh .SH NAME ttypt/cormr.h \- Corm Recall Kernel: uniform candidate sets + a generic ranking loop\&. .SH SYNOPSIS .br .PP \fR#include \fP .br \fR#include \fP .br \fR#include \fP .br .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBcormr_axis\fP" .br .ti -1c .RI "struct \fBcormr_axis_score\fP" .br .ti -1c .RI "struct \fBcormr_query_axis\fP" .br .ti -1c .RI "struct \fBcormr_query\fP" .br .ti -1c .RI "struct \fBcormr_axis_cli_option\fP" .br .in -1c .SS "Macros" .in +1c .ti -1c .RI "#define \fBCORMR_QUERY_MAX_AXES\fP 8" .br .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef int(* \fBcormr_score_fn\fP) (void *ud, cormr_ref_t r, float *score)" .br .ti -1c .RI "typedef int(* \fBcormr_fill_fn\fP) (void *ctx, void *params, cormr_set_t *out)" .br .ti -1c .RI "typedef int(* \fBcormr_rank_fn\fP) (void *ctx, void *params, cormr_ref_t ref, float *score)" .br .ti -1c .RI "typedef struct \fBcormr_axis\fP \fBcormr_axis_t\fP" .br .ti -1c .RI "typedef struct \fBcormr_axis_score\fP \fBcormr_axis_score_t\fP" .br .ti -1c .RI "typedef int(* \fBcormr_consumer_score_fn\fP) (void *ud, cormr_ref_t ref, const \fBcormr_axis_score_t\fP *as, int n_as, float *out_score)" .br .ti -1c .RI "typedef struct \fBcormr_query_axis\fP \fBcormr_query_axis_t\fP" .br .ti -1c .RI "typedef struct \fBcormr_query\fP \fBcormr_query_t\fP" .br .in -1c .SS "Enumerations" .in +1c .ti -1c .RI "enum \fBcormr_set_exactness\fP { \fBCORMR_SET_EXACT\fP = 0, \fBCORMR_SET_APPROX\fP = 1 }" .br .ti -1c .RI "enum \fBcormr_join_t\fP { \fBCORMR_JOIN_AND\fP = 0, \fBCORMR_JOIN_OR\fP = 1, \fBCORMR_JOIN_NOT\fP = 2 }" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "cormr_set_t * \fBcormr_set_new\fP (void)" .br .ti -1c .RI "void \fBcormr_set_push\fP (cormr_set_t *s, cormr_ref_t r)" .br .ti -1c .RI "void \fBcormr_set_seal\fP (cormr_set_t *s)" .br .ti -1c .RI "int \fBcormr_set_drain\fP (cormr_set_t *s, uint32_t hd)" .br .ti -1c .RI "int \fBcormr_set_intersect\fP (cormr_set_t *dst, const cormr_set_t *a, const cormr_set_t *b)" .br .ti -1c .RI "int \fBcormr_set_subtract\fP (cormr_set_t *dst, const cormr_set_t *a, const cormr_set_t *b)" .br .ti -1c .RI "int \fBcormr_set_union\fP (cormr_set_t *dst, const cormr_set_t *a, const cormr_set_t *b)" .br .ti -1c .RI "size_t \fBcormr_set_count\fP (const cormr_set_t *s)" .br .ti -1c .RI "const cormr_ref_t * \fBcormr_set_at\fP (const cormr_set_t *s)" .br .ti -1c .RI "void \fBcormr_set_free\fP (cormr_set_t *s)" .br .ti -1c .RI "int \fBcormr_set_approx\fP (cormr_set_t *s, int approx, float recall_bound)" .br .ti -1c .RI "int \fBcormr_set_is_approx\fP (const cormr_set_t *s)" .br .ti -1c .RI "float \fBcormr_set_bound\fP (const cormr_set_t *s)" .br .ti -1c .RI "cormr_rank_t * \fBcormr_rank_new\fP (size_t top_k, float min_score)" .br .ti -1c .RI "void \fBcormr_rank_push\fP (cormr_rank_t *rk, cormr_ref_t r, float score)" .br .ti -1c .RI "size_t \fBcormr_rank_sorted\fP (const cormr_rank_t *rk, cormr_ref_t *refs, float *scores)" .br .ti -1c .RI "void \fBcormr_rank_free\fP (cormr_rank_t *rk)" .br .ti -1c .RI "int \fBcormr_axis_register\fP (const \fBcormr_axis_t\fP *axis)" .br .ti -1c .RI "const \fBcormr_axis_t\fP * \fBcormr_axis_get\fP (int slot)" .br .ti -1c .RI "void * \fBcormr_axis_decode\fP (int slot, const char *s)" .br .ti -1c .RI "int \fBcormr_axis_set_ctx\fP (int slot, void *ctx)" .br .ti -1c .RI "int \fBcormr_axis_count\fP (void)" .br .ti -1c .RI "int \fBcormr_query_run\fP (const \fBcormr_query_t\fP *q, cormr_ref_t *refs, float *scores)" .br .ti -1c .RI "int \fBcormr_spec_scan\fP (const char **cur, const char **key, size_t *klen, const char **val, size_t *vlen, int *quoted)" .br .ti -1c .RI "int \fBcormr_cli_str_set\fP (char **dst, const char *value)" .br .ti -1c .RI "int \fBcormr_cli_int\fP (const char *v, int *out)" .br .ti -1c .RI "int \fBcormr_cli_int_b\fP (const char *v, const char *v_end, int *out)" .br .ti -1c .RI "int \fBcormr_cli_str_dup\fP (const char *v, size_t n, int quoted, char **out)" .br .in -1c .SH "Detailed Description" .PP Corm Recall Kernel: uniform candidate sets + a generic ranking loop\&. Pure C, no domain math\&. Candidate sets are sorted, deduplicated lists of 32-bit refs (merge-join, no hashing)\&. A ref IS a corm record reference (e\&.g\&. the id returned by \fBcorm_put()\fP under CM_AINDEX) — the same primary-key space every corm-backed store shares, never an axis's own internal key\&. An axis may index by whatever it needs internally (e\&.g\&. libislet's 64-bit morton keys); those internal keys are not refs and never leave the axis\&. The ranking loop is a bounded, streaming min-heap: an axis streams refs + scores straight into cormr_rank_push; a set is materialized only when a second axis needs to join\&. Weighted composition across axes lives in the consumer's score function\&. .PP Kernel is optional and additive: raw corm / domain entry points in the axis libraries are untouched\&. Ref mapping is the consumer's job — the kernel never interprets a ref\&. .PP Adapter contract: an axis exposes ONE filler int cormr_axis_fill_*(, cormr_set_t *out); that streams the refs matching its filter into the set and seals it (0 ok / -1 error)\&. Fill-only queries stay streaming (the axis pushes straight into cormr_rank_push); a set is materialized only when a second axis or ranker joins\&. Approximate fills (e\&.g\&. ANN neighbors) must declare themselves, since intersecting with an approximate set bounds final recall by it\&. Full design: docs/RECALL-KERNEL\&.md\&. .PP \fBSee also\fP .RS 4 \fBcorm\&.h\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for corm from the source code\&.