Live In-Browser Webcam, PCA & Text-to-Image Studio

Experience RCRE's zero-copy CV filters, PCA rate-distortion codec, and 100% client-side Text-to-Image Diffusion (WASM SIMD128) directly in your browser with zero server inference.

📷 Live Webcam CV 🔬 PCA Compression Lab ✨ Text-to-Image WASM Studio
Synthetic Moving Colorbars FPS: 60.0 (16.6 ms) GBDT: High Contrast (98.4%)

Pipeline Controls

Gaussian Sigma (σ) 1.2
Edge Intensity Threshold 35

Memory & Trace

1. Ingest Tensor [480, 640, 3] 900 KB
2. Grayscale Tensor [480, 640] 300 KB
3. Gaussian Blur Tensor 300 KB
4. Sobel Edges (dx, dy) 600 KB
5. GBDT Decision Inference < 1 μs
Linear Arena Allocation: 3.2 MB / 32 MB (10%)
Zero heap re-allocations in loop.

🔬 PCA Image Compression Test Lab

Test RCRE's zero-dependency Principal Component Analysis (RPCA) spatial block codec. Compress photos into orthogonal low-dimensional subspace bases with 8-bit uniform quantization, inspect learned eigen-basis patches, evaluate rate-distortion curves (PSNR vs. Bitrate), and export bitstreams matching the C23 CLI engine (rcre-pca).

Original Reference
PCA Reconstructed (K=12)
Drag divider left/right or hover over image to inspect pixel-level fidelity
Original Reference Frame
Reconstructed Image (K=12)
Residual Magnitude |I - Î|:
0 (Exact) Low Med High (≥50)
Top principal component eigenvectors W ∈ ℝK × D reshaped into spatial filter patches. Observe how PCA learns DC luminance, directional gradients, and high-frequency textures directly from image pixel statistics.
PSNR Fidelity
-- dB
Ready
Compression Ratio
-- ×
--% space savings
Mean Squared Error
--
L2 residual norm
Bitstream Size
-- KB
-- bpp
Compute Latency
-- ms
Fit + Quant + Recon

Compression Settings

Components Retained (K) 12
Matches RCRE uint8_t min/max .rpca bitstream specification.

Rate-Distortion Benchmark

Sweep K values from 2 to 64 to evaluate PSNR vs. Bitrate curves (identical to rcre-pca --benchmark).

✨ RCRE Text-to-Image Diffusion Studio rcre_t2i.wasm · 35 KB gz

Runs RCRE's native ISO C23 Text-Conditioned Diffusion Transformer (RCRE_TextDiT), 4× Spatial Convolutional VAE (RCRE_SpatialVAE), Rectified Flow ODE + Classifier-Free Guidance, and RGQ1 Q8_0 dequantizer directly inside a browser Web Worker using 128-bit WASM SIMD register-blocked GEMM kernels. Models are lazy-loaded on demand.

Pixel-Space Output (32×32 RGB)
Ready — click Generate or pick a prompt chip to load WASM weights 0 / 24
WASM Backend
SIMD128
Parameters
—
Step Latency
—
Total Time
—
Try an example prompt:
Rectified Flow Steps 24
CFG Guidance Scale 3.5
Supported vocabulary for this tier
Loading manifest...
⚡ Build Locally with the RCRE Project Template
📖 10-Page Mini E-Book ↗ GitHub Template Folder ↗

Ready to take your algorithms beyond the browser? The turnkey project-template gives you a clean, zero-dependency C23 starter kit. No package managers, no CMake hurdles—just pure ISO C23 and the single-header engine.

🚀 60-Second Quickstart Terminal

Clone the repository and build the hardware-accelerated 1080p pipeline in three commands:

bash — project-template
cd apps/rcre/project-template

# 1. Build & execute 1080p SIMD pipeline
make run

# 2. Run AddressSanitizer & UBSan tests
make test
⚡ >7,500 MP/s on NEON 🛡️ 100% ASan Clean
🔄 The 5-Step C23 Lifecycle Architecture

Every RCRE program follows this predictable, zero-fragmentation pattern:

1
rcre_hal_init()

Probes host CPU (ARM NEON, AVX2, or SIMD128) and wires dynamic dispatch tables.

2
rcre_arena_create(16MB)

Allocates a 64-byte aligned contiguous memory pool. Zero malloc in hot paths.

3
rcre_tensor_create(...)

Sub-allocates strided N-D tensors linearly in O(1) time without OS syscalls.

4
rcre_cv_rgb_to_gray(...)

Executes vector micro-kernels delivering multi-gigapixel throughput.

5
rcre_arena_reset() / destroy()

Rewinds offset in O(1) time between frames; clean single unmap on exit.

📐 Three Golden Silicon Rules Best Practices

Keep your code blazingly fast and free from memory bugs:

🚫 Rule 1: Zero malloc() in Inner Loops
Heap allocation locks mutexes and fragments memory. Sub-allocate from your arena and call rcre_arena_reset() at batch/frame boundaries.
⚡ Rule 2: Strictly 64-Byte Aligned
Cache lines are 64 bytes. Vector load instructions saturate memory bus bandwidth when tensors are aligned to 64 bytes (handled automatically by RCRE).
📦 Rule 3: Single Translation Unit Definition
Define #define RCRE_IMPLEMENTATION in exactly one file (src/main.c). In all other modules, just include rcre.h.
💻 Minimal Starter Skeleton C23 Code

Copy this minimal skeleton directly into your new project:

#define RCRE_IMPLEMENTATION
#include "rcre.h"

int main(void) {
    // 1. Probe CPU SIMD
    rcre_hal_init();

    // 2. Pre-allocate 16MB linear arena
    RCRE_Arena* arena = rcre_arena_create(16 * 1024 * 1024);

    // 3. Create strided tensor & execute
    size_t shape[3] = {1080, 1920, 3};
    RCRE_Tensor img = rcre_tensor_create(shape, 3, RCRE_DTYPE_U8, RCRE_LAYOUT_HWC, arena);

    // 4. Free arena in O(1) single unmap
    rcre_arena_destroy(arena);
    return 0;
}
📖 Read 10-Page Mini E-Book for Beginners ↗ Full README ↗ Developer Cheat Sheet ↗
📸
Photo Saved to Filesystem
rcre_photo.png