Skip to content

Commit 5254595

Browse files
committed
feat: Add attention pipeline, query engine, runtime, layers, benchmarks, and embedding search
- Add four-level attention pipeline (view/temporal/semantic/write) per ADR-021 - Add query-first rendering engine with SceneQuery/QueryResult per ADR-022 - Add three-cadence loop scheduler (fast 60Hz, medium 5Hz, slow 0.5Hz) per ADR-019 - Add static/dynamic layer separation with automatic Gaussian classification - Add cosine-similarity embedding search (search_by_embedding, top_k_by_embedding) to EntityGraph - Add Criterion benchmark suite (20 benchmarks across 8 groups: gaussian, tile, draw_list, coherence, entity, mask, streaming, sort) - Add performance acceptance tests - Implement WASM integration path in viewer (coherence gate, entity graph, active mask, draw list) - 177 tests passing, clippy clean, zero dependencies in core crate https://claude.ai/code/session_012MQauGiqSnQbszfmFKpsNT
1 parent 9fc0db0 commit 5254595

17 files changed

Lines changed: 3544 additions & 41 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ruvector-vwm-wasm/src/lib.rs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,12 @@ pub struct WasmCoherenceGate {
329329
inner: CoherenceGate,
330330
}
331331

332+
impl Default for WasmCoherenceGate {
333+
fn default() -> Self {
334+
Self::new()
335+
}
336+
}
337+
332338
#[wasm_bindgen]
333339
impl WasmCoherenceGate {
334340
/// Create a gate with the default policy.
@@ -403,6 +409,12 @@ pub struct WasmEntityGraph {
403409
inner: EntityGraph,
404410
}
405411

412+
impl Default for WasmEntityGraph {
413+
fn default() -> Self {
414+
Self::new()
415+
}
416+
}
417+
406418
#[wasm_bindgen]
407419
impl WasmEntityGraph {
408420
/// Create an empty entity graph.
@@ -607,6 +619,12 @@ pub struct WasmLineageLog {
607619
inner: LineageLog,
608620
}
609621

622+
impl Default for WasmLineageLog {
623+
fn default() -> Self {
624+
Self::new()
625+
}
626+
}
627+
610628
#[wasm_bindgen]
611629
impl WasmLineageLog {
612630
/// Create an empty lineage log.
@@ -680,16 +698,22 @@ impl WasmLineageLog {
680698
pub fn len(&self) -> usize {
681699
self.inner.len()
682700
}
701+
702+
/// Check if the log is empty.
703+
#[wasm_bindgen(js_name = isEmpty)]
704+
pub fn is_empty(&self) -> bool {
705+
self.inner.is_empty()
706+
}
683707
}
684708

685709
fn make_provenance(source_type: &str, confidence: f32) -> Provenance {
686-
let source = if source_type.starts_with("sensor:") {
710+
let source = if let Some(stripped) = source_type.strip_prefix("sensor:") {
687711
ProvenanceSource::Sensor {
688-
sensor_id: source_type[7..].to_string(),
712+
sensor_id: stripped.to_string(),
689713
}
690-
} else if source_type.starts_with("model:") {
714+
} else if let Some(stripped) = source_type.strip_prefix("model:") {
691715
ProvenanceSource::Inference {
692-
model_id: source_type[6..].to_string(),
716+
model_id: stripped.to_string(),
693717
}
694718
} else if source_type == "manual" {
695719
ProvenanceSource::Manual {

crates/ruvector-vwm/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,12 @@ default = []
1313
simd = []
1414
ffi = []
1515

16+
[dev-dependencies]
17+
criterion = { workspace = true }
18+
1619
[lib]
1720
crate-type = ["lib"]
21+
22+
[[bench]]
23+
name = "vwm_bench"
24+
harness = false

0 commit comments

Comments
 (0)