Best Use & Engineering Application Guide

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: Specialized Multi-Pin Stage `(u8)->i64` — wire matching input pins via `snap_dag` or `snap_pipeline`.

Hardware _rdtsc: 1/1 cycles/op
Latency: 5973/1600 ns/op
Throughput: 1600000/5973 ops/us
Compiled ELF64 .text: 29 B (9 x86_64 insns)
C64 64KB RAM Budget: 183/65536 (183 B source)
Ternary Vote: + (score 1) | Salience: 8545/104
Pure-Rust Capsule Source Code (183 B)
pub fn ospop_a6p_delta(level: u8) -> i64 {
    // A6P detail level 0..14 -> 16384 down to 1; anything else clamps to 1.
    if level >= 14 { 1 } else { 1i64 << (14 - level as u32) }
}
rustc -C opt-level=3 x86_64 Disassembly (29 B .text / 9 insns)
ospop_a6p_delta:
    mov    ecx, edi
    sub    cl, 14
    neg    cl
    mov    edx, 1
    mov    eax, 1
    shl    rax, cl
    cmp    dil, 14
    cmovae    rax, rdx
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#588ospop_a6p_delta (THIS CAPSULE)
domain: ternary | id: 415d71225ca4aa9dd6dd7e3cbc8f8720
1/1 cyc/op5973/1600 ns/op1600000/5973 ops/us29 B .text (9 insns)+ (1)aye::Hue+Gemini(0+1)::aarch64 @ 432Hz