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 (131769/20000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u8,u8,u8,u8)->u32` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 27 B (10 x86_64 insns)92 B)pub fn pack_bgra(b: u8, g: u8, r: u8, a: u8) -> u32 {
u32::from_le_bytes([b, g, r, a])
}
rustc -C opt-level=3 x86_64 Disassembly (27 B .text / 10 insns)pack_bgra:
shl ecx, 24
movzx eax, dl
shl eax, 16
or eax, ecx
movzx ecx, sil
shl ecx, 8
or ecx, eax
movzx eax, dil
or eax, ecx
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #533 | pack_bgra (THIS CAPSULE) domain: smart-tree | id: d2490c9f44b6810ec2971112d026b04d | 131769/20000 cyc/op | 1255587/400000 ns/op | 400000000/1255587 ops/us | 27 B .text (10 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |