mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-30 03:53:34 +00:00
|
Some checks failed
Benchmarks / Rust Benchmarks (push) Waiting to run
Benchmarks / SQL Benchmarks (push) Waiting to run
Benchmarks / Compare with Baseline (push) Blocked by required conditions
Build Graph Node Native Modules / Build Graph darwin-arm64 (push) Waiting to run
Build Graph Node Native Modules / Build Graph darwin-x64 (push) Waiting to run
Build Graph Node Native Modules / Build Graph linux-arm64-gnu (push) Waiting to run
Build Graph Node Native Modules / Build Graph linux-x64-gnu (push) Waiting to run
Build Graph Node Native Modules / Build Graph win32-x64-msvc (push) Waiting to run
Build Graph Node Native Modules / Publish Graph Node Platform Packages (push) Blocked by required conditions
Build Native Modules / Build darwin-arm64 (push) Waiting to run
Build Native Modules / Build linux-arm64-gnu (push) Waiting to run
Build Native Modules / Build darwin-x64 (push) Waiting to run
Build Native Modules / Build win32-x64-msvc (push) Waiting to run
Build Native Modules / Build linux-x64-gnu (push) Waiting to run
Build Native Modules / Commit Built Binaries (push) Blocked by required conditions
ruvector-verified CI / bench (push) Blocked by required conditions
ruvector-verified CI / clippy (push) Waiting to run
ruvector-verified CI / check (--features hnsw-proofs) (push) Waiting to run
ruvector-verified CI / check (--features rvf-proofs) (push) Waiting to run
ruvector-verified CI / check (--features serde) (push) Waiting to run
ruvector-verified CI / check (--features ultra) (push) Waiting to run
ruvector-verified CI / test (push) Blocked by required conditions
ruvector-verified CI / check () (push) Waiting to run
ruvector-verified CI / check (--all-features) (push) Waiting to run
ruvector-verified CI / check (--features all-proofs) (push) Waiting to run
ruvector-verified CI / check (--features coherence-proofs) (push) Waiting to run
Workspace CI / Rustfmt (push) Waiting to run
Workspace CI / Cargo check (push) Waiting to run
Workspace CI / Clippy (push) Waiting to run
Workspace CI / Tests (push) Waiting to run
Workspace CI / Security audit (push) Waiting to run
Clippy + fmt / Clippy (deny warnings) (push) Waiting to run
Clippy + fmt / Rustfmt (push) Waiting to run
RuvLLM Benchmarks / Linux Benchmarks (NEON baseline) (push) Waiting to run
RuvLLM Benchmarks / Compare Benchmarks (push) Blocked by required conditions
RuvLLM Benchmarks / macOS ARM64 Benchmarks (M-series) (push) Waiting to run
RuvLTRA-Small Tests / Unit Tests (ubuntu-latest) (push) Waiting to run
RuvLTRA-Small Tests / Unit Tests (windows-latest) (push) Waiting to run
RuvLTRA-Small Tests / Unit Tests (macos-latest) (push) Waiting to run
RuvLTRA-Small Tests / E2E Tests (macos-latest) (push) Waiting to run
RuvLTRA-Small Tests / E2E Tests (ubuntu-latest) (push) Waiting to run
RuvLTRA-Small Tests / Apple Silicon Tests (push) Waiting to run
RuvLTRA-Small Tests / Quantization Accuracy (push) Waiting to run
RuvLTRA-Small Tests / Test Coverage (push) Waiting to run
RuvLTRA-Small Tests / Test Summary (push) Blocked by required conditions
RuvLTRA-Small Tests / Thread Safety (push) Waiting to run
RuvLTRA-Small Tests / Performance Benchmarks (push) Waiting to run
RuvLTRA-Small Tests / Stress Tests (push) Waiting to run
RuvLTRA-Small Tests / Code Quality (push) Waiting to run
WASM Dedup Check / check-wasm-dedup (push) Waiting to run
Build Attention Native Modules / Build darwin-arm64 (push) Has been cancelled
Build Attention Native Modules / Build darwin-x64 (push) Has been cancelled
Build Attention Native Modules / Build linux-arm64-gnu (push) Has been cancelled
Build Attention Native Modules / Build linux-x64-gnu (push) Has been cancelled
Build Attention Native Modules / Build win32-x64-msvc (push) Has been cancelled
Build Attention Native Modules / Build WASM (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN darwin-arm64 (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN darwin-x64 (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN linux-arm64-gnu (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN linux-x64-gnu (push) Has been cancelled
Build DiskANN Native Modules / Build DiskANN win32-x64-msvc (push) Has been cancelled
Build GNN Native Modules / Build GNN darwin-arm64 (push) Has been cancelled
Build GNN Native Modules / Build GNN darwin-x64 (push) Has been cancelled
Build GNN Native Modules / Build GNN linux-arm64-gnu (push) Has been cancelled
Build GNN Native Modules / Build GNN linux-arm64-musl (push) Has been cancelled
Build GNN Native Modules / Build GNN linux-x64-gnu (push) Has been cancelled
Build GNN Native Modules / Build GNN linux-x64-musl (push) Has been cancelled
Build GNN Native Modules / Build GNN win32-x64-msvc (push) Has been cancelled
Build Graph Transformer Native Modules / Build darwin-arm64 (push) Has been cancelled
Build Graph Transformer Native Modules / Build darwin-x64 (push) Has been cancelled
Build Graph Transformer Native Modules / Build linux-arm64-gnu (push) Has been cancelled
Build Graph Transformer Native Modules / Build linux-arm64-musl (push) Has been cancelled
Build Graph Transformer Native Modules / Build linux-x64-gnu (push) Has been cancelled
Build Graph Transformer Native Modules / Build linux-x64-musl (push) Has been cancelled
Build Graph Transformer Native Modules / Build win32-x64-msvc (push) Has been cancelled
Build Graph Transformer Native Modules / Build WASM (push) Has been cancelled
Build Router Native Modules / Build Router darwin-arm64 (push) Has been cancelled
Build Router Native Modules / Build Router darwin-x64 (push) Has been cancelled
Build Router Native Modules / Build Router linux-arm64-gnu (push) Has been cancelled
Build Router Native Modules / Build Router linux-x64-gnu (push) Has been cancelled
Build Router Native Modules / Build Router win32-x64-msvc (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer darwin-arm64 (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer darwin-x64 (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer linux-arm64-gnu (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer linux-x64-gnu (push) Has been cancelled
Build Tiny Dancer Native Modules / Build Tiny Dancer win32-x64-msvc (push) Has been cancelled
thermorust CI / Test (macos-latest) (push) Has been cancelled
thermorust CI / Test (ubuntu-latest) (push) Has been cancelled
thermorust CI / Test (windows-latest) (push) Has been cancelled
thermorust CI / Benchmarks compile (push) Has been cancelled
Build Attention Native Modules / Commit Built Binaries (push) Has been cancelled
Build Attention Native Modules / Publish Attention Platform Packages (push) Has been cancelled
Build DiskANN Native Modules / Publish DiskANN Platform Packages (push) Has been cancelled
Build GNN Native Modules / Commit Built GNN Binaries (push) Has been cancelled
Build GNN Native Modules / Publish GNN Platform Packages (push) Has been cancelled
Build Graph Transformer Native Modules / Commit Built Binaries (push) Has been cancelled
Build Graph Transformer Native Modules / Publish Platform Packages (push) Has been cancelled
Build Router Native Modules / Publish Router Platform Packages (push) Has been cancelled
Build Tiny Dancer Native Modules / Publish Tiny Dancer Platform Packages (push) Has been cancelled
Built from commit
|
||
|---|---|---|
| .. | ||
| package.json | ||
| README.md | ||
| ruvector_graph_transformer_wasm.d.ts | ||
| ruvector_graph_transformer_wasm.js | ||
| ruvector_graph_transformer_wasm_bg.wasm | ||
| ruvector_graph_transformer_wasm_bg.wasm.d.ts | ||
ruvector-graph-transformer-wasm
WebAssembly bindings for RuVector Graph Transformer — proof-gated graph attention, verified training, and 8 specialized graph layers running client-side in the browser.
Run the full graph transformer in any browser tab — no server, no API calls, no data leaving the device. Every graph mutation is formally verified client-side, so your users get the same mathematical safety guarantees as the Rust version. The WASM binary is size-optimized and loads in milliseconds.
Install
# With wasm-pack (recommended)
wasm-pack build crates/ruvector-graph-transformer-wasm --target web
# Or from npm (when published)
npm install ruvector-graph-transformer-wasm
Quick Start
import init, { JsGraphTransformer } from "ruvector-graph-transformer-wasm";
await init();
const gt = new JsGraphTransformer();
console.log(gt.version()); // "2.0.4"
// Proof-gated mutation
const gate = gt.create_proof_gate(128);
const proof = gt.prove_dimension(128, 128);
console.log(proof.verified); // true
// 82-byte attestation for RVF witness chains
const attestation = gt.create_attestation(proof.proof_id);
console.log(attestation.length); // 82
// Sublinear attention — O(n log n)
const result = gt.sublinear_attention(
new Float32Array([0.1, 0.2, 0.3, 0.4]),
[{ src: 0, tgt: 1 }, { src: 0, tgt: 2 }],
4, 2
);
// Verified training step with certificate
const step = gt.verified_training_step(
[1.0, 2.0], [0.1, 0.2], 0.01
);
console.log(step.weights, step.certificate);
// Physics: symplectic integration
const state = gt.hamiltonian_step([1.0, 0.0], [0.0, 1.0], 0.01);
console.log(state.energy);
// Biological: spiking attention
const spikes = gt.spiking_attention(
[0.5, 1.5, 0.3], [[1], [0, 2], [1]], 1.0
);
// Manifold: mixed-curvature distance
const d = gt.product_manifold_distance(
[1, 0, 0, 1], [0, 1, 1, 0], [0.0, -1.0]
);
// Temporal: causal masking
const scores = gt.causal_attention(
[1.0, 0.0],
[[1.0, 0.0], [0.0, 1.0]],
[1.0, 2.0]
);
// Economic: Nash equilibrium
const nash = gt.game_theoretic_attention(
[1.0, 0.5, 0.8],
[{ src: 0, tgt: 1 }, { src: 1, tgt: 2 }]
);
console.log(nash.converged);
// Stats
console.log(gt.stats());
API
Proof-Gated Operations
| Method | Returns | Description |
|---|---|---|
new JsGraphTransformer(config?) |
JsGraphTransformer |
Create transformer instance |
version() |
string |
Crate version |
create_proof_gate(dim) |
object |
Create proof gate for dimension |
prove_dimension(expected, actual) |
object |
Prove dimension equality |
create_attestation(proof_id) |
Uint8Array |
82-byte proof attestation |
verify_attestation(bytes) |
boolean |
Verify attestation from bytes |
compose_proofs(stages) |
object |
Type-checked pipeline composition |
Sublinear Attention
| Method | Returns | Description |
|---|---|---|
sublinear_attention(q, edges, dim, k) |
object |
Graph-sparse top-k attention |
ppr_scores(source, adj, alpha) |
Float64Array |
Personalized PageRank scores |
Physics-Informed
| Method | Returns | Description |
|---|---|---|
hamiltonian_step(positions, momenta, dt) |
object |
Symplectic leapfrog step |
verify_energy_conservation(before, after, tol) |
object |
Energy conservation proof |
Biological
| Method | Returns | Description |
|---|---|---|
spiking_attention(spikes, edges, threshold) |
Float64Array |
Event-driven spiking attention |
hebbian_update(pre, post, weights, lr) |
Float64Array |
Hebbian weight update |
spiking_step(features, adjacency) |
object |
Full spiking step over feature matrix |
Verified Training
| Method | Returns | Description |
|---|---|---|
verified_step(weights, gradients, lr) |
object |
SGD step + proof receipt |
verified_training_step(features, targets, weights) |
object |
Training step + certificate |
Manifold
| Method | Returns | Description |
|---|---|---|
product_manifold_distance(a, b, curvatures) |
number |
Mixed-curvature distance |
product_manifold_attention(features, edges) |
object |
Product manifold attention |
Temporal-Causal
| Method | Returns | Description |
|---|---|---|
causal_attention(query, keys, timestamps) |
Float64Array |
Temporally masked attention |
causal_attention_graph(features, timestamps, edges) |
Float64Array |
Causal graph attention |
granger_extract(history, num_nodes, num_steps) |
object |
Granger causality DAG |
Economic
| Method | Returns | Description |
|---|---|---|
game_theoretic_attention(features, edges) |
object |
Nash equilibrium attention |
Meta
| Method | Returns | Description |
|---|---|---|
stats() |
object |
Aggregate proof/attestation statistics |
reset() |
void |
Reset all internal state |
Building
# Web target (recommended for browsers)
wasm-pack build crates/ruvector-graph-transformer-wasm --target web
# Node.js target
wasm-pack build crates/ruvector-graph-transformer-wasm --target nodejs
# Cargo check
cargo check -p ruvector-graph-transformer-wasm
Bundle Size
The WASM binary is optimized for size with opt-level = "s", LTO, and single codegen unit.
Related Packages
| Package | Description |
|---|---|
ruvector-graph-transformer |
Core Rust crate (186 tests) |
@ruvector/graph-transformer |
Node.js NAPI-RS bindings |
ruvector-verified-wasm |
Formal verification WASM bindings |
License
MIT