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. Multi-step compute kernel (69521/128 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.
.text: 176 B (41 x86_64 insns)658 B)pub fn ayeos_gc7272_touch_to_semitone_v1(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 / 2) + 1;
let mut harmonic_acc: u64 = 0;
let mut h: u64 = 1;
while h <= 16 {
harmonic_acc = harmonic_acc.wrapping_add((semi + 1) * h * 432);
h += 1;
}
(mv_clamped << 48) | ((sgen_div & 0x1F) << 40) | ((semi & 0x1F) << 32) | ((y & 0xFFFF) << 16) | (harmonic_acc & 0xFFFF)
}
rustc -C opt-level=3 x86_64 Disassembly (176 B .text / 41 insns)ayeos_gc7272_touch_to_semitone_v1:
movzx eax, di
imul eax, eax, 11651
shr eax, 23
imul eax, eax, 720
mov ecx, edi
sub ecx, eax
movzx edx, cx
imul eax, edx, 2185
shr eax, 16
imul ecx, eax, 58752
add ecx, 58752
mov rsi, rdi
shr rsi, 32
movzx esi, si
cmp rsi, 4450
mov r8d, 4450
cmovb r8, rsi
shl r8, 48
cmp rsi, 2800
movabs rsi, 788129934789836800
cmovae rsi, r8
imul edx, edx, 1093
shr edx, 16
mov r8d, edi
shr r8d, 16
shr edi, 19
imul edi, edi, 10231
shr edi, 21
imul edi, edi, 1640
sub r8d, edi
shl rdx, 40
or rdx, rsi
shl rax, 32
or rax, rdx
shl r8d, 16
or r8, rax
movzx ecx, cx
or rcx, r8
movabs rax, 1099511627776
add rax, rcx
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #2045 | ayeos_gc7272_touch_to_semitone_v2 domain: ayeos | id: 7015de9c44b0b812cd8602b8c1dd298e | 270845/512 cyc/op | 4386153/4096 ns/op | 4096000/4386153 ops/us | 165 B .text (41 insns) | + (1) | aye-blu-g75-mt6768 @ 432Hz |
| #2048 | ayeos_gc7272_touch_to_semitone_v1 (THIS CAPSULE) domain: ayeos | id: 51c041ae11785af7f685123f920a5c2b | 69521/128 cyc/op | 562923/512 ns/op | 512000/562923 ops/us | 176 B .text (41 insns) | 0 (0) | aye-blu-g75-mt6768 @ 432Hz |