-
Notifications
You must be signed in to change notification settings - Fork 295
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
feat: Adding fuzzer for ultra bigfield and relaxing ultra circuit checker #10433
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9bdb7f2
Adding separate assan directory
Sarkoxed 793eafb
Ultra circuit checker delta range + aux optimizations
Sarkoxed 150f1ce
Adding ultra circuit builder to fuzzer
Sarkoxed ff48b3c
typos
Sarkoxed 97f8972
ultra fuzzer for bigfield:
Sarkoxed 25400d4
Adding extra logging to fuzzer + fixing byte crash and add_two operation
Sarkoxed f6c30b2
noexit
Sarkoxed 83b65f8
forgot
Sarkoxed 057930b
no newline
Sarkoxed 515887d
no confusion
Sarkoxed a908b40
Adding comments + skipping delta range
Sarkoxed 0edc45f
Unnecessary includes
Sarkoxed 0dc5404
Merge branch 'master' into as/ultra-circuit-fuzzer-1
Sarkoxed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
#include "barretenberg/circuit_checker/circuit_checker.hpp" | ||
#include "barretenberg/numeric/uint256/uint256.hpp" | ||
#include "barretenberg/stdlib_circuit_builders/standard_circuit_builder.hpp" | ||
#include <concepts> | ||
#include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need to include this header here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// NOLINTBEGIN(cppcoreguidelines-macro-usage, google-runtime-int) | ||
#define PARENS () | ||
|
@@ -44,8 +44,7 @@ struct HavocSettings { | |
size_t VAL_MUT_NON_MONTGOMERY_PROBABILITY; // The probability of not converting to montgomery form before applying | ||
// value mutations | ||
size_t VAL_MUT_SMALL_ADDITION_PROBABILITY; // The probability of performing small additions | ||
size_t VAL_MUT_SMALL_MULTIPLICATION_PROBABILITY; // The probability of performing small multiplications | ||
size_t VAL_MUT_SPECIAL_VALUE_PROBABILITY; // The probability of assigning special values (0,1, p-1, p-2, p-1/2) | ||
size_t VAL_MUT_SPECIAL_VALUE_PROBABILITY; // The probability of assigning special values (0,1, p-1, p-2, p-1/2) | ||
std::vector<size_t> structural_mutation_distribution; // Holds the values to quickly select a structural mutation | ||
// based on chosen probabilities | ||
std::vector<size_t> value_mutation_distribution; // Holds the values to quickly select a value mutation based on | ||
|
@@ -157,7 +156,7 @@ concept ArithmeticFuzzHelperConstraint = requires { | |
template <typename T> | ||
concept CheckableComposer = requires(T a) { | ||
{ | ||
CircuitChecker::check(a) | ||
bb::CircuitChecker::check(a) | ||
} -> std::same_as<bool>; | ||
}; | ||
|
||
|
@@ -220,7 +219,7 @@ inline static FF mutateFieldElement(FF e, T& rng) | |
e = FF(value_data); \ | ||
} | ||
|
||
// Pick the last value from the mutation distrivution vector | ||
// Pick the last value from the mutation distribution vector | ||
// Choose mutation | ||
const size_t choice = rng.next() % 4; | ||
// 50% probability to use standard mutation | ||
|
@@ -691,6 +690,8 @@ constexpr void RunWithBuilders(const uint8_t* Data, const size_t Size, FastRando | |
{ | ||
if (Composers & 1) { | ||
RunWithBuilder<Fuzzer, bb::StandardCircuitBuilder>(Data, Size, VarianceRNG); | ||
} else if (Composers & 2) { | ||
RunWithBuilder<Fuzzer, bb::UltraCircuitBuilder>(Data, Size, VarianceRNG); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#pragma once | ||
#include <cstdint> | ||
|
||
enum CircuitType : uint64_t { Standard = 1 << 0 }; | ||
enum CircuitType : uint64_t { Standard = 1 << 0, Ultra = 1 << 1 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you create a separate asan build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Do we really need to build with asan in the same directory as ordinary fuzzing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to change the directory without adding ASAN by default to the build. So either this change is not needed or it would be beneficial to create a separate build with ASAN, so it is easy to reconfigure