Skip to main content

Module graph_ops

Module graph_ops 

Source
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 dispatch
  • select_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 categorization
  • bfs_implementations.rs: Multiple BFS implementations with optimizations
  • pathfinding.rs: Shortest path algorithms using BFS
  • k_hop.rs: K-hop neighbor exploration operations
  • chain_queries.rs: Chain traversal and pattern matching
  • cache.rs: Per-traversal adjacency cache for eliminating redundant I/O
  • tests.rs: Comprehensive test suite

Re-exports§

pub use crate::backend::native::adjacency::LinearDetector;
pub use crate::backend::native::adjacency::TraversalPattern;

Structs§

TraversalCacheStats
Cache statistics for tracking hit/miss rates during traversal.
TraversalContext
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§

TraversalCache
Per-traversal cache for node adjacency data.