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

Snap-Circuit Wiring Role: 2-to-1 Binary Combiner / Join Stage `(i64,i64)->i64` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion.

Hardware _rdtsc: 2257067/400000 cycles/op
Latency: 176469/100000 ns/op
Throughput: 100000000/176469 ops/us
Compiled ELF64 .text: 73 B (18 x86_64 insns)
C64 64KB RAM Budget: 515/65536 (515 B source)
Ternary Vote: + (score 1) | Salience: 99415/1092
Pure-Rust Capsule Source Code (515 B)
pub fn decay_q16(variance_q16: i64, elapsed: i64) -> i64 {
    const DECAY: i64 = 62339;
    const FLOOR: i64 = 6554;
    const MAX_STEPS: i64 = 4096;
    if elapsed <= 0 || variance_q16 <= FLOOR {
        return variance_q16;
    }
    if elapsed > MAX_STEPS {
        return FLOOR;
    }
    let mut value = variance_q16;
    let mut step = 0i64;
    while step < elapsed {
        value = (value * DECAY) >> 16;
        if value <= FLOOR {
            return FLOOR;
        }
        step += 1;
    }
    value
}
rustc -C opt-level=3 x86_64 Disassembly (73 B .text / 18 insns)
decay_q16:
    mov    rax, rdi
    test    rsi, rsi
    setle    cl
    cmp    rdi, 6555
    setl    dl
    or    dl, cl
    jne    .LBB7_5
    cmp    rsi, 4096
    jbe    .LBB7_3
.LBB7_4:
    mov    eax, 6554
    ret
.LBB7_3:
    imul    rax, rax, 62339
    sar    rax, 16
    cmp    rax, 6554
    jle    .LBB7_4
    dec    rsi
    jne    .LBB7_3
.LBB7_5:
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#40decay_q16 (THIS CAPSULE)
domain: memory | id: d078c61a77ea2eb9f23e8c64bf420c5b
2257067/400000 cyc/op176469/100000 ns/op100000000/176469 ops/us73 B .text (18 insns)+ (1)aye::Peter+Omni(0+1)::aarch64 @ 432Hz