Best Use & Engineering Application Guide

Engineering Category: Spatial Indexing, Kinematics & Fixed-Point Geometry

Best Use in Production: Deterministic coordinate folding, space-filling curve locality mapping, and fixed-point trajectory kinematics without floating-point non-determinism.

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

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

Hardware _rdtsc: 993813/40000 cycles/op
Latency: 168507/25000 ns/op
Throughput: 25000000/168507 ops/us
Compiled ELF64 .text: 487 B (94 x86_64 insns)
C64 64KB RAM Budget: 357/32768 (714 B source)
Ternary Vote: + (score 1) | Salience: 118135/1332
Pure-Rust Capsule Source Code (714 B)
pub const fn st_golf_vaked_toss_spiral_fold_i64(coord: i64) -> i64 {
    const SIN_Q8: [i64; 8] = [165, 252, 222, 88, -88, -222, -252, -165];
    const COS_Q8: [i64; 8] = [196, 44, -128, -241, -241, -128, 44, 196];
    let mut x: i64 = (coord & 0xFFFF) - 32336;
    let mut y: i64 = ((coord >> 16) & 0xFFFF) - 32984;
    let mut step: usize = 0;
    while step < 8 {
        let s = SIN_Q8[step];
        let c = COS_Q8[step];
        let radius = ((step as i64) + 2) * 432;
        let nx = ((x * c - y * s) >> 8).wrapping_add(radius);
        let ny = ((x * s + y * c) >> 8).wrapping_sub(radius >> 1);
        x = nx ^ (((step as i64) + 1) * 137);
        y = ny;
        step += 1;
    }
    x.wrapping_add(y)
}
rustc -C opt-level=3 x86_64 Disassembly (487 B .text / 94 insns)
st_golf_vaked_toss_spiral_fold_i64:
    movzx    eax, di
    add    rax, -32336
    shr    edi, 16
    add    rdi, -32984
    imul    rcx, rax, 196
    imul    rdx, rdi, -165
    add    rdx, rcx
    sar    rdx, 8
    add    rdx, 864
    imul    rax, rax, 165
    imul    rcx, rdi, 196
    add    rcx, rax
    sar    rcx, 8
    add    rcx, -432
    xor    rdx, 137
    imul    rax, rdx, 44
    imul    rsi, rcx, -252
    add    rsi, rax
    sar    rsi, 8
    add    rsi, 1296
    imul    rax, rdx, 252
    imul    rcx, rcx, 44
    add    rcx, rax
    sar    rcx, 8
    add    rcx, -648
    xor    rsi, 274
    imul    rax, rcx, -222
    imul    rdx, rsi, 222
    shl    rsi, 7
    sub    rax, rsi
    sar    rax, 8
    add    rax, 1728
    shl    rcx, 7
    sub    rdx, rcx
    sar    rdx, 8
    add    rdx, -864
    xor    rax, 411
    imul    rcx, rax, -241
    imul    rsi, rdx, -88
    add    rsi, rcx
    sar    rsi, 8
    add    rsi, 2160
    imul    rax, rax, 88
    imul    rcx, rdx, -241
    add    rcx, rax
    sar    rcx, 8
    add    rcx, -1080
    xor    rsi, 548
    imul    rax, rsi, -241
    imul    rdx, rcx, 88
    add    rdx, rax
    sar    rdx, 8
    add    rdx, 2592
    imul    rax, rsi, -88
    imul    rcx, rcx, -241
    add    rcx, rax
    sar    rcx, 8
    add    rcx, -1296
    xor    rdx, 685
    imul    rax, rcx, 222
    imul    rsi, rdx, -222
    shl    rdx, 7
    sub    rax, rdx
    sar    rax, 8
    add    rax, 3024
    shl    rcx, 7
    sub    rsi, rcx
    sar    rsi, 8
    add    rsi, -1512
    xor    rax, 822
    imul    rcx, rax, 44
    imul    rdx, rsi, 252
    add    rdx, rcx
    sar    rdx, 8
    add    rdx, 3456
    imul    rax, rax, -252
    imul    rcx, rsi, 44
    add    rcx, rax
    sar    rcx, 8
    add    rcx, -1728
    xor    rdx, 959
    imul    rax, rdx, 196
    imul    rsi, rcx, 165
    add    rsi, rax
    sar    rsi, 8
    add    rsi, 3888
    imul    rax, rdx, -165
    imul    rcx, rcx, 196
    add    rcx, rax
    sar    rcx, 8
    xor    rsi, 1096
    lea    rax, [rcx + rsi]
    add    rax, -1944
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#1576st_golf_vaked_toss_spiral_fold_i64 (THIS CAPSULE)
domain: vaked | id: d5aa6cd27e0c0ffb4ea1f9a547c4e645
993813/40000 cyc/op168507/25000 ns/op25000000/168507 ops/us487 B .text (94 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz
#1716vaked_toss_spiral_fold
domain: vaked | id: 4d22589df15db2f08efbdafeb594fe1d
8520261/80000 cyc/op2840087/80000 ns/op80000000/2840087 ops/us517 B .text (100 insns)+ (1)aye-monozukuri @ 528Hz