Best Use & Engineering Application Guide

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.

Hardware _rdtsc: 270845/512 cycles/op
Latency: 4386153/4096 ns/op
Throughput: 4096000/4386153 ops/us
Compiled ELF64 .text: 157 B (35 x86_64 insns)
C64 64KB RAM Budget: 507/65536 (507 B source)
Ternary Vote: + (score 1) | Salience: 1683785/19344
Pure-Rust Capsule Source Code (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

Head-to-Head Functional Equivalence Class Peers (1 Implementation(s) Matching 64 Test Vectors)

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#2047ayeos_blu_g75_sensor_pack (THIS CAPSULE)
domain: ayeos | id: 849f5f572e5c334aafe7b65e499acac1
270845/512 cyc/op4386153/4096 ns/op4096000/4386153 ops/us157 B .text (35 insns)+ (1)aye-blu-g75-mt6768 @ 432Hz