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 (221247/40000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(i32)->u32` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 9 B (4 x86_64 insns)70 B)pub fn zigzag_i32(x: i32) -> u32 {
((x << 1) ^ (x >> 31)) as u32
}
rustc -C opt-level=3 x86_64 Disassembly (9 B .text / 4 insns)zigzag_i32:
lea eax, [rdi + rdi]
sar edi, 31
xor eax, edi
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #243 | zigzag_i32 (THIS CAPSULE) domain: smart-tree | id: 8d851c97dde86594f5c26f920bd91f5e | 221247/40000 cyc/op | 526901/200000 ns/op | 200000000/526901 ops/us | 9 B .text (4 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |