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 (502331/100000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(i64,i64,i64)->i64` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 18 B (6 x86_64 insns)167 B)pub const fn clamp_i64(v: i64, min_v: i64, max_v: i64) -> i64 {
if v < min_v {
min_v
} else if v > max_v {
max_v
} else {
v
}
}
rustc -C opt-level=3 x86_64 Disassembly (18 B .text / 6 insns)clamp_i64:
mov rax, rdx
cmp rdi, rdx
cmovl rax, rdi
cmp rdi, rsi
cmovl rax, rsi
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #240 | clamp_i64 (THIS CAPSULE) domain: smart-tree | id: df236abba949ddd4b1863f1415fe682c | 502331/100000 cyc/op | 957213/400000 ns/op | 400000000/957213 ops/us | 18 B .text (6 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |