JustVugg/colibri
A hierarchical inference engine for frontier MoE models: hot experts on the GPU (CUDA, Vulkan), warm ones in RAM, cold ones streamed from NVMe. Written in C, runs on the hardware you already own.
The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
Most complex files
- c/colibri.c6249 cx
- c/qwen36.c4531 cx
- c/backend_vulkan.c3396 cx
- c/qwen38_core.h2649 cx
- c/vk_chain.c2499 cx
- c/tests/test_vk_chain.c2157 cx
- c/kimi_k3.c2012 cx
- c/deepseek_v41.c1997 cx
- c/qwen38.c1960 cx
- c/vk_tier.c1873 cx
Dead code 1.21% unused · 31 findings
- c/tools/rans_format.pyunused-file
- c/tools/efficiency.pyunused-file
- c/tools/qwen36_tensor_kinds.pyunused-file
- c/tools/engine_evidence.pyunused-file
- c/tools/glm_fp8_emit.pyunused-file
- c/tools/make_lora_adapter.pyunused-file
- c/tools/make_train_oracle.pyunused-file
- c/tools/make_olmoe_real_oracle.pyunused-file
- c/tools/gen_unicode.pyunused-file
- c/tools/qwenimage_fit_preview.pyunused-file
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 6 generated files: c/ggml_grids.h, c/gliner_unicode.h, c/qwen38_nfc_tables.h, c/tok_unicode_deepseek.h, c/tok_unicode.h, c/vk_igpu_threshold.h.
Largest clones in the code
- 7 lines in 3 placesc450 tokens
14714/* static, not a stack local: the PILOT prefetch worker is detached and 14715 * loops forever, and it keeps this address in the global pilot_m. A stack 14716 * Model dies when main returns while that thread is still dereferencing 14717 * it -- ASan: stack-use-after-return, READ of size 8, in a worker thread, 14718 * with the run's tokens already correct (#1262). Static storage outlives 14719 * every thread, so the pointer the worker holds stays valid. */ 14720static Model m; double t0=now_s(); model_init(&m,snap,cap,ebits,dbits);3381/* static, not a stack local: the PILOT prefetch worker is detached and 3382 * loops forever, and it keeps this address in the global pilot_m. A stack 3383 * Model dies when main returns while that thread is still dereferencing 3384 * it -- ASan: stack-use-after-return, READ of size 8, in a worker thread, 3385 * with the run's tokens already correct (#1262). Static storage outlives 3386 * every thread, so the pointer the worker holds stays valid. */ 3387 static Model m; model_init(&m, snap, cap, bits); - 34 lines in 2 placesc712 tokens
257static int utf8_decode(const char *s,int i,int n,int *adv){ 258 if(!s||i<0||i>=n){if(adv)*adv=0;return 0xfffd;} 259 unsigned char c=(unsigned char)s[i]; int cp,a; 260 if(c<0x80){cp=c;a=1;} 261 else if((c>>5)==6){cp=c&0x1F;a=2;} 262 else if((c>>4)==14){cp=c&0x0F;a=3;} 263 else if((c>>3)==30){cp=c&0x07;a=4;} 264 else {cp=c;a=1;} 265 for(int k=1;k<a;k++){ 266 if(i+k>=n||((unsigned char)s[i+k]&0xC0)!=0x80){if(adv)*adv=1;return c;}First 10 of 34 lines.
- 18 lines in 2 placesc655 tokens
768 return 0; 769} 770 771/* Decode token ids to text using g_tok, writing to stdout. Handles Qwen's 772 * byte-representation markers (Ġ=space, Ċ=newline, ▁=space) and <0xXX> byte 773 * fallback. Only active when a tokenizer was loaded. */ 774/* ---- streaming / incremental decode support ---- */ 775static int g_stream = 0; /* 1 = emit tokens as they are generated */ 776static unsigned char g_sbuf[16]; /* carries a partial UTF-8 char across tokens */ 777static int g_sbn = 0;First 10 of 18 lines.
7 more
- 21 lines in 2 placesc625 tokens
- 9 lines in 2 placesc-header603 tokens
- 9 lines in 2 placesc602 tokens
- 26 lines in 2 placesc-header579 tokens
- 19 lines in 2 placesc576 tokens
- 10 lines in 2 placesc576 tokens
- 9 lines in 2 placesc574 tokens
Largest clones over all files, tests and data included
- 612 lines in 8 placescdocs and examples9,404 tokensdocs/experiments/qwen36-cuda-chain-coalesce-2026-10-25/bench.c:66–677docs/experiments/qwen36-cuda-host-pool-follow-2026-10-26/bench.c:66–677docs/experiments/qwen36-cuda-lmhead-device-2026-10-27/bench.c:66–677docs/experiments/qwen36-cuda-mtp-pick-2026-10-25/bench.c:66–677docs/experiments/qwen36-cuda-promote-brake-history-2026-10-26/bench.c:66–677and 3 more
66static uint64_t bench_fnv(uint64_t h, const void *data, size_t n) { 67 const unsigned char *p = (const unsigned char *)data; 68 for (size_t i = 0; i < n; i++) h = (h ^ p[i]) * 0x100000001b3ull; 69 return h; 70} 71 72typedef struct { 73 const char *model, *tokenizer, *text, *lengths, *session, *steps, *nll, *words; 74 int gen, photo, teacher, pause, tokens_only; 75} BenchOpts;First 10 of 612 lines.
- 70 lines in 9 placescdocs and examples4,793 tokensdocs/experiments/cuda-attn-one-pass-sm75-2026-10-28/bench.c:1–70docs/experiments/qwen36-cuda-chain-coalesce-2026-10-25/bench.c:1–70docs/experiments/qwen36-cuda-host-pool-follow-2026-10-26/bench.c:1–70docs/experiments/qwen36-cuda-lmhead-device-2026-10-27/bench.c:1–70docs/experiments/qwen36-cuda-mtp-pick-2026-10-25/bench.c:1–70and 4 more
1/* qwen36-bench: how fast the Qwen3.6 engine reads a prompt and generates, measured the way antirez's 2 * ds4-bench does (ds4, MIT). One process, one version of the engine, compiled in and used as is. The 3 * `bench` driver beside this file builds it, runs two versions in alternating order and reads the CSV; 4 * README.md gives the CSV contract every engine's harness follows. 5 * 6 * qwen36-bench --model <dir> --text <file> [--lengths 64,512] [--gen 32] [--photo] [--teacher] 7 * [--steps <file>] [--nll <file>] [--words <file>] [--pause <s>] 8 * qwen36-bench --model <dir> --session <file> [--steps <file>] [--nll <file>] [--pause <s>] 9 * [--tokens-only] 10 *First 10 of 70 lines.
- 11 lines in 118 placestxtdocs and examples240 tokensdocs/experiments/qwen36-cuda-chain-coalesce-2026-10-25/accelerated.txt:30–40docs/experiments/qwen36-cuda-lmhead-device-2026-10-27/l4-accelerated.txt:30–40docs/experiments/qwen36-cuda-lmhead-device-2026-10-27/l4-accelerated.txt:82–92docs/experiments/qwen36-cuda-lmhead-device-2026-10-27/l4-accelerated.txt:134–144docs/experiments/qwen36-cuda-lmhead-device-2026-10-27/l4-accelerated.txt:185–195and 113 more
30===== warmup.err (sha256 dd820ccfaca45ce3f4fd08bae58d0452dc1277720d7737926c5445c844006724) 31[tok] loaded 248044 pieces (max id 248069) from /content/q36mtp/tokenizer.json 32[OMP] qwen36: 6 physical-core threads instead of 12 logical CPUs; SMT can halve decode throughput on some CPUs (#718); set OMP_NUM_THREADS=<n> to override 33== qwen36 Phase-2 engine | cache=256/layer bits=4 ctx=8192 pilot=0 wide=1 hot=0 smooth=0.30 conf=0.92 == 34[tok] loaded 248044 pieces (max id 248069) from /content/q36mtp/tokenizer.json 35[meta] loaded: q_heads=16 kv_heads=2 head_dim=256 q_head_dim=512 k_head_dim=256 v_head_dim=256 o_in=4096 rotary_dim=64 n_experts=256 topk=8 inter=512 shared_in… 36[meta] DeltaNet: vheads=32 kheads=16 kdim=128 vdim=128 convk=4 conv_dim=8192 37[qwen36] embedding: rows read in place from the checkpoint, COLI_EMBED_MMAP=0 builds the f32 table 38[dense-i8] 291 matrices quantized during load, 7.2 GB f32 freed 39[qwen36] group-scaled experts: gs=64First 10 of 11 lines.
- 11 lines in 158 placestxtdocs and examples132 tokensdocs/experiments/qwen36-tier-spread-2026-10-27/qwen38.txt:126–136docs/experiments/qwen36-tier-spread-2026-10-27/qwen38.txt:141–151docs/experiments/qwen36-tier-spread-2026-10-27/qwen38.txt:255–265docs/experiments/qwen36-tier-spread-2026-10-27/qwen38.txt:558–568docs/experiments/qwen36-tier-spread-2026-10-27/qwen38.txt:658–668and 153 more
- 1352 lines in 2 placestxtdocs and examples20,434 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| c | 36 | 91,938 | 492 | 4,257 | 4.63% |
| c-header | 153 | 64,857 | 278 | 2,177 | 3.36% |
| python | 183 | 78,434 | 173 | 1,729 | 2.2% |
| objectivec | 1 | 2,578 | 22 | 167 | 6.48% |
| tsx | 15 | 1,965 | 2 | 17 | 0.87% |
| bash | 13 | 779 | 1 | 9 | 1.16% |
| typescript | 10 | 1,147 | 0 | 0 | 0% |
| cpp | 1 | 249 | 0 | 0 | 0% |
| powershell | 1 | 146 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| txt | 130 | 52,000 | 2,663 | 29,374 | 56.49% |
| c | 356 | 158,326 | 884 | 14,303 | 9.03% |
| python | 485 | 158,244 | 519 | 5,444 | 3.44% |
| c-header | 161 | 87,463 | 286 | 2,236 | 2.56% |
| glsl | 62 | 11,277 | 134 | 1,573 | 13.95% |
| json | 107 | 21,281 | 64 | 1,708 | 8.03% |
| bash | 88 | 11,511 | 44 | 472 | 4.1% |
| objectivec | 3 | 4,033 | 33 | 252 | 6.25% |
| markup | 7 | 3,346 | 33 | 690 | 20.62% |
| yaml | 8 | 3,251 | 21 | 200 | 6.15% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Nov 4, 2026 | #3 | 47,363 (+802) | 1,591 | 555,901 | 4,713 | 10.21% | 3.45% | D 53.2 | 0a5504a |
| Nov 3, 2026 | #5 | 46,716 (+675) | 1,591 | 555,901 | 4,713 | 10.21% | 3.45% | D 53.2 | 0a5504a |
| Sep 18, 2026 | #11 | 35,849 (+873) | 674 | 214,273 | 900 | 5.23% | 6.37% | — | a8f2ca6 |
| Sep 17, 2026 | #3 | 35,169 (+1,546) | 674 | 214,273 | 900 | 5.23% | 6.37% | — | a8f2ca6 |
| Sep 16, 2026 | #2 | 34,107 (+2,026) | 674 | 214,273 | 900 | 5.23% | 6.37% | — | a8f2ca6 |
| Sep 15, 2026 | #1 | 32,433 (+2,173) | 674 | 214,273 | 900 | 5.23% | 6.37% | — | f028d26 |
| Sep 14, 2026 | #1 | 30,246 (+868) | 674 | 214,273 | 900 | 5.23% | 6.37% | — | f028d26 |
| Sep 11, 2026 | #9 | 27,535 (+98) | 626 | 198,119 | 812 | 5.18% | 6.54% | — | fd93c41 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.