pub enum SamplingStrategy {
Exhaustive {
max_depth: usize,
},
Random {
seed: u64,
count: usize,
},
CoverageGuided {
coverage_map: Option<CoverageMap>,
max_depth: usize,
seed: u64,
},
Swarm {
features_per_batch: usize,
},
Boundary {
boundary_probability: f64,
},
}Expand description
Sampling strategy for code generation
From spec Section 4.2: Different strategies for exploring the program space.
Variants§
Exhaustive
Exhaustive enumeration up to depth N
Systematically enumerate all valid programs up to the specified AST depth. Best for small grammars or low depths.
Random
Random sampling with grammar weights
Generate random programs using production rule weights.
CoverageGuided
Coverage-guided generation (NAUTILUS-style)
Prioritize unexplored AST paths based on coverage feedback. From Aschermann et al. (2019) NAUTILUS.
Fields
coverage_map: Option<CoverageMap>Optional initial coverage map to guide generation
Swarm
Swarm testing (random feature subsets per batch)
Generate programs using random subsets of language features. Implements Heijunka (leveling) for balanced coverage.
Boundary
Boundary-focused sampling
Emphasize edge values (0, -1, MAX_INT, empty collections, etc.).
Trait Implementations§
Source§impl Clone for SamplingStrategy
impl Clone for SamplingStrategy
Source§fn clone(&self) -> SamplingStrategy
fn clone(&self) -> SamplingStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SamplingStrategy
impl Debug for SamplingStrategy
Auto Trait Implementations§
impl Freeze for SamplingStrategy
impl RefUnwindSafe for SamplingStrategy
impl Send for SamplingStrategy
impl Sync for SamplingStrategy
impl Unpin for SamplingStrategy
impl UnsafeUnpin for SamplingStrategy
impl UnwindSafe for SamplingStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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