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 (1234501/200000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u16,u16)->u32` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 67 B (20 x86_64 insns)441 B)pub const fn evaluate_stroke_kinematics_q15(handle_mm: u16, seat_mm: u16) -> u32 {
let h = if handle_mm > 1_600 {
1_600u32
} else {
handle_mm as u32
};
let s = if seat_mm > 1_200 {
1_200u32
} else {
seat_mm as u32
};
let lhs = h * 3;
let rhs = s * 4;
let diff = lhs.abs_diff(rhs);
let penalty = if diff * 4 >= 32_768 { 32_768 } else { diff * 4 };
32_768 - penalty
}
rustc -C opt-level=3 x86_64 Disassembly (67 B .text / 20 insns)evaluate_stroke_kinematics_q15:
movzx eax, di
cmp eax, 1600
mov eax, 1600
cmovb eax, edi
lea eax, [rax + 2*rax]
movzx ecx, si
cmp ecx, 1200
mov ecx, 1200
cmovb ecx, esi
movzx eax, ax
shl ecx, 2
movzx ecx, cx
mov edx, ecx
sub edx, eax
mov esi, eax
sub esi, ecx
cmp ax, cx
cmovae esi, edx
lea eax, [4*rsi + 32768]
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #383 | evaluate_stroke_kinematics_q15 (THIS CAPSULE) domain: smart-tree | id: 200d27359944b2f3676bf8bcf33e60fb | 1234501/200000 cyc/op | 235211/80000 ns/op | 80000000/235211 ops/us | 67 B .text (20 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |