Skip to main content

IndexSampler

Struct IndexSampler 

Source
pub struct IndexSampler<'a, Cfg: EGraphConfig, L: LitVal, const TRACK: bool, const PROOFS: bool> { /* private fields */ }
Expand description

CrossSampler over one round’s indices: the implementation the scheduler gets its samples from.

Emitter draws come from the slice the atom’s semi-naive mode reads, which is the relation it will actually enumerate. Probe buckets come from the full index in every mode, matching FanOuts, which the full build measures and every variant prices against: a variant’s delta shows up in the atom’s base cardinality, and applying it again to the probe would charge it twice.

Implementations§

Source§

impl<'a, Cfg: EGraphConfig, L: LitVal, const TRACK: bool, const PROOFS: bool> IndexSampler<'a, Cfg, L, TRACK, PROOFS>
where MSetCanon: VarCanon<Cfg::G, Cfg::C>,

Source

pub fn new( eg: &'a EGraph<Cfg, L, TRACK, PROOFS>, index: VariantIndex<'a, Cfg>, ) -> Self

Trait Implementations§

Source§

impl<Cfg: EGraphConfig, L: LitVal, const TRACK: bool, const PROOFS: bool> CrossSampler<<Cfg as EGraphConfig>::O> for IndexSampler<'_, Cfg, L, TRACK, PROOFS>
where MSetCanon: VarCanon<Cfg::G, Cfg::C>,

Source§

fn driver_sample( &self, atom_id: usize, op: Cfg::O, k: usize, out: &mut Vec<usize>, )

Up to k node ids of the slice atom atom_id will enumerate, in ascending id order. Read more
Source§

fn key_classes(&self, node: usize, site: KeySite, out: &mut Vec<usize>)

The classes a variable bound at site takes for emitter node node. One class for KeySite::Node and KeySite::Child; for KeySite::Element, every distinct class among the node’s children.
Source§

fn probe_len(&self, class: usize, path: ProbePath, op: Cfg::O) -> usize

Nodes of operator op in the bucket path selects for class — the candidate count the join’s intersection with by_op[op] can propose.

Auto Trait Implementations§

§

impl<'a, Cfg, L, const TRACK: bool, const PROOFS: bool> Freeze for IndexSampler<'a, Cfg, L, TRACK, PROOFS>
where &'a EGraph<Cfg, L, TRACK, PROOFS>: Freeze, VariantIndex<'a, Cfg>: Freeze,

§

impl<'a, Cfg, L, const TRACK: bool, const PROOFS: bool> RefUnwindSafe for IndexSampler<'a, Cfg, L, TRACK, PROOFS>
where &'a EGraph<Cfg, L, TRACK, PROOFS>: RefUnwindSafe, VariantIndex<'a, Cfg>: RefUnwindSafe,

§

impl<'a, Cfg, L, const TRACK: bool, const PROOFS: bool> Send for IndexSampler<'a, Cfg, L, TRACK, PROOFS>
where &'a EGraph<Cfg, L, TRACK, PROOFS>: Send, VariantIndex<'a, Cfg>: Send,

§

impl<'a, Cfg, L, const TRACK: bool, const PROOFS: bool> Sync for IndexSampler<'a, Cfg, L, TRACK, PROOFS>
where &'a EGraph<Cfg, L, TRACK, PROOFS>: Sync, VariantIndex<'a, Cfg>: Sync,

§

impl<'a, Cfg, L, const TRACK: bool, const PROOFS: bool> Unpin for IndexSampler<'a, Cfg, L, TRACK, PROOFS>
where &'a EGraph<Cfg, L, TRACK, PROOFS>: Unpin, VariantIndex<'a, Cfg>: Unpin,

§

impl<'a, Cfg, L, const TRACK: bool, const PROOFS: bool> UnsafeUnpin for IndexSampler<'a, Cfg, L, TRACK, PROOFS>
where &'a EGraph<Cfg, L, TRACK, PROOFS>: UnsafeUnpin, VariantIndex<'a, Cfg>: UnsafeUnpin,

§

impl<'a, Cfg, L, const TRACK: bool, const PROOFS: bool> UnwindSafe for IndexSampler<'a, Cfg, L, TRACK, PROOFS>
where &'a EGraph<Cfg, L, TRACK, PROOFS>: UnwindSafe, VariantIndex<'a, Cfg>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.