Struct libafl::schedulers::minimizer::MinimizerScheduler
source · [−]pub struct MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata, { /* private fields */ }
Expand description
The MinimizerScheduler
employs a genetic algorithm to compute a subset of the
corpus that exercise all the requested features (e.g. all the coverage seen so far)
prioritizing Testcase
s
using TestcaseScore
Implementations
sourceimpl<CS, F, I, M, S> MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata + HasRand,
impl<CS, F, I, M, S> MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata + HasRand,
sourcepub fn update_score(&self, state: &mut S, idx: usize) -> Result<(), Error>
pub fn update_score(&self, state: &mut S, idx: usize) -> Result<(), Error>
Update the Corpus
score using the MinimizerScheduler
sourcepub fn cull(&self, state: &mut S) -> Result<(), Error>
pub fn cull(&self, state: &mut S) -> Result<(), Error>
Cull the Corpus
using the MinimizerScheduler
sourcepub fn new(base: CS) -> Self
pub fn new(base: CS) -> Self
Creates a new MinimizerScheduler
that wraps a base
Scheduler
and has a default probability to skip non-faved Testcase
s of DEFAULT_SKIP_NON_FAVORED_PROB
.
sourcepub fn with_skip_prob(base: CS, skip_non_favored_prob: u64) -> Self
pub fn with_skip_prob(base: CS, skip_non_favored_prob: u64) -> Self
Creates a new MinimizerScheduler
that wraps a base
Scheduler
and has a non-default probability to skip non-faved Testcase
s using (skip_non_favored_prob
).
Trait Implementations
sourceimpl<CS: Clone, F: Clone, I: Clone, M: Clone, S: Clone> Clone for MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata,
impl<CS: Clone, F: Clone, I: Clone, M: Clone, S: Clone> Clone for MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata,
sourcefn clone(&self) -> MinimizerScheduler<CS, F, I, M, S>
fn clone(&self) -> MinimizerScheduler<CS, F, I, M, S>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<CS: Debug, F: Debug, I: Debug, M: Debug, S: Debug> Debug for MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata,
impl<CS: Debug, F: Debug, I: Debug, M: Debug, S: Debug> Debug for MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata,
sourceimpl<CS, F, I, M, S> Scheduler<I, S> for MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata + HasRand,
impl<CS, F, I, M, S> Scheduler<I, S> for MinimizerScheduler<CS, F, I, M, S> where
CS: Scheduler<I, S>,
F: TestcaseScore<I, S>,
I: Input,
M: AsSlice<usize> + SerdeAny + HasRefCnt,
S: HasCorpus<I> + HasMetadata + HasRand,
sourcefn on_add(&self, state: &mut S, idx: usize) -> Result<(), Error>
fn on_add(&self, state: &mut S, idx: usize) -> Result<(), Error>
Add an entry to the corpus and return its index
sourcefn on_replace(
&self,
state: &mut S,
idx: usize,
testcase: &Testcase<I>
) -> Result<(), Error>
fn on_replace(
&self,
state: &mut S,
idx: usize,
testcase: &Testcase<I>
) -> Result<(), Error>
Replaces the testcase at the given idx
Auto Trait Implementations
impl<CS, F, I, M, S> RefUnwindSafe for MinimizerScheduler<CS, F, I, M, S> where
CS: RefUnwindSafe,
F: RefUnwindSafe,
I: RefUnwindSafe,
M: RefUnwindSafe,
S: RefUnwindSafe,
impl<CS, F, I, M, S> Send for MinimizerScheduler<CS, F, I, M, S> where
CS: Send,
F: Send,
I: Send,
M: Send,
S: Send,
impl<CS, F, I, M, S> Sync for MinimizerScheduler<CS, F, I, M, S> where
CS: Sync,
F: Sync,
I: Sync,
M: Sync,
S: Sync,
impl<CS, F, I, M, S> Unpin for MinimizerScheduler<CS, F, I, M, S> where
CS: Unpin,
F: Unpin,
I: Unpin,
M: Unpin,
S: Unpin,
impl<CS, F, I, M, S> UnwindSafe for MinimizerScheduler<CS, F, I, M, S> where
CS: UnwindSafe,
F: UnwindSafe,
I: UnwindSafe,
M: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
type PreprendResult = Tail
type PreprendResult = Tail
The Resulting TupleList
, of an Prepend::prepend()
call,
including the prepended entry. Read more
sourcefn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
Prepend a value to this tuple, returning a new tuple with prepended value.