Best Use & Engineering Application Guide

Engineering Category: Marine Salience & Wave Telemetry

Best Use in Production: Tracking period and amplitude stability across zero-crossing intervals to score signal salience in noisy real-time sensor and audio streams.

When to Select This Capsule: Holds the #1 Equivalence Crown across 2 functionally identical implementations (fastest verified hardware _rdtsc). Low-latency L1-resident kernel (4758221/200000 cyc/op); well-suited for high-frequency pipeline stages.

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

Hardware _rdtsc: 4758221/200000 cycles/op
Latency: 1290863/200000 ns/op
Throughput: 200000000/1290863 ops/us
Compiled ELF64 .text: 372 B (112 x86_64 insns)
C64 64KB RAM Budget: 995/65536 (995 B source)
Ternary Vote: + (score 1) | Salience: 222901/2574
Pure-Rust Capsule Source Code (995 B)
pub const fn st_golf_qwave_marine_jitter_u64(packed_peaks: u64) -> u64 {
    let f0 = packed_peaks & 0xFFFF;
    let p0 = (f0 >> 8) & 0xFF;
    let mut ema_p = (if p0 < 25 { 25 } else { p0 } as i64) << 8;
    let a0 = f0 & 0xFF;
    let mut ema_a = (if a0 < 1 { 1 } else { a0 } as i64) << 8;
    let mut total_salience: u64 = 32767;
    let mut shift: u32 = 16;
    while shift < 64 {
        let frame = (packed_peaks >> shift) & 0xFFFF;
        let pt = (frame >> 8) & 0xFF;
        let period_q8 = (if pt < 25 { 25 } else { pt } as i64) << 8;
        let at = frame & 0xFF;
        let amp_q8 = (if at < 1 { 1 } else { at } as i64) << 8;
        ema_p = ((ema_p * 7) + period_q8) >> 3;
        ema_a = ((ema_a * 7) + amp_q8) >> 3;
        let jp = (period_q8 - ema_p).unsigned_abs();
        let ja = (amp_q8 - ema_a).unsigned_abs() >> 2;
        let denom = (256 + jp + ja) as u32;
        total_salience += (8_388_352u32 / denom) as u64;
        shift += 16;
    }
    total_salience >> 2
}
rustc -C opt-level=3 x86_64 Disassembly (372 B .text / 112 insns)
st_golf_qwave_marine_jitter_u64:
    push    rbx
    mov    rbx, rdi
    movzx    edx, bh
    cmp    rdx, 26
    mov    edi, 25
    cmovb    rdx, rdi
    movzx    ecx, bl
    cmp    rcx, 1
    adc    rcx, 0
    mov    esi, ebx
    shr    esi, 16
    mov    eax, ebx
    shr    eax, 24
    cmp    rax, 26
    cmovb    rax, rdi
    shl    eax, 8
    movzx    r8d, sil
    cmp    r8, 1
    adc    r8, 0
    shl    r8d, 8
    imul    edx, edx, 1792
    add    edx, eax
    shr    edx, 3
    imul    ecx, ecx, 1792
    add    ecx, r8d
    shr    ecx, 3
    mov    esi, ecx
    mov    r9d, r8d
    sub    r9d, ecx
    sub    ecx, r8d
    cmovb    ecx, r9d
    mov    r9d, edx
    mov    r8d, eax
    sub    r8d, edx
    sub    edx, eax
    cmovb    edx, r8d
    shr    ecx, 2
    add    ecx, edx
    add    ecx, 256
    mov    eax, 8388352
    xor    edx, edx
    div    ecx
    mov    ecx, eax
    mov    rdx, rbx
    shr    rdx, 32
    mov    rax, rbx
    shr    rax, 40
    movzx    eax, al
    cmp    rax, 26
    cmovb    rax, rdi
    shl    eax, 8
    movzx    edx, dl
    cmp    rdx, 1
    adc    rdx, 0
    shl    edx, 8
    lea    r8, [rax + 8*r9]
    sub    r8, r9
    shr    r8, 3
    lea    r9, [rdx + 8*rsi]
    sub    r9, rsi
    shr    r9, 3
    mov    esi, r9d
    sub    esi, edx
    sub    rdx, r9
    cmovb    rdx, rsi
    mov    esi, r8d
    sub    esi, eax
    sub    rax, r8
    cmovb    rax, rsi
    shr    edx, 2
    lea    esi, [rax + rdx]
    add    esi, 256
    mov    eax, 8388352
    xor    edx, edx
    div    esi
    mov    esi, eax
    add    esi, ecx
    mov    rax, rbx
    shr    rax, 48
    shr    rbx, 56
    cmp    rbx, 26
    cmovb    rbx, rdi
    shl    ebx, 8
    movzx    eax, al
    cmp    rax, 1
    adc    rax, 0
    shl    eax, 8
    lea    rcx, [rbx + 8*r8]
    sub    rcx, r8
    shr    rcx, 3
    lea    rdx, [rax + 8*r9]
    sub    rdx, r9
    shr    rdx, 3
    mov    rdi, rdx
    sub    rdi, rax
    sub    rax, rdx
    cmovb    rax, rdi
    mov    edx, ecx
    sub    edx, ebx
    sub    rbx, rcx
    cmovb    rbx, rdx
    shr    rax, 2
    lea    ecx, [rbx + rax]
    add    ecx, 256
    mov    eax, 8388352
    xor    edx, edx
    div    ecx
    add    eax, esi
    add    eax, 32767
    shr    eax, 2
    pop    rbx
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#1560st_golf_qwave_marine_jitter_u64 (THIS CAPSULE)
domain: qwave | id: c5b50a7afeb990018a36ff2f30641e3f
4758221/200000 cyc/op1290863/200000 ns/op200000000/1290863 ops/us372 B .text (112 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz
#1712qwave_marine_jitter_salience
domain: qwave | id: eaaafa7e626b34b505b4c7234e53b2f5
1108341/25000 cyc/op2866023/200000 ns/op200000000/2866023 ops/us385 B .text (118 insns)0 (0)aye-core-8b @ 432Hz