Best Use & Engineering Application Guide

Engineering Category: Hybrid Retrieval, Ranking & Entropy

Best Use in Production: Branchless integer similarity scoring, edit-distance evaluation, and candidate ranking for high-throughput retrieval pipelines.

When to Select This Capsule: Holds the #1 Equivalence Crown across 2 functionally identical implementations (fastest verified hardware _rdtsc). Multi-step compute kernel (270845/512 cyc/op); best used at frame, block, or batch aggregation boundaries.

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

Hardware _rdtsc: 270845/512 cycles/op
Latency: 4386153/4096 ns/op
Throughput: 4096000/4386153 ops/us
Compiled ELF64 .text: 66 B (17 x86_64 insns)
C64 64KB RAM Budget: 53/8192 (424 B source)
Ternary Vote: + (score 1) | Salience: 72985/819
Pure-Rust Capsule Source Code (424 B)
pub fn ayeos_mt6358_sgen_crest_step_v2(semitone_state: u64) -> u64 {
    let raw_div = (semitone_state >> 40) & 0x1F;
    let sgen_div = if raw_div == 0 { 1 } else { raw_div };
    let semi = (semitone_state >> 32) & 0x1F;
    let phase_seed = semitone_state & 0xFFFF;
    let crest_energy = (phase_seed + sgen_div * 125).wrapping_mul(136);
    (0x5859_3080u64 << 32) | ((semi & 0xFF) << 24) | (crest_energy & 0x00FF_FFFF)
}
rustc -C opt-level=3 x86_64 Disassembly (66 B .text / 17 insns)
ayeos_mt6358_sgen_crest_step_v2:
    mov    rax, rdi
    shr    rax, 40
    and    eax, 31
    cmp    rax, 1
    adc    rax, 0
    movzx    ecx, di
    imul    rax, rax, 125
    add    rax, rcx
    mov    rcx, rax
    shl    rcx, 7
    lea    rcx, [rcx + 8*rax]
    shr    rdi, 8
    and    edi, 520093696
    movabs    rax, 6366172874578853888
    or    rax, rdi
    or    rax, rcx
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#2046ayeos_mt6358_sgen_crest_step_v2 (THIS CAPSULE)
domain: ayeos | id: a3475c04a630744f76fc70e301afd605
270845/512 cyc/op4386153/4096 ns/op4096000/4386153 ops/us66 B .text (17 insns)+ (1)aye-blu-g75-mt6768 @ 432Hz
#2049ayeos_mt6358_sgen_crest_step_v1
domain: ayeos | id: e3df12a8f5b0d1b8697c17b26a3513fc
69521/128 cyc/op562923/512 ns/op512000/562923 ops/us67 B .text (17 insns)0 (0)aye-blu-g75-mt6768 @ 432Hz