Engineering Category: SWAR Pixel Processing & Vision Kernels
Best Use in Production: Branchless in-register pixel averaging, color-space conversion, and edge gradient filtering for zero-copy framebuffers.
When to Select This Capsule: Holds the #1 Equivalence Crown across 2 functionally identical implementations (fastest verified hardware _rdtsc). Sub-10-cycle hardware kernel (241321/100000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u32,u32)->u64` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 41 B (12 x86_64 insns)277 B)pub const fn compute_rgba8_byte_length_checked(width: u32, height: u32) -> u64 { const MAX_IMAGE_BYTE_LENGTH: u64 = 2_147_483_647; let total = 4u64.saturating_mul(width as u64).saturating_mul(height as u64); if total == 0 || total > MAX_IMAGE_BYTE_LENGTH { 0 } else { total } }
rustc -C opt-level=3 x86_64 Disassembly (41 B .text / 12 insns)compute_rgba8_byte_length_checked:
mov eax, edi
shl rax, 2
mov ecx, esi
mul rcx
seto cl
lea rdx, [rax - 2147483648]
xor esi, esi
cmp rdx, -2147483647
cmovb rax, rsi
test cl, cl
cmovne rax, rsi
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #5 | compute_rgba8_byte_length_checked (THIS CAPSULE) domain: ayecast-x86_64 | id: 61042e4026d081148126d4a7eabce8c8 | 241321/100000 cyc/op | 26193/40000 ns/op | 40000000/26193 ops/us | 41 B .text (12 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |
| #18 | compute_rgba8_byte_length_checked domain: ayecast-x86_64 | id: caf4491ff0d660b9f9acf244f9e03f4d | 801311/200000 cyc/op | 217433/200000 ns/op | 200000000/217433 ops/us | 41 B .text (12 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |