Expand description
Core operations and algorithms for native graph backend.
§INLINE HINT STRATEGY (Phase 13 Step 5)
§Tier A: Tiny Hot Path Functions (#[inline(always)])
estimate_graph_size_category(): Simple match statement for BFS dispatchselect_bfs_strategy(): Strategy selection logic called for every BFS
§Tier B: Small Helper Functions (#[inline] or compiler-driven)
- Public API functions: Moderate complexity but good inline candidates
§Tier C: Large Functions (no inline hints)
- BFS implementations: Large algorithms left to compiler discretion
native_shortest_path(),native_k_hop(): Complex algorithms
§Modular Architecture
strategy.rs: CPU profiling and graph size categorizationbfs_implementations.rs: Multiple BFS implementations with optimizationspathfinding.rs: Shortest path algorithms using BFSk_hop.rs: K-hop neighbor exploration operationschain_queries.rs: Chain traversal and pattern matchingcache.rs: Per-traversal adjacency cache for eliminating redundant I/Otests.rs: Comprehensive test suite
Re-exports§
pub use crate::backend::native::adjacency::LinearDetector;pub use crate::backend::native::adjacency::TraversalPattern;
Structs§
- Traversal
Cache Stats - Cache statistics for tracking hit/miss rates during traversal.
- Traversal
Context - Per-traversal context for optimized I/O
Functions§
- bfs_
fully_ optimized - Fully optimized BFS with pointer table and hot cache (small graphs, high-end CPUs)
- bfs_
generic_ scalar - Generic scalar BFS implementation (baseline for all CPUs/large graphs)
- bfs_
pointer_ table_ optimized - Optimized BFS with pointer table (medium graphs, SIMD-capable CPUs)
- estimate_
graph_ size_ category - Estimate graph size category for optimization selection
- get_
neighbors_ cached - Get neighbors for a node with per-traversal caching.
- get_
neighbors_ optimized - Get neighbors with 3-tier lookup hierarchy for sequential I/O optimization.
- native_
bfs - Native BFS implementation using adjacency helpers
- native_
bfs_ with_ cpu_ profile - Native BFS implementation with explicit CPU profile
- native_
bfs_ with_ telemetry - Native BFS implementation with telemetry export for diagnostic analysis
- native_
chain_ query - Native chain query implementation
- native_
k_ hop - Native k-hop implementation
- native_
k_ hop_ filtered - Native k-hop implementation with edge type filtering
- native_
pattern_ search - Native pattern search implementation (basic version)
- native_
shortest_ path - Native shortest path implementation using BFS
- select_
bfs_ strategy - Select optimal BFS strategy based on CPU profile and graph size
Type Aliases§
- Traversal
Cache - Per-traversal cache for node adjacency data.