Skip to content

docs(adr): ADR-084 — RaBitQ similarity sensor for CSI/pose/memory (proposed)#429

Merged
ruvnet merged 1 commit intomainfrom
feat/adr-084-rabitq-similarity-sensor
Apr 26, 2026
Merged

docs(adr): ADR-084 — RaBitQ similarity sensor for CSI/pose/memory (proposed)#429
ruvnet merged 1 commit intomainfrom
feat/adr-084-rabitq-similarity-sensor

Conversation

@ruvnet
Copy link
Copy Markdown
Owner

@ruvnet ruvnet commented Apr 26, 2026

Summary

Adopt RaBitQ-style binary sketches as a first-class cheap similarity sensor at five points in the RuView pipeline, using the already-vendored ruvector-core::quantization::BinaryQuantized (32× compression, NEON+POPCNT-accelerated, 1-bit sign quantization + hamming distance).

The pattern at every site:

dense embedding → RaBitQ sketch → hamming pre-filter → top-K → full precision refinement
                                                       └─→ novelty score → escalation gate

The decision boundary is unchanged at every site — full precision still owns the final answer. The sketch is a sensor that gates which comparisons run, not what they decide.

Five implementation passes (each independently testable)

  1. wifi-densepose-ruvector::sketch module — re-export BinaryQuantized with a thin RuView-flavored API (Sketch::from_embedding, SketchBank::topk, sketch_version: u16).
  2. AETHER re-ID hot-cache filter — sketch-prefilter to top-K before full 128-d cosine across active tracks × candidates.
  3. Cluster-Pi novelty sensor — per-room SketchBank of normal-state sketches; emit novelty_score on the WebSocket update envelope; CNN wake gate uses it.
  4. Mesh-exchange compression — inter-cluster broadcasts carry sketch + witness instead of full embedding when novelty is low (composes with ADR-066 swarm bridge).
  5. Privacy-preserving event log — log table stores (sketch_bytes, sketch_version, novelty_score, witness_sha256) instead of raw embeddings.

Acceptance test (per source proposal)

  • Sketch compare cost reduction: 8×–30× vs full float
  • Top-K candidate coverage: ≥ 90% agreement with full-float pass
  • End-to-end accuracy regression: < 1 percentage point

Site-by-site rollback if any criterion fails at a given site; remaining sites continue. Acceptance requires the numbers to hold on ≥ 3 of the 5 passes (the load-bearing ones: AETHER re-ID, cluster-Pi novelty, event log).

Composes with ADR-083

The cluster Pi (ADR-083 / PR #428) is the natural home for the sketch bank. Sensor MCU is unchanged by this ADR; sketches happen at the cluster Pi.

Status

Proposed — not committing to implementation. The ADR formalizes the pattern and the implementation home; actual implementation lands as five separate work items, gated by the acceptance numbers above.

Open question

Whether RuView embeddings need a Johnson-Lindenstrauss / RaBitQ-paper randomized rotation before sign-quantization (the published RaBitQ algorithm by Gao & Long, SIGMOD 2024 includes this for theoretical error bounds). Today's BinaryQuantized is pure 1-bit sign — works when embeddings are roughly zero-centered and isotropic. AETHER and CSI spectrogram embeddings need to be benchmarked for this; if either fails the assumption, the rotation pre-pass becomes load-bearing and warrants a follow-up ADR. Decided after pass-1 benchmark, not in this ADR.

Test plan

  • ADR references existing ADRs correctly (ADR-024, ADR-027, ADR-029, ADR-030, ADR-066, ADR-076, ADR-081, ADR-082, ADR-083)
  • Implementation home points to vendored ruvector-core::quantization::BinaryQuantized (already in tree)
  • All path references already on v2/ (rebased on top of chore(repo): rename rust-port/wifi-densepose-rs → v2/ (flatten to one level) #427's rename merge)
  • Reviewer accepts the five-site scope and acceptance criteria

🤖 Generated with claude-flow

…oposed)

Adopt RaBitQ-style binary sketches as a first-class cheap similarity
sensor at four points in the RuView pipeline: AETHER re-ID hot-cache
filter, per-room novelty / drift detection, mesh-exchange compression,
and privacy-preserving event logs. Implementation home is
ruvector-core::quantization::BinaryQuantized (already vendored, already
SIMD-accelerated NEON+POPCNT, 32x compression, 1-bit sign quantization
+ hamming distance), re-exported through a thin RuView-flavored API in
wifi-densepose-ruvector::sketch.

Pattern at every site: dense embedding -> RaBitQ sketch -> hamming
pre-filter to top-K -> full-precision refinement only on miss. Decision
boundary unchanged; sketch is a sensor that gates *which* comparisons
run, not *what* they decide.

Acceptance test (per source proposal):
- sketch compare cost reduction: 8x-30x vs full float
- top-K candidate coverage: >= 90% agreement with full-float pass
- end-to-end accuracy regression: < 1 percentage point

Site-by-site rollback if any criterion fails at a given site;
remaining sites continue. Five implementation passes, each
independently testable: ruvector module wrap, AETHER re-ID pre-filter,
cluster-Pi novelty sensor, mesh-exchange compression, privacy log.

Sensor MCU unchanged; sketches happen at the cluster Pi (ADR-083).
Validation requires acceptance numbers on >= 3 of 5 passes.

Open question (out-of-scope until pass-1 benchmark): whether RuView
embeddings need a Johnson-Lindenstrauss / RaBitQ-paper randomized
rotation before sign-quantization, or whether pure 1-bit sign
quantization (today's BinaryQuantized) is sufficient.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet merged commit c19a33e into main Apr 26, 2026
10 of 11 checks passed
@ruvnet ruvnet deleted the feat/adr-084-rabitq-similarity-sensor branch April 26, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant