Skip to main content

Crate graph_core

Crate graph_core 

Source
Expand description

Shared graph kernels for Mnemosyne.

This crate is reusable between the native PyO3 crate (mnemosyne_rs) and the forthcoming graph_wasm sub-crate (Wave 2 of Phase 223). It contains:

  • util — runtime-dispatched AVX2+FMA dot products. Moved here from mnemosyne_rs::util so both surfaces can share one SIMD implementation.
  • force — Barnes-Hut 2D force simulation (Simulation, SimulationConfig).
  • viewport — R-tree viewport spatial index with lazy incremental updates (ViewportIndex, IndexPoint, ScoreKey).

§Features

  • native (default) — enables rayon. Intended for the host-side PyO3 crate and any integration tests that want parallelism.
  • wasm — opts out of rayon and any other host-only deps. The WASM sub-crate sets default-features = false, features = ["wasm"].

Rayon is optional because the Wave 1 force simulation is single- threaded (see the note in force.rs); the feature flag reserves the parallel code path for when we need it.

Re-exports§

pub use force::Simulation;
pub use force::SimulationConfig;
pub use viewport::IndexPoint;
pub use viewport::ScoreKey;
pub use viewport::ViewportIndex;

Modules§

force
Barnes-Hut 2D force simulation.
force_3d
Barnes-Hut 3D force simulation internals — Phase 224 Wave 2.
util
Shared SIMD utility helpers for the graph kernels.
viewport
R-tree viewport spatial index.

Structs§

Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.