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: Verified baseline member of a 2-capsule Equivalence Class; useful as a reference or cross-validation peer. Sub-10-cycle hardware kernel (13789/1600 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u64,u64)->i8` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 80 B (27 x86_64 insns)277 B)pub const fn bonobo_resonance_trit(raw_bytes: u64, compressed_bytes: u64) -> i8 {
if compressed_bytes > 0 && raw_bytes.saturating_mul(2) >= compressed_bytes.saturating_mul(3) {
1
} else if raw_bytes > compressed_bytes {
0
} else {
-1
}
}
rustc -C opt-level=3 x86_64 Disassembly (80 B .text / 27 insns)bonobo_resonance_trit:
test rsi, rsi
je .LBB7_1
test rdi, rdi
js .LBB7_4
lea r8, [rdi + rdi]
mov ecx, 3
mov rax, rsi
mul rcx
jo .LBB7_7
.LBB7_6:
mov rcx, rax
mov al, 1
cmp r8, rcx
jae .LBB7_9
.LBB7_1:
xor eax, eax
cmp rsi, rdi
adc al, -1
ret
.LBB7_4:
mov r8, -1
mov ecx, 3
mov rax, rsi
mul rcx
jno .LBB7_6
.LBB7_7:
mov rcx, -1
mov al, 1
cmp r8, rcx
jb .LBB7_1
.LBB7_9:
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #820 | evaluate_bonobo_resonance domain: kompress-super-ultra-x86_64 | id: 5da6a52678463aecfa0bc0cce713735b | 1802901/200000 cyc/op | 858819/200000 ns/op | 200000000/858819 ops/us | 80 B .text (27 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |
| #883 | bonobo_resonance_trit (THIS CAPSULE) domain: smart-tree | id: 70e761311bdcc2f8aba122c9f0c197fc | 13789/1600 cyc/op | 205233/50000 ns/op | 50000000/205233 ops/us | 80 B .text (27 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |