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 (1806391/200000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: 2-to-1 Binary Combiner / Join Stage `(u32,u32)->u32` — ideal for merging two upstream DAG branches, dot products, or pairwise rank fusion.
.text: 34 B (13 x86_64 insns)88 B)pub fn round_up_to_base(x: u32, base: u32) -> u32 {
((x + base - 1) / base) * base
}
rustc -C opt-level=3 x86_64 Disassembly (34 B .text / 13 insns)round_up_to_base:
test esi, esi
je .LBB7_2
lea ecx, [rdi + rsi]
dec ecx
mov eax, ecx
xor edx, edx
div esi
sub ecx, edx
mov eax, ecx
ret
.LBB7_2:
push rax
lea rdi, [rip + .Lanon.a270e05f789020653a98a620bea8a67e.4]
call qword ptr [rip + _RNvNtNtCscNqnBmBaIcL_4core9panicking11panic_const23panic_const_div_by_zero@GOTPCREL]
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #920 | round_up_to_base (THIS CAPSULE) domain: smart-tree | id: c7a3594712374fe87d7a504d01bd9e09 | 1806391/200000 cyc/op | 344167/80000 ns/op | 80000000/344167 ops/us | 34 B .text (13 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |