23 APR 2026

rahulmnavneeth

architecture

homedocs

Layer diagram

                     ┌──────────────────────────────┐
                     │  Consumers                   │
                     │  (DAW plugin, external apps) │
                     └──────────────────────────────┘
                                   ▲
                   ┌───────────────┴────────────────┐
                   │   Transports                   │
                   │   OSC │ MIDI/MPE │ shm │ FFI   │
                   └───────────────┬────────────────┘
                                   ▲
                   ┌───────────────┴────────────────┐
                   │   Trackers                     │
                   │   point │ bbox │ plane │ face  │
                   │                      │ roto    │
                   └───────────────┬────────────────┘
                                   ▲
                   ┌───────────────┴────────────────┐
                   │   Core                         │
                   │   Tracker trait, manifolds,    │
                   │   filters, pipeline            │
                   └───────────────┬────────────────┘
                                   ▲
                   ┌───────────────┴────────────────┐
                   │   Runtime                      │
                   │   camera │ inference │ ringbuf │
                   └────────────────────────────────┘

Dependency direction points up. Core has zero I/O dependencies and is safe to run anywhere (including a real-time audio thread). Runtime owns all the OS and GPU integrations. Trackers compose core primitives and use runtime services through traits.

No tracker ever imports another tracker. No transport ever imports a tracker directly — it consumes Sample<G, C> via a generic Sink<G, C> trait.

Crate layout

crates/
  uify-core/            # no I/O; pure math + traits
  uify-point/           # point trackers (ball, generic feature)
  uify-bbox/            # bounding boxes (AA + oriented)
  uify-plane/           # homography + PnP → SE(3)
  uify-face/            # landmarks + SE(3) + blendshapes
  uify-roto/            # contour / mask tracker
  uify-runtime/         # cameras, inference, ring buffer
  uify-transport-osc/   # OSC
  uify-transport-midi/  # MIDI / MPE
  uify-transport-shm/   # shared memory
  uify-clap-plugin/     # CLAP (AU/VST3 via clap-wrappers)
  uify-ffi/             # C ABI cdylib + generated header

Pipeline

See pipeline. Every tracker is:

Source → Detector → Associator → Filter → Smoother → Sink

Each stage is a trait with a single step() method. Stages compose; a detector can be swapped without touching the filter.

Thread model

See threading. Three threads, strict roles, one lock-free bridge.

Latency

See latency-budget. Glass-to-parameter:

StageTypicalTightened
Capture → GPU4–8 ms2–3 ms
Inference5–15 ms2–5 ms
Filter + ring push<0.2 ms<0.2 ms
Audio pickup≤ blocksub-block
Total~15–25 ms~8–12 ms

Accuracy

See manifolds. Non-negotiables:

Extension strategy

See extension. TL;DR: add a tracker by adding a crate that implements Tracker; add a transport by adding a crate with a Sink<G, C> impl; add a camera backend by implementing the camera::Backend trait in uify-runtime.