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

Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u8,u8,u16)->u32` — wire matching input pins via `snap_dag` or `snap_pipeline`.

Hardware _rdtsc: 1353957/200000 cycles/op
Latency: 1289699/400000 ns/op
Throughput: 400000000/1289699 ops/us
Compiled ELF64 .text: 29 B (9 x86_64 insns)
C64 64KB RAM Budget: 195/65536 (195 B source)
Ternary Vote: + (score 1) | Salience: 195/2
Pure-Rust Capsule Source Code (195 B)
pub const fn encode_add_imm(rd: u8, rn: u8, imm12: u16) -> u32 {
    0x9100_0000
        | (((imm12 & 0x0FFF) as u32) << 10)
        | (((rn & 0x1F) as u32) << 5)
        | ((rd & 0x1F) as u32)
}
rustc -C opt-level=3 x86_64 Disassembly (29 B .text / 9 insns)
encode_add_imm:
    and    edx, 4095
    shl    edx, 10
    and    esi, 31
    shl    esi, 5
    or    esi, edx
    and    edi, 31
    lea    eax, [rdi + rsi]
    add    eax, -1862270976
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#551encode_add_imm (THIS CAPSULE)
domain: smart-tree | id: c1e1836fd7f4708deca70abb734345c9
1353957/200000 cyc/op1289699/400000 ns/op400000000/1289699 ops/us29 B .text (9 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz