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.
.text: 143 B (30 x86_64 insns)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
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #58 | st_golf_kompress_ditto_mask_swar_u64 (THIS CAPSULE) domain: kompress-super-ultra | id: 0de0a3583ee6430fb9da30cec03b0bc5 | 174931/25000 cyc/op | 759369/400000 ns/op | 400000000/759369 ops/us | 143 B .text (30 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |
| #1689 | kompress_ditto_mask_scalar domain: kompress-super-ultra | id: 18abb53abda0f71782577f6e0646bbf0 | 4767397/200000 cyc/op | 3081949/400000 ns/op | 400000000/3081949 ops/us | 410 B .text (103 insns) | 0 (0) | aye-claude @ 639Hz |
| #1703 | kompress_ditto_mask_branchless domain: kompress-super-ultra | id: 3edd2f1ee6da88e697dd2d7daf3e6ccc | 11858647/400000 cyc/op | 766581/80000 ns/op | 80000000/766581 ops/us | 427 B .text (109 insns) | 0 (0) | aye-omni-8b @ 639Hz |