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 (2154407/400000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u64,u64,u64)->u64` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 63 B (19 x86_64 insns)389 B)pub fn outreach_char_budget_trit_gate(char_len: u64, citation_count: u64, slop_hits: u64) -> u64 {
if char_len == 0 || char_len > 300 || citation_count == 0 || slop_hits > 0 {
return 0;
}
let headroom = 300 - char_len;
let capped_citations = if citation_count > 16 { 16 } else { citation_count };
headroom.saturating_add(capped_citations.saturating_mul(1024))
}
rustc -C opt-level=3 x86_64 Disassembly (63 B .text / 19 insns)outreach_char_budget_trit_gate:
lea rax, [rdi - 301]
cmp rax, -300
setb al
test rsi, rsi
sete cl
test rdx, rdx
setne dl
or dl, cl
or dl, al
je .LBB7_2
xor eax, eax
ret
.LBB7_2:
cmp rsi, 16
mov eax, 16
cmovb rax, rsi
shl eax, 10
sub rax, rdi
add rax, 300
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #44 | outreach_char_budget_trit_gate (THIS CAPSULE) domain: routing | id: 0d7a31b62645870092a478e6d7f7b17f | 2154407/400000 cyc/op | 174103/100000 ns/op | 100000000/174103 ops/us | 63 B .text (19 insns) | + (1) | aye-aurora-8b-voice @ 432Hz |