pub struct SearchKnobs {
pub prefetch: u8,
pub batch_est: bool,
pub frontier: f32,
pub block_screen: bool,
}Expand description
Runtime knobs of the search loop, each off by default so that the results are those of the
plain search. VGraph::searcher reads them once per process from the environment
(SearchKnobs::from_env); VGraph::searcher_with takes them explicitly.
Mechanisms, and what they may change:
prefetch(HMS_QGRAPH_PREFETCH, 0..=3, results never change): 0 prefetches the next candidate’s neighbour list and the code row of every admitted neighbour; 1 adds the admitted neighbours’ scales and the rows the re-rank reads; 2 adds the neighbour list of the second-nearest unexpanded candidate; 3 adds a lookahead that, after an expansion, prefetches the code rows (or screen rows) of the next candidate’s unvisited neighbours.batch_est(HMS_QGRAPH_BATCH_EST, results never change): the admitted neighbours’ 4-bit rows are estimated four at a time with shared query loads (dot_i4_inline_x4in the kernels module); the integer sums are the same.frontier(HMS_QGRAPH_FRONTIER,0.0..=1.0, 1.0 = off): with a full pool, stop when the nearest unexpanded estimate is past the pointfrontierof the way from thek-th best to theef-th best. Fewer expansions, so lower recall at a givenef; the recall/QPS curve overefis what to compare.block_screen(HMS_QGRAPH_BLOCK_SCREEN, needsVGraph::with_blocks): the neighbour block screens instead of ordering; survivors fetch their code row and the pool holds row estimates, as in the plain search. A fresh neighbour is skipped when its block estimate, improved byscreen_sigmasdeviations of the calibrated edge error, could not enter the full pool. Off, the block search is the existing one.
Fields§
§prefetch: u8Prefetch depth, 0 to 3 (values above 3 act as 3).
batch_est: boolEstimate admitted neighbours four rows at a time.
frontier: f32Frontier stop fraction in 0.0..=1.0; 1.0 (or a non-finite value) is off.
block_screen: boolScreen with the neighbour blocks and estimate survivors from their rows.
Implementations§
Source§impl SearchKnobs
impl SearchKnobs
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
The knobs set in the environment, read once per process; unset or invalid values
(reported once) take the SearchKnobs::OFF value.
Trait Implementations§
Source§impl Clone for SearchKnobs
impl Clone for SearchKnobs
Source§fn clone(&self) -> SearchKnobs
fn clone(&self) -> SearchKnobs
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SearchKnobs
Source§impl Debug for SearchKnobs
impl Debug for SearchKnobs
Source§impl Default for SearchKnobs
impl Default for SearchKnobs
Source§impl PartialEq for SearchKnobs
impl PartialEq for SearchKnobs
impl StructuralPartialEq for SearchKnobs
Auto Trait Implementations§
impl Freeze for SearchKnobs
impl RefUnwindSafe for SearchKnobs
impl Send for SearchKnobs
impl Sync for SearchKnobs
impl Unpin for SearchKnobs
impl UnsafeUnpin for SearchKnobs
impl UnwindSafe for SearchKnobs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.