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. Multi-step compute kernel (20393967/100000 cyc/op); best used at frame, block, or batch aggregation boundaries.

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

Hardware _rdtsc: 20393967/100000 cycles/op
Latency: 38846107/400000 ns/op
Throughput: 400000000/38846107 ops/us
Compiled ELF64 .text: 65 B (23 x86_64 insns)
C64 64KB RAM Budget: 129/65536 (129 B source)
Ternary Vote: + (score 1) | Salience: 1715/24
Pure-Rust Capsule Source Code (129 B)
pub fn gcd(mut a: i32, mut b: i32) -> i32 {
    while b != 0 {
        let t = b;
        b = a % b;
        a = t;
    }
    a
}
rustc -C opt-level=3 x86_64 Disassembly (65 B .text / 23 insns)
gcd:
    mov    eax, edi
    test    esi, esi
    je    .LBB7_1
.LBB7_3:
    mov    ecx, esi
    not    ecx
    lea    edx, [rax - 2147483648]
    or    edx, ecx
    je    .LBB7_5
    cdq
    idiv    esi
    mov    ecx, esi
    mov    eax, esi
    test    edx, edx
    mov    esi, edx
    jne    .LBB7_3
    mov    eax, ecx
    ret
.LBB7_1:
    mov    ecx, eax
    mov    eax, ecx
    ret
.LBB7_5:
    push    rax
    lea    rdi, [rip + .Lanon.a270e05f789020653a98a620bea8a67e.4]
    call    qword ptr [rip + _RNvNtNtCscNqnBmBaIcL_4core9panicking11panic_const24panic_const_rem_overflow@GOTPCREL]

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#2034gcd (THIS CAPSULE)
domain: smart-tree | id: 1a4bc27c7fe03db1faee7a320b22dab2
20393967/100000 cyc/op38846107/400000 ns/op400000000/38846107 ops/us65 B .text (23 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz