Skip to main content

SamplerKind

Enum SamplerKind 

pub enum SamplerKind {
    Random,
    Sobol,
    Tpe,
    Gp,
    Cmaes,
    Auto,
}
Expand description

Which built-in sampler to run.

Variants§

§

Random

Uniform independent sampling — the baseline every other sampler must beat.

§

Sobol

The Sobol low-discrepancy (quasi-Monte-Carlo) sequence.

§

Tpe

The Tree-structured Parzen Estimator, the learning sampler.

§

Gp

The M6.2 in-house Gaussian-process sampler with the numerically stable logEI acquisition (GpEi, the facade’s gp feature).

§

Cmaes

The M4.3 in-house CMA-ES sampler (Cmaes, the facade’s cmaes feature) — the continuous specialist whose adapted covariance handles ill-conditioned, rotated valleys.

§

Auto

The M6.7 rule-based picker: the sampler atune::auto_sampler() chooses for the study’s shape and budget.

Not a sampler but a decision, so unlike every other kind it needs context — see build_for.

§It can resolve to a sampler this enum does not name

Rule 3 picks Grid on a finite space of at most 256 points the declared budget can enumerate, and rule 1 picks Nsga2 on a multi-objective study (see the module docs). Grid is the consequential one: it reports SpaceExhausted once it has handed out every point, which atune’s own study loop treats as a normal stop but kurobako has no message for. The adapter therefore substitutes uniform Random for the rest of that study rather than fail the whole benchmark run, so an atune-auto score on a small finite domain can be a mixture of auto’s pick and random search — the kurobako module docs record the trade-off and the stderr line that announces it.

Implementations§

§

impl SamplerKind

pub const ALL: [Self; 3]

The gate kinds, in a fixed order — the M2.3 quality matrix.

The quality oracle iterates exactly this array and the pinned TPE baseline golden is measured over it, so its contents are part of what the gate asserts. New kinds go in FRONTIER, never here; use ALL_KINDS to iterate everything.

pub const FRONTIER: [Self; 3]

The frontier kinds, in a fixed order — the M6 arms reachable from atune-solver --sampler but outside the in-tree quality gate (see the module docs for why).

pub const ALL_KINDS: [Self; 6]

Every kind, gate arms first then frontier arms — the exhaustive list, for a caller that wants all of them (label round-trips, CLI help, a construction smoke test).

Deliberately not ALL: that array’s contents are the M2.3 gate’s contract, and widening it would quietly change what the gate measures.

pub const fn label(self) -> &'static str

The lowercase flag label (random, sobol, tpe, gp, cmaes, auto).

pub fn parse(label: &str) -> Result<Self, String>

Parses a flag label, accepting qmc as an alias of sobol.

§Errors

Returns the unrecognized label so a caller can report it.

pub fn build(self) -> Arc<dyn Sampler> ⓘ

Builds a fresh boxed sampler of this kind, without a study context.

Every kind except Auto is a fixed sampler, so this is the whole answer. Auto is a function of the study’s shape and budget, which this signature cannot supply; rather than invent a second rule ladder it asks atune::auto_sampler() about the degenerate study — an empty space, an unbounded budget — whose documented answer is uniform Random. Any caller that knows the space (the kurobako adapter does, from the problem’s parameter domain) must use build_for instead, or auto silently degrades to the baseline.

pub fn build_for( self, space: &SpaceSchema, budget: &Budget, directions: &[Direction], ) -> Arc<dyn Sampler> ⓘ

Builds a fresh boxed sampler of this kind for a study of this shape.

Only Auto reads the arguments — it is exactly atune::auto_sampler(), whose pick is a pure function of (space, budget, directions) with no RNG or ambient state (docs/design/09-implementation.md §5). Every other kind names its sampler outright and ignores them, so passing an approximate budget costs nothing except an auto pick.

Trait Implementations§

§

impl Clone for SamplerKind

§

fn clone(&self) -> SamplerKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Copy for SamplerKind

§

impl Debug for SamplerKind

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Eq for SamplerKind

§

impl PartialEq for SamplerKind

§

fn eq(&self, other: &SamplerKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl StructuralPartialEq for SamplerKind

Auto Trait Implementations§

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
§

impl<T> Boilerplate for T
where T: Copy + Send + Sync + Debug + PartialEq + 'static,

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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more