Engineering Category: Lossless Wire & Structural Compression
Best Use in Production: Zero-allocation integer bit-packing, variable-length encoding, and stream framing for sovereign wire protocols.
When to Select This Capsule: Sole canonical implementation for its 64-vector functional equivalence class. Multi-step compute kernel (15316853/200000 cyc/op); best used at frame, block, or batch aggregation boundaries.
Snap-Circuit Wiring Role: Slice Ingress / Scanner Stage `(&[u8],&[u8])->u32` — digests raw byte buffers into scalar tokens or checksums.
.text: 87 B (25 x86_64 insns)360 B)pub fn crc32_with_header(header: &[u8], payload: &[u8]) -> u32 {
let mut crc: u32 = 0xFFFF_FFFF;
for b in header.iter().chain(payload.iter()) {
crc ^= *b as u32;
for _ in 0..8 {
let mask = crc & 1;
crc >>= 1;
if mask != 0 {
crc ^= 0xEDB8_8320;
}
}
}
!crc
}
rustc -C opt-level=3 x86_64 Disassembly (87 B .text / 25 insns)crc32_with_header:
add rsi, rdi
add rcx, rdx
mov eax, -1
lea r8, [rip + .L.crctable]
jmp .LBB7_1
.LBB7_3:
lea r9, [rdi + 1]
.LBB7_6:
mov r10d, eax
shr r10d, 8
xor al, byte ptr [rdi]
movzx eax, al
xor r10d, dword ptr [r8 + 4*rax]
mov rdi, r9
mov eax, r10d
.LBB7_1:
test rdi, rdi
je .LBB7_4
cmp rdi, rsi
jne .LBB7_3
.LBB7_4:
cmp rdx, rcx
je .LBB7_7
mov rdi, rdx
inc rdx
xor r9d, r9d
jmp .LBB7_6
.LBB7_7:
not eax
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #1717 | crc32_with_header (THIS CAPSULE) domain: smart-tree | id: cf74447ed2152782fb43613497946eac | 15316853/200000 cyc/op | 7294073/200000 ns/op | 200000000/7294073 ops/us | 87 B .text (25 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |