The Problem

Vision‑language models routinely tokenize every frame into dense patch grids, inflating memory and compute budgets. Existing Rust bindings to OpenCV require building the C++ library, which is a barrier for teams that want a fully safe, zero‑FFI stack.

What This Does

solidcv implements a pure‑Rust, OpenCV‑compatible API in src/lib.rs and src/prelude.rs. Key modules:

  • src/mechinterp.rs – provides prune_vlm_patch_tokens and SaeBinaryCircuitMatcher for token pruning and sparse auto‑encoding.
  • src/pixelean.rs – bit‑plane slicing and 1‑bit algebra.
  • src/voxelean.rs – 3‑D octree topology and Euler‑Poincaré invariants.
  • src/realitycomb.rs – static‑vs‑moving scene separation and worldtube construction.
  • src/cloud_ws.rs – lightweight WebSocket API for streaming frame data.

The library exposes these through the solidcv::opencv namespace, enabling drop‑in replacement for opencv‑rust.

How It Is Wired

Execution begins with cargo run --example … or an external crate importing solidcv::opencv. src/lib.rs re‑exports all submodules; src/prelude.rs re‑exports the most common items into a single namespace. When a user calls solidcv::opencv::prune_vlm_patch_tokens, the call path is:

user → lib.rs → mechinterp::prune_vlm_patch_tokens
            ↓
           pixelean::bitplane_slice
            ↓
          imgproc::Image::load / Image::slice

mechinterp uses pixelean to transform the image into 1‑bit slices, then applies XOR minterm carrier logic. The worldtube and realitycomb modules operate on the resulting 3‑D octree produced by voxelean. cloud_ws is independent; it exposes a WsServer type that serializes Image frames over a WebSocket, but is not invoked by the core CV functions. The build.rs script configures platform‑specific features (NEON, Metal, PTX) but does not interact with the runtime API.

The graph forms a linear chain from the public API to the low‑level bit‑plane math, with only src/prelude.rs acting as a hub. Changing prelude will affect every consumer, whereas modifying cloud_ws.rs has no side effects on the CV logic.

How To Use It

Setup

# Add to your Cargo.toml
solidcv = { path = "../solidcv" }

Build

cargo build --release

Run an example

cargo run --example full_suite_benchmark

The example demonstrates token pruning, SAE matching, and worldtube extraction on a sample video (assets/solidsf-platform-demo-30s.mp4).

No external configuration files are required; all parameters are passed via function arguments.

Real‑World Use

use solidcv::opencv::{prune_vlm_patch_tokens, SaeBinaryCircuitMatcher};

let img = solidcv::opencv::imgproc::Image::load("frame.png")?;
let active = prune_vlm_patch_tokens(&img)?;
let matcher = SaeBinaryCircuitMatcher::new();
let matches = matcher.match_residual(&img)?;

Insert this into a VLM inference loop to skip re‑encoding of static patches and reuse KV‑cache entries.

Code Health & Issues

  • CI/CD – no .github/ or CI config; automated build gate missing.
  • Tests – only tests/hard_verification.rs; no coverage metrics.
  • Documentation – README gives high‑level overview but lacks build instructions.
  • License – present (LICENSE), but not published on crates.io; distribution is manual.

These factors mean the repository is still in early stages; contributors should add CI, expand tests, and provide clearer build examples.

The Bottom Line

solidcv offers an ambitious, fully safe Rust alternative to OpenCV with specialized functions for VLM token pruning and 3‑D geometry. The API is clean and centered around solidcv::opencv. However, the lack of CI, limited tests, and sparse documentation limit immediate adoption. It is suitable for research prototypes or teams that can bundle the source locally and are comfortable with manual builds.