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: Sole canonical implementation for its 64-vector functional equivalence class. Multi-step compute kernel (270845/512 cyc/op); best used at frame, block, or batch aggregation boundaries.
Snap-Circuit Wiring Role: 2-to-1 Binary Combiner / Join Stage `(u64,u64)->u64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion.
.text: 157 B (35 x86_64 insns)507 B)pub fn ayeos_blu_g75_sensor_pack(touch_xy: u64, bat_mv: u64) -> u64 {
let x = if (touch_xy & 0xFFFF) > 719 { 719 } else { touch_xy & 0xFFFF };
let y = if ((touch_xy >> 16) & 0xFFFF) > 1639 { 1639 } else { (touch_xy >> 16) & 0xFFFF };
let mv = if bat_mv < 2800 { 2800 } else if bat_mv > 4450 { 4450 } else { bat_mv };
let clamped_mv = if mv < 3300 { 3300 } else if mv > 4200 { 4200 } else { mv };
let pct = ((clamped_mv - 3300) * 100) / 900;
(pct << 48) | (mv << 32) | (y << 16) | x
}
rustc -C opt-level=3 x86_64 Disassembly (157 B .text / 35 insns)ayeos_blu_g75_sensor_pack:
cmp rsi, 2801
mov eax, 2800
cmovae rax, rsi
cmp rax, 4450
mov ecx, 4450
cmovb rcx, rax
cmp rsi, 3300
jae .LBB7_2
xor edx, edx
jmp .LBB7_5
.LBB7_2:
cmp rsi, 4200
jbe .LBB7_4
movabs rdx, 28147497671065600
jmp .LBB7_5
.LBB7_4:
imul eax, ecx, 100
add eax, -330000
movabs rsi, 312749974144
imul rsi, rax
movabs rdx, -281474976710656
and rdx, rsi
.LBB7_5:
mov esi, edi
shr esi, 16
cmp rsi, 1639
mov eax, 1639
cmovb rax, rsi
movzx esi, di
cmp rsi, 719
mov edi, 719
cmovb rdi, rsi
shl rcx, 32
shl eax, 16
or rax, rdx
or rax, rdi
or rax, rcx
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #2047 | ayeos_blu_g75_sensor_pack (THIS CAPSULE) domain: ayeos | id: 849f5f572e5c334aafe7b65e499acac1 | 270845/512 cyc/op | 4386153/4096 ns/op | 4096000/4386153 ops/us | 157 B .text (35 insns) | + (1) | aye-blu-g75-mt6768 @ 432Hz |