Engineering Category: Hybrid Retrieval, Ranking & Entropy
Best Use in Production: Branchless integer similarity scoring, edit-distance evaluation, and candidate ranking for high-throughput retrieval pipelines.
When to Select This Capsule: Verified baseline member of a 2-capsule Equivalence Class; useful as a reference or cross-validation peer. Low-latency L1-resident kernel (4684317/400000 cyc/op); well-suited for high-frequency pipeline stages.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u64,u64,u64)->u64` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 121 B (35 x86_64 insns)474 B)pub fn searchix_bm25_option_rank_q15(term_freq: u64, doc_len: u64, exact_prefix_match: u64) -> u64 {
if term_freq == 0 {
return 0;
}
let norm_len = if doc_len < 8 { 8 } else { doc_len };
let tf_q15 = (term_freq.saturating_mul(32768)) / (term_freq.saturating_add(norm_len / 4));
let prefix_bonus = if exact_prefix_match != 0 { 16384 } else { 0 };
let score = tf_q15.saturating_add(prefix_bonus);
if score > 65535 { 65535 } else { score }
}
rustc -C opt-level=3 x86_64 Disassembly (121 B .text / 35 insns)searchix_bm25_option_rank_q15:
test rdi, rdi
je .LBB7_3
mov rcx, rdx
cmp rsi, 9
mov edx, 8
cmovae rdx, rsi
mov rax, rdi
shr rax, 49
jne .LBB7_4
mov rax, rdi
shl rax, 15
.LBB7_5:
shr rdx, 2
add rdi, rdx
mov rsi, -1
cmovae rsi, rdi
mov rdx, rax
or rdx, rsi
shr rdx, 32
je .LBB7_6
xor edx, edx
div rsi
jmp .LBB7_8
.LBB7_3:
xor eax, eax
ret
.LBB7_6:
xor edx, edx
div esi
.LBB7_8:
lea rdx, [rax + 16384]
test rcx, rcx
cmove rdx, rax
cmp rdx, 65535
mov eax, 65535
cmovb rax, rdx
ret
.LBB7_4:
mov rax, -1
jmp .LBB7_5
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #77 | st_golf_searchix_bm25_option_rank_q15_u64 domain: searchix-bm25 | id: 9446db816a447a32f26b8608fb2f8d42 | 961493/100000 cyc/op | 260847/100000 ns/op | 100000000/260847 ops/us | 121 B .text (35 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |
| #1530 | searchix_bm25_option_rank_q15 (THIS CAPSULE) domain: routing | id: e7922cf22041b9ed414fcb5a33d8df90 | 4684317/400000 cyc/op | 1514363/400000 ns/op | 400000000/1514363 ops/us | 121 B .text (35 insns) | 0 (0) | aye-aurora-8b-voice @ 432Hz |