⚡ Hardware Acceleration on Apple M5 Max & x86 AVX2

High-Performance CV & ML.
Zero Dependencies. Pure C23.

Recep's Code Run Everywhere (RCRE) unifies strided N-D tensors, multicore work-stealing concurrency, bit-exact OpenCV parity, and classical machine learning with zero heap allocations in critical inference loops.

72.96 GFLOPS
Cache-Tiled GEMM (Apple M5 Max)
7,922 MP/s
RGB to Gray (~3,800 FPS @ 1080p)
7.86M /s
GBDT Inferences (127 ns Latency)
44,434 QPS
HNSW Vector Search (64-D)

The "Learn" Visualizer Showdown

🧊

3D Tensor Strides & Memory Layout

Interactive Three.js 3D voxel grid visualizing how $(H, W, C)$ maps to flat 1D memory. Toggle layouts and watch $\mathcal{O}(1)$ slicing incur zero byte copies.

⚡

Tiled GEMM & Cache Hierarchy

Animated memory hierarchy demonstrating RAM, L3, L1 cache, and CPU vector registers. Learn why register blocking yields $10\times$ speedups over naive matrix multiplication.

🎯

Sliding Stencils & SIMD Lanes

Visualizes $3 \times 3$ Gaussian blur and Sobel filters sliding over pixels with 128-bit (NEON/WASM) and 256-bit (AVX2) vector registers processing parallel lanes.

Architected for Speed & Reliability

🛡️

Zero Dynamic Allocations

All algorithms operate strictly inside 64-byte aligned linear scratchpad memory arenas (`RCRE_Arena`). Inference loops never invoke `malloc`, guaranteeing deterministic real-time latency.

🔬

OpenCV & Scikit-Learn Parity

15-bit fixed-point integer color kernels deliver 0 LSB difference against OpenCV `cv2.cvtColor`. Linear SVM, k-Means, and PCA match Scikit-Learn within float tolerance ($\epsilon \le 10^{-4}$).

📷

Zero-Copy Hardware Camera Ingestion

Segregated companion driver module (`rcre_cam.h`) with native macOS AVFoundation, Linux V4L2, and WebRTC browser backends streaming 1080p frames directly into tensor memory.

Drop-In Single-Header C23

// 1. Include RCRE single-header implementation
#define RCRE_IMPLEMENTATION
#include "rcre.h"

int main(void) {
    // 2. Initialize 64-byte aligned linear memory arena (no malloc in loops!)
    RCRE_Arena* arena = rcre_arena_create(32 * 1024 * 1024);

    // 3. Create strided 3D image tensor [480, 640, 3] U8
    size_t shape[3] = {480, 640, 3};
    RCRE_Tensor img = rcre_tensor_create(shape, 3, RCRE_DTYPE_U8, RCRE_LAYOUT_HWC, arena);

    // 4. Execute SIMD-accelerated Rec.601 Grayscale & Gaussian Blur
    size_t gray_shape[2] = {480, 640};
    RCRE_Tensor gray = rcre_tensor_create(gray_shape, 2, RCRE_DTYPE_U8, RCRE_LAYOUT_HWC, arena);
    rcre_cv_rgb_to_gray(&img, &gray);

    rcre_arena_destroy(arena);
    return 0;
}