Best Use & Engineering Application Guide

Engineering Category: Deterministic Sovereign Compute Kernel

Best Use in Production: Pure-Rust C64-bounded integer transformation kernel verified across 64 canonical test vectors for deterministic Snap-Circuit composition.

When to Select This Capsule: Sole canonical implementation for its 64-vector functional equivalence class. Sub-10-cycle hardware kernel (150837/50000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.

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

Hardware _rdtsc: 150837/50000 cycles/op
Latency: 28741/20000 ns/op
Throughput: 20000000/28741 ops/us
Compiled ELF64 .text: 130 B (34 x86_64 insns)
C64 64KB RAM Budget: 479/65536 (479 B source)
Ternary Vote: + (score 1) | Salience: 156595/1677
Pure-Rust Capsule Source Code (479 B)
#[inline(always)] pub fn hutter_uleb128_encode_u64(val: u64) -> u64 { let v = val & 0x0FFF_FFFFu64; let b0 = (v & 0x7F) | if v >= (1 << 7) { 0x80 } else { 0 }; let b1 = ((v >> 7) & 0x7F) | if v >= (1 << 14) { 0x80 } else { 0 }; let b2 = ((v >> 14) & 0x7F) | if v >= (1 << 21) { 0x80 } else { 0 }; let b3 = (v >> 21) & 0x7F; let len = 1u64 + ((v >= (1 << 7)) as u64) + ((v >= (1 << 14)) as u64) + ((v >= (1 << 21)) as u64); b0 | (b1 << 8) | (b2 << 16) | (b3 << 24) | (len << 32) }
rustc -C opt-level=3 x86_64 Disassembly (130 B .text / 34 insns)
hutter_uleb128_encode_u64:
    mov    ecx, edi
    mov    eax, edi
    mov    edx, edi
    lea    esi, [8*rdi]
    and    edi, 268435455
    xor    r8d, r8d
    cmp    rdi, 127
    seta    r8b
    mov    r9d, r8d
    shl    r9d, 7
    xor    r10d, r10d
    cmp    rdi, 16384
    setae    r10b
    xor    r11d, r11d
    cmp    rdi, 2097152
    setae    r11b
    and    ecx, 127
    or    rcx, r9
    add    r8d, r10d
    and    eax, 16256
    shl    r10d, 15
    lea    edi, [r10 + 2*rax]
    lea    eax, [r11 + r8]
    inc    eax
    or    rdi, rcx
    and    edx, 2080768
    shl    r11d, 23
    lea    ecx, [r11 + 4*rdx]
    or    rcx, rdi
    and    esi, 2130706432
    or    rsi, rcx
    shl    rax, 32
    or    rax, rsi
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#25hutter_uleb128_encode_u64 (THIS CAPSULE)
domain: hutter | id: 2d2f71b39d42873bdabe4ad0e93d4984
150837/50000 cyc/op28741/20000 ns/op20000000/28741 ops/us130 B .text (34 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz