Skip to main content

Module node_fetcher

Module node_fetcher 

Source
Expand description

NodeFetcher trait — abstracts in-memory vs io_uring-backed FP32 vector retrieval for Vamana beam-search and rerank.

The trait is intentionally not Send + Sync so that IoUringNodeFetcher (Data Plane, !Send) can implement it without wrapping in Arc<Mutex<…>>. The InMemoryFetcher impl is Send + Sync (plain memory slice), but the trait bound is left absent to keep the interface Data-Plane-compatible.

§Pre-fetch contract

prefetch_batch submits I/O for a set of node indices before compute touches them. On the in-memory path this is a no-op. On the io_uring path it issues IORING_OP_READ SQEs in parallel; fetch_fp32 then collects completions. This satisfies the TPC Page Fault Hazard rule: pages are pre-warmed asynchronously so the reactor thread never blocks on a major fault.

Structs§

InMemoryFetcher
In-memory NodeFetcher backed by a contiguous Vec<Vec<f32>>.

Traits§

NodeFetcher
Abstraction over FP32 vector storage for a Vamana index partition.