Best Use & Engineering Application Guide

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 (400899/100000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.

Snap-Circuit Wiring Role: 1-to-1 Unary Transform Stage `(i32)->i32` — snaps directly into linear pipelines or fan-out DAG branches.

Hardware _rdtsc: 400899/100000 cycles/op
Latency: 763783/400000 ns/op
Throughput: 400000000/763783 ops/us
Compiled ELF64 .text: 13 B (6 x86_64 insns)
C64 64KB RAM Budget: 137/65536 (137 B source)
Ternary Vote: + (score 1) | Salience: 24985/312
Pure-Rust Capsule Source Code (137 B)
pub fn ec_ilog(value: i32) -> i32 {
    if value <= 0 {
        0
    } else {
        32 - (value as u32).leading_zeros() as i32
    }
}
rustc -C opt-level=3 x86_64 Disassembly (13 B .text / 6 insns)
ec_ilog:
    bsr    ecx, edi
    inc    ecx
    xor    eax, eax
    test    edi, edi
    cmovg    eax, ecx
    ret

Head-to-Head Functional Equivalence Class Peers (1 Implementation(s) Matching 64 Test Vectors)

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#47ec_ilog (THIS CAPSULE)
domain: smart-tree | id: c24cb66f3eb2bc2581897546c3ddb3fb
400899/100000 cyc/op763783/400000 ns/op400000000/763783 ops/us13 B .text (6 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz