Skip to main content

Module ssd_rerank

Module ssd_rerank 

Source
Expand description

§SSD Rerank Executor with IO Coalescing (Task 8)

Provides efficient hybrid RAM+SSD reranking with:

  • IO coalescing for locality
  • Strict IO budget enforcement
  • Tail-latency guardrails

§Architecture

  1. Map candidate IDs to disk offsets
  2. Sort offsets and coalesce into minimal IO ranges
  3. Enforce IO budget and stop early if needed
  4. Cache admission for hot vectors

§Math/Algorithm

Coalescing: O(R log R) sort + O(R) interval merge Tail guardrails: online control via capped outstanding IO ops

§Usage

use sochdb_vector::ssd_rerank::{RerankExecutor, RerankConfig, RerankRequest};

let config = RerankConfig::default()
    .io_budget(100)
    .coalesce_threshold(4096);

let executor = RerankExecutor::new(config, storage);
let results = executor.rerank(&candidates, &query);

Structs§

CoalesceStats
Coalescing statistics
IoCoalescer
Coalesces random reads into sequential ranges
IoRange
A coalesced IO range
MockStorage
Mock storage for testing
RerankCandidate
A candidate for reranking
RerankConfig
Configuration for SSD rerank executor
RerankExecutor
Executes SSD-based reranking with IO coalescing
RerankResult
Result from reranking
RerankStats
Statistics from rerank execution
VectorCache
Simple LRU cache for hot vectors

Type Aliases§

DistanceFn
Distance function type
StorageReader
Storage reader type