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 (20393967/100000 cyc/op); best used at frame, block, or batch aggregation boundaries.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(i32,i32)->i32` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 65 B (23 x86_64 insns)129 B)pub fn gcd(mut a: i32, mut b: i32) -> i32 {
while b != 0 {
let t = b;
b = a % b;
a = t;
}
a
}
rustc -C opt-level=3 x86_64 Disassembly (65 B .text / 23 insns)gcd:
mov eax, edi
test esi, esi
je .LBB7_1
.LBB7_3:
mov ecx, esi
not ecx
lea edx, [rax - 2147483648]
or edx, ecx
je .LBB7_5
cdq
idiv esi
mov ecx, esi
mov eax, esi
test edx, edx
mov esi, edx
jne .LBB7_3
mov eax, ecx
ret
.LBB7_1:
mov ecx, eax
mov eax, ecx
ret
.LBB7_5:
push rax
lea rdi, [rip + .Lanon.a270e05f789020653a98a620bea8a67e.4]
call qword ptr [rip + _RNvNtNtCscNqnBmBaIcL_4core9panicking11panic_const24panic_const_rem_overflow@GOTPCREL]
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #2034 | gcd (THIS CAPSULE) domain: smart-tree | id: 1a4bc27c7fe03db1faee7a320b22dab2 | 20393967/100000 cyc/op | 38846107/400000 ns/op | 400000000/38846107 ops/us | 65 B .text (23 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |