| 1144 | } |
| 1145 | |
| 1146 | static void src_build_worker(int worker_id, void *ctx_ptr) { |
| 1147 | (void)worker_id; |
| 1148 | src_build_ctx_t *sc = ctx_ptr; |
| 1149 | while (true) { |
| 1150 | int start = atomic_fetch_add_explicit(&sc->next_idx, CBM_SEM_WORKER_STACK_CAP, |
| 1151 | memory_order_relaxed); |
| 1152 | if (start >= sc->entry_count) { |
| 1153 | break; |
| 1154 | } |
| 1155 | int end = start + CBM_SEM_WORKER_STACK_CAP; |
| 1156 | if (end > sc->entry_count) { |
| 1157 | end = sc->entry_count; |
| 1158 | } |
| 1159 | for (int i = start; i < end; i++) { |
| 1160 | build_src_entry(sc->entries[i].token, &sc->src_entries[i]); |
| 1161 | } |
| 1162 | } |
| 1163 | } |
| 1164 | |
| 1165 | /* Quantize pass1 float vectors to int8 (× 127) for use as pass2 source. |
| 1166 | * Input vectors are unit-normalized, so values are in [-1, 1] → int8 preserves |
nothing calls this directly
no test coverage detected