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. Sub-10-cycle hardware kernel (1646439/200000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: 1-to-1 Unary Transform Stage `(u32)->u32` — snaps directly into linear pipelines or fan-out DAG branches.
.text: 87 B (26 x86_64 insns)291 B)pub fn shell_closure_below(nucleon_count: u32) -> u32 {
const CLOSURES: [u32; 8] = [2, 8, 20, 28, 50, 82, 126, 184];
let mut result = 0;
for &c in &CLOSURES {
if c <= nucleon_count {
result = c;
} else {
break;
}
}
result
}
rustc -C opt-level=3 x86_64 Disassembly (87 B .text / 26 insns)shell_closure_below:
xor eax, eax
cmp edi, 2
jb .LBB7_8
mov eax, 2
cmp edi, 8
jb .LBB7_8
mov eax, 8
cmp edi, 20
jb .LBB7_8
mov eax, 20
cmp edi, 28
jb .LBB7_8
mov eax, 28
cmp edi, 50
jb .LBB7_8
mov eax, 50
cmp edi, 82
jb .LBB7_8
mov eax, 82
cmp edi, 126
jb .LBB7_8
cmp edi, 184
mov ecx, 126
mov eax, 184
cmovb eax, ecx
.LBB7_8:
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #766 | shell_closure_below (THIS CAPSULE) domain: smart-tree | id: f9621d59fa8a28480b84e359e3e4eb61 | 1646439/200000 cyc/op | 1568383/400000 ns/op | 400000000/1568383 ops/us | 87 B .text (26 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |