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

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

Hardware _rdtsc: 1646439/200000 cycles/op
Latency: 1568383/400000 ns/op
Throughput: 400000000/1568383 ops/us
Compiled ELF64 .text: 87 B (26 x86_64 insns)
C64 64KB RAM Budget: 291/65536 (291 B source)
Ternary Vote: + (score 1) | Salience: 70637/936
Pure-Rust Capsule Source Code (291 B)
pub fn shell_closure_below(nucleon_count: u32) -> u32 {
    const CLOSURES: [u32; 8] = [2, 8, 20, 28, 50, 82, 126, 184];
    let mut result = 0;
    for &c in &CLOSURES {
        if c <= nucleon_count {
            result = c;
        } else {
            break;
        }
    }
    result
}
rustc -C opt-level=3 x86_64 Disassembly (87 B .text / 26 insns)
shell_closure_below:
    xor    eax, eax
    cmp    edi, 2
    jb    .LBB7_8
    mov    eax, 2
    cmp    edi, 8
    jb    .LBB7_8
    mov    eax, 8
    cmp    edi, 20
    jb    .LBB7_8
    mov    eax, 20
    cmp    edi, 28
    jb    .LBB7_8
    mov    eax, 28
    cmp    edi, 50
    jb    .LBB7_8
    mov    eax, 50
    cmp    edi, 82
    jb    .LBB7_8
    mov    eax, 82
    cmp    edi, 126
    jb    .LBB7_8
    cmp    edi, 184
    mov    ecx, 126
    mov    eax, 184
    cmovb    eax, ecx
.LBB7_8:
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#766shell_closure_below (THIS CAPSULE)
domain: smart-tree | id: f9621d59fa8a28480b84e359e3e4eb61
1646439/200000 cyc/op1568383/400000 ns/op400000000/1568383 ops/us87 B .text (26 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz