Skip to content

ir: weight generator selection - #247

Open
erickcestari wants to merge 1 commit into
lnfuzz:masterfrom
erickcestari:generator_weights
Open

erickcestari wants to merge 1 commit into
lnfuzz:masterfrom
erickcestari:generator_weights

Conversation

@erickcestari

Copy link
Copy Markdown
Contributor

Add Generator::weight (default 10) and AnyGenerator::choose, which picks by weight instead of uniformly. The AFL mutator uses it for fresh programs and generator insertion.

This lets future generators such as error, warning or pong be picked less often, since they stall the peer rather than advance the protocol. All existing generators keep the default, so selection is unchanged.

rand needs the alloc feature for choose_weighted.

Add Generator::weight (default 10) and AnyGenerator::choose, which picks
by weight instead of uniformly. The AFL mutator uses it for fresh
programs and generator insertion.

This lets future generators such as error, warning or pong be picked
less often, since they stall the peer rather than advance the protocol.
All existing generators keep the default, so selection is unchanged.

rand needs the alloc feature for choose_weighted.

@NishantBansal2003 NishantBansal2003 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be really useful in the future, with #219 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants