Feature flags and execution strategies

Updated Sep 01, 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.

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