MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / blend_worker

Function blend_worker

src/semantic/semantic.c:1055–1077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1053} blend_ctx_t;
1054
1055static void blend_worker(int worker_id, void *ctx_ptr) {
1056 (void)worker_id;
1057 blend_ctx_t *bc = ctx_ptr;
1058 while (true) {
1059 int start = atomic_fetch_add_explicit(&bc->next_idx, CBM_SEM_WORKER_STACK_CAP,
1060 memory_order_relaxed);
1061 if (start >= bc->entry_count) {
1062 break;
1063 }
1064 int end = start + CBM_SEM_WORKER_STACK_CAP;
1065 if (end > bc->entry_count) {
1066 end = bc->entry_count;
1067 }
1068 for (int i = start; i < end; i++) {
1069 cbm_sem_normalize(&bc->entries[i].enriched_vec);
1070 for (int d = 0; d < CBM_SEM_DIM; d++) {
1071 bc->entries[i].enriched_vec.v[d] =
1072 (CBM_SEM_RRI_BETA * bc->pass1[i].v[d]) +
1073 (CBM_SEM_RRI_ALPHA * bc->entries[i].enriched_vec.v[d]);
1074 }
1075 }
1076 }
1077}
1078
1079typedef struct {
1080 corpus_entry_t *entries;

Callers

nothing calls this directly

Calls 1

cbm_sem_normalizeFunction · 0.85

Tested by

no test coverage detected