Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GreenBench implementation #1912

Merged
merged 18 commits into from
Nov 30, 2023
Merged

Conversation

jiradeto
Copy link
Contributor

@jiradeto jiradeto commented Nov 7, 2023

This PR ports implementation of https://github.com/Rigorous-Software-Engineering/greenbench into fuzzbench. Essentially, we introduce new experiment option to allow users to opt in micro benchmark fuzzing that described in the GreenBench paper.

Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

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

This looks pretty good, and I think it will be easy to merge this next week. I still need to take a deeper look at random_corpus_fuzzing_utils.py though.
Please fix the presubmit failure btw.

experiment/runner.py Outdated Show resolved Hide resolved
@@ -701,6 +701,7 @@ def __init__(self, trial):
self.time_ended = trial.time_ended
self.preemptible = trial.preemptible
self.cpuset = None
self.trial_group_num = trial.trial_group_num
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this has been plumbed through properly but I'm not 100% sure (no reason to think it's wrong). Sorry this setup isn't great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @jonathanmetzman the trial_group_num field is used as an identifier of the group of trials and this idea of trial grouping is used to make sure that we provide the same set of seeds to certain trails (within the same group).

For example, if in the config.yaml we set trials to 2 for the experiment so we have following trials in total (for fuzzer afl, libfuzzer and benchmark libjpeg):

  • trial_id: 1, benchmark: libjpeg, fuzzer: afl
  • trial_id: 2, benchmark: libjpeg, fuzzer: afl
  • trial_id: 3, benchmark: libjpeg, fuzzer: libfuzzer
  • trial_id: 4, benchmark: libjpeg, fuzzer: libfuzzer

so fuzzbench will generate following group (synthetically) and assign the same set initial seeds to trials within the same group:

  • trial_id: 1, benchmark: libjpeg, fuzzer: afl --> Group A
  • trial_id: 2, benchmark: libjpeg, fuzzer: afl --> Group B
  • trial_id: 3, benchmark: libjpeg, fuzzer: libfuzzer --> Group A
  • trial_id: 4, benchmark: libjpeg, fuzzer: libfuzzer --> Group B

Please let me know if it makes sense? also is there a way to only add/inject this trial_group_num field only when are running in MICRO_EXPERIMENT mode?

experiment/runner.py Outdated Show resolved Hide resolved
experiment/runner.py Outdated Show resolved Hide resolved
common/random_corpus_fuzzing_utils.py Outdated Show resolved Hide resolved
common/random_corpus_fuzzing_utils.py Outdated Show resolved Hide resolved
common/random_corpus_fuzzing_utils.py Outdated Show resolved Hide resolved
@jonathanmetzman
Copy link
Contributor

Also could you write short documentation explaining how to use the feature, I want to play with it.

@jiradeto
Copy link
Contributor Author

Also could you write short documentation explaining how to use the feature, I want to play with it.

hi @jonathanmetzman, as this feature depends on oss-fuzz-corpus, so we need to specify --oss-fuzz-corpus flag when starting experiment and also set new parameter:

micro_experiment: true

in experiment-config.yml file.

@jonathanmetzman
Copy link
Contributor

Can you fix the test failure please?

@jiradeto
Copy link
Contributor Author

Fixed all failed tests @jonathanmetzman can you please help to re-review?

Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

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

LGTM

@jonathanmetzman jonathanmetzman merged commit c734a74 into google:master Nov 30, 2023
3 checks passed
DonggeLiu added a commit that referenced this pull request Dec 8, 2023
jonathanmetzman added a commit that referenced this pull request Dec 10, 2023
jonathanmetzman added a commit that referenced this pull request Dec 10, 2023
addisoncrump pushed a commit to addisoncrump/fuzzbench that referenced this pull request Dec 14, 2023
This PR ports implementation of
https://github.com/Rigorous-Software-Engineering/greenbench into
fuzzbench. Essentially, we introduce new experiment option to allow
users to opt in micro benchmark fuzzing that described in the GreenBench
paper.
addisoncrump pushed a commit to addisoncrump/fuzzbench that referenced this pull request Dec 14, 2023
jonathanmetzman added a commit that referenced this pull request Mar 4, 2024
jonathanmetzman added a commit that referenced this pull request Mar 6, 2024
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