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: Holds the #1 Equivalence Crown across 2 functionally identical implementations (fastest verified hardware _rdtsc). Multi-step compute kernel (270845/512 cyc/op); best used at frame, block, or batch aggregation boundaries.

Snap-Circuit Wiring Role: 1-to-1 Unary Transform Stage `(u64)->u64` — snaps directly into linear pipelines or fan-out DAG branches.

Hardware _rdtsc: 270845/512 cycles/op
Latency: 4386153/4096 ns/op
Throughput: 4096000/4386153 ops/us
Compiled ELF64 .text: 165 B (41 x86_64 insns)
C64 64KB RAM Budget: 541/65536 (541 B source)
Ternary Vote: + (score 1) | Salience: 43945/481
Pure-Rust Capsule Source Code (541 B)
pub fn ayeos_gc7272_touch_to_semitone_v2(sensor_word: u64) -> u64 {
    let x = (sensor_word & 0xFFFF) % 720;
    let y = ((sensor_word >> 16) & 0xFFFF) % 1640;
    let mv = (sensor_word >> 32) & 0xFFFF;
    let mv_clamped = if mv < 2800 { 2800 } else if mv > 4450 { 4450 } else { mv };
    let semi = ((x * 24) / 720) & 31;
    let sgen_div = (semi >> 1) + 1;
    let harmonic_acc = (semi + 1).wrapping_mul(58752);
    (mv_clamped << 48) | ((sgen_div & 0x1F) << 40) | ((semi & 0x1F) << 32) | ((y & 0xFFFF) << 16) | (harmonic_acc & 0xFFFF)
}
rustc -C opt-level=3 x86_64 Disassembly (165 B .text / 41 insns)
ayeos_gc7272_touch_to_semitone_v2:
    mov    rax, rdi
    shr    rax, 32
    movzx    eax, ax
    cmp    rax, 4450
    mov    edx, 4450
    cmovb    rdx, rax
    shl    rdx, 48
    cmp    rax, 2800
    movabs    rcx, 788129934789836800
    cmovae    rcx, rdx
    mov    eax, edi
    shr    eax, 16
    mov    edx, edi
    shr    edx, 19
    imul    edx, edx, 10231
    shr    edx, 21
    imul    edx, edx, 1640
    sub    eax, edx
    movzx    edx, di
    imul    edx, edx, 11651
    shr    edx, 23
    imul    edx, edx, 720
    sub    edi, edx
    movzx    edx, di
    imul    edx, edx, 2185
    shr    edx, 16
    imul    esi, edx, 58752
    add    esi, 58752
    mov    edi, edx
    and    edi, 62
    shl    rdi, 39
    or    rdi, rcx
    shl    rdx, 32
    or    rdx, rdi
    shl    eax, 16
    or    rax, rdx
    movzx    ecx, si
    or    rcx, rax
    movabs    rax, 1099511627776
    add    rax, rcx
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#2045ayeos_gc7272_touch_to_semitone_v2 (THIS CAPSULE)
domain: ayeos | id: 7015de9c44b0b812cd8602b8c1dd298e
270845/512 cyc/op4386153/4096 ns/op4096000/4386153 ops/us165 B .text (41 insns)+ (1)aye-blu-g75-mt6768 @ 432Hz
#2048ayeos_gc7272_touch_to_semitone_v1
domain: ayeos | id: 51c041ae11785af7f685123f920a5c2b
69521/128 cyc/op562923/512 ns/op512000/562923 ops/us176 B .text (41 insns)0 (0)aye-blu-g75-mt6768 @ 432Hz