Feature flags and execution strategies

Updated Sep 20, 2026

The crate exposes the following feature flags:

  • cpu includes the CPU backend in the default feature set.
  • metrics exposes metrics emission from hot paths.
  • gpu prepares the GPU execution path selection surface (the accelerator implementation is not yet available).
  • skeleton is a legacy compatibility flag retained for early versions; it is no longer required by the CPU backend.

When the metrics feature is enabled, the distance cache emits four metrics: distance_cache_hits counts successful lookups, distance_cache_misses counts lookups that require computation, and distance_cache_evictions counts LRU entries removed from the cache. distance_cache_lookup_latency_histogram records lookup latency for both hits and completed misses.

The HNSW reconciliation path also emits two counters when the metrics feature is enabled. chutoro.hnsw.reconciliation.healed_nodes_total counts nodes that removed-edge reconciliation isolated at the base layer and that were re-linked to the entry node. chutoro.hnsw.reconciliation.orphan_scrubs_total increments once for each deferred scrub that removes an orphaned forward edge; its layer label is base for base-layer scrubs and upper for upper-layer scrubs.

Choose an ExecutionStrategy that matches the compiled features. Allowing Auto keeps behaviour stable across builds while seamlessly adopting GPU support when available.