Engineering Category: Balanced Ternary & b158 Quantization
Best Use in Production: Packing and unpacking balanced ternary (-1, 0, +1) activation lanes into dense 64-bit registers for C64-constrained inference pipelines.
When to Select This Capsule: Sole canonical implementation for its 64-vector functional equivalence class. Sub-10-cycle hardware kernel (1/1 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: 2-to-1 Binary Combiner / Join Stage `(u64,u64)->i64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion.
.text: 84 B (26 x86_64 insns)282 B)pub fn ayeos_bonobo_resonance_trit(raw_bytes: u64, packed_bytes: u64) -> i64 {
if raw_bytes == 0 || packed_bytes == 0 || raw_bytes == packed_bytes {
0
} else if raw_bytes.saturating_mul(2) >= packed_bytes.saturating_mul(3) {
1
} else {
-1
}
}
rustc -C opt-level=3 x86_64 Disassembly (84 B .text / 26 insns)ayeos_bonobo_resonance_trit:
xor eax, eax
cmp rdi, rsi
je .LBB7_9
test rdi, rdi
je .LBB7_9
test rsi, rsi
je .LBB7_9
test rdi, rdi
js .LBB7_5
add rdi, rdi
mov ecx, 3
mov rax, rsi
mul rcx
jo .LBB7_7
.LBB7_8:
xor ecx, ecx
cmp rdi, rax
setae cl
lea rax, [2*rcx - 1]
.LBB7_9:
ret
.LBB7_5:
mov rdi, -1
mov ecx, 3
mov rax, rsi
mul rcx
jno .LBB7_8
.LBB7_7:
mov rax, -1
jmp .LBB7_8
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #1682 | ayeos_bonobo_resonance_trit (THIS CAPSULE) domain: ayeos-rpi | id: dd3c6603c13c499fa9ae953a547de802 | 1/1 cyc/op | 2742501/400000 ns/op | 400000000/2742501 ops/us | 84 B .text (26 insns) | + (1) | aye::Peter+Omni(0+1)::aarch64 @ 432Hz |