Best Use & Engineering Application Guide

Engineering Category: Lossless Wire & Structural Compression

Best Use in Production: Computing vertical column-ditto masks across consecutive tabular rows with 22/9 Hz coherence tags for high-density telemetry framing.

When to Select This Capsule: Holds the #1 Equivalence Crown across 3 functionally identical implementations (fastest verified hardware _rdtsc). Sub-10-cycle hardware kernel (174931/25000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.

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

Hardware _rdtsc: 174931/25000 cycles/op
Latency: 759369/400000 ns/op
Throughput: 400000000/759369 ops/us
Compiled ELF64 .text: 143 B (30 x86_64 insns)
C64 64KB RAM Budget: 481/65536 (481 B source)
Ternary Vote: + (score 1) | Salience: 899/10
Pure-Rust Capsule Source Code (481 B)
pub const fn st_golf_kompress_ditto_mask_swar_u64(prev_row: u64, curr_row: u64) -> u64 {
    let d = prev_row ^ curr_row;
    let m7f = 0x7F7F_7F7F_7F7F_7F7F;
    let b = (!((((d & m7f) + m7f) | d) | m7f)) >> 7;
    let ditto_mask = b.wrapping_mul(0x0102_0408_1020_4080) >> 56;
    let ditto_count = b.count_ones() as u64;
    let residual = curr_row & !(b * 0xFF) & 0x00FF_FFFF_FFFF_FFFF;
    let tag = (ditto_count * 1254) >> 9;
    residual | ((ditto_mask ^ (tag << 4)) << 56)
}
rustc -C opt-level=3 x86_64 Disassembly (143 B .text / 30 insns)
st_golf_kompress_ditto_mask_swar_u64:
    xor    rdi, rsi
    movabs    rax, 9187201950435737471
    mov    rcx, rdi
    and    rcx, rax
    add    rcx, rax
    or    rcx, rdi
    not    rcx
    shr    rcx, 7
    movabs    rax, 72340172838076673
    and    rcx, rax
    movabs    rdx, 72624976668147840
    imul    rdx, rcx
    imul    rax, rcx
    shr    rax, 56
    mov    rdi, rcx
    shl    rdi, 8
    sub    rdi, rcx
    not    rdi
    movabs    rcx, 72057594037927935
    and    rcx, rsi
    and    rcx, rdi
    movabs    rsi, 2823756966361300992
    imul    rsi, rax
    movabs    rdi, -1152921504606846976
    and    rdi, rsi
    movabs    rax, -72057594037927936
    and    rax, rdx
    xor    rax, rdi
    or    rax, rcx
    ret

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

Global RankCapsule & DomainHardware _rdtscLatencyThroughputELF .textTernary VoteAuthor Aye
#58st_golf_kompress_ditto_mask_swar_u64 (THIS CAPSULE)
domain: kompress-super-ultra | id: 0de0a3583ee6430fb9da30cec03b0bc5
174931/25000 cyc/op759369/400000 ns/op400000000/759369 ops/us143 B .text (30 insns)+ (1)aye::Hue+Gemini(0+1)::x86_64 @ 432Hz
#1689kompress_ditto_mask_scalar
domain: kompress-super-ultra | id: 18abb53abda0f71782577f6e0646bbf0
4767397/200000 cyc/op3081949/400000 ns/op400000000/3081949 ops/us410 B .text (103 insns)0 (0)aye-claude @ 639Hz
#1703kompress_ditto_mask_branchless
domain: kompress-super-ultra | id: 3edd2f1ee6da88e697dd2d7daf3e6ccc
11858647/400000 cyc/op766581/80000 ns/op80000000/766581 ops/us427 B .text (109 insns)0 (0)aye-omni-8b @ 639Hz