Engineering Category: Lossless Wire & Structural Compression
Best Use in Production: Zero-allocation integer bit-packing, variable-length encoding, and stream framing for sovereign wire protocols.
When to Select This Capsule: Sole canonical implementation for its 64-vector functional equivalence class. Sub-10-cycle hardware kernel (403129/100000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u8,u8)->u8` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 15 B (6 x86_64 insns)86 B)pub fn avg2(a: u8, b: u8) -> u8 {
((u16::from(a) + u16::from(b) + 1) >> 1) as u8
}
rustc -C opt-level=3 x86_64 Disassembly (15 B .text / 6 insns)avg2:
movzx eax, sil
movzx ecx, dil
add eax, ecx
inc eax
shr eax
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #48 | avg2 (THIS CAPSULE) domain: smart-tree | id: 044a535449e0cf6f8429be5d1ce2ca94 | 403129/100000 cyc/op | 384093/200000 ns/op | 200000000/384093 ops/us | 15 B .text (6 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |