Engineering Category: Zero-Copy Scanning, Parsing & Codec Primitives
Best Use in Production: High-throughput byte-slice scanning, delimiter discovery, and wire-safe ASCII/hex transcoding inside bounded 64KB memory pages.
When to Select This Capsule: Sole canonical implementation for its 64-vector functional equivalence class. Sub-10-cycle hardware kernel (58083/20000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u64)->usize` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 33 B (11 x86_64 insns)177 B)pub fn calculate_auto_hex_len(num_packed_objects: u64) -> usize {
let mut len = 64 - num_packed_objects.leading_zeros();
len = len.div_ceil(2);
len.max(7) as usize
}
rustc -C opt-level=3 x86_64 Disassembly (33 B .text / 11 insns)calculate_auto_hex_len:
mov ecx, 127
bsr rcx, rdi
xor ecx, -64
add ecx, 65
mov eax, ecx
shr eax
sub ecx, eax
cmp ecx, 8
mov eax, 7
cmovae eax, ecx
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #24 | calculate_auto_hex_len (THIS CAPSULE) domain: g8t-x86_64 | id: b93cfea1144e17dc06a861d155046554 | 58083/20000 cyc/op | 276647/200000 ns/op | 200000000/276647 ops/us | 33 B .text (11 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |