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

feat: ssa fuzzer #7641

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
f5ad365
init for acir_formal_proofs
jewelofchaos9 Jan 6, 2025
71bcdf3
cargo.toml + deleted gitignore
jewelofchaos9 Jan 6, 2025
beb25dc
delete question mark
jewelofchaos9 Jan 6, 2025
99efe83
resloving
jewelofchaos9 Jan 6, 2025
32b53ff
initial
jewelofchaos9 Feb 14, 2025
89ac505
a
jewelofchaos9 Feb 17, 2025
df0717d
unsigned problems solved by itself
jewelofchaos9 Feb 17, 2025
d148224
Merge branch 'sn/fuzzing' of https://github.com/jewelofchaos9/noir in…
jewelofchaos9 Feb 17, 2025
ae1b9ed
bimbim
jewelofchaos9 Feb 17, 2025
6e33df7
bimbom
jewelofchaos9 Feb 17, 2025
bd33beb
Merge branch 'sn/fuzzing' of https://github.com/jewelofchaos9/noir in…
jewelofchaos9 Feb 17, 2025
a0d5ac5
random witness
jewelofchaos9 Feb 17, 2025
654e122
merge
jewelofchaos9 Feb 19, 2025
e7aea0f
refactor fuzzing
jewelofchaos9 Feb 19, 2025
7347a70
array support
jewelofchaos9 Feb 19, 2025
8388943
handle compilation erros
jewelofchaos9 Feb 20, 2025
0b8f2ea
witnesses + field
jewelofchaos9 Feb 24, 2025
f8ca2f8
branching shizo
jewelofchaos9 Feb 26, 2025
6408c14
branching
jewelofchaos9 Feb 26, 2025
50193ed
merge
jewelofchaos9 Feb 27, 2025
81ab138
u128 + some branching + resolving + optimization_bug
jewelofchaos9 Feb 28, 2025
2c432e0
pupupu
jewelofchaos9 Mar 10, 2025
3673c1c
fmt
jewelofchaos9 Mar 10, 2025
bd3065d
mthreads
jewelofchaos9 Mar 10, 2025
4e4ff22
remove launch json
jewelofchaos9 Mar 10, 2025
5c742a7
chore
jewelofchaos9 Mar 10, 2025
417f659
lock
jewelofchaos9 Mar 10, 2025
4dbb59d
restore rust toolchain
jewelofchaos9 Mar 10, 2025
c38f304
AAAA
jewelofchaos9 Mar 10, 2025
3aea726
chore
jewelofchaos9 Mar 10, 2025
8c9b4e8
some docs
jewelofchaos9 Mar 13, 2025
4f81e97
rpc so back + some docs
jewelofchaos9 Mar 13, 2025
1a4a85b
imsostupid
jewelofchaos9 Mar 13, 2025
ed61f9f
clarify naming
jewelofchaos9 Mar 13, 2025
27eaaf9
more and more
jewelofchaos9 Mar 13, 2025
22decfb
return proptest
jewelofchaos9 Mar 13, 2025
59f2952
A
jewelofchaos9 Mar 13, 2025
c0f2488
a
jewelofchaos9 Mar 13, 2025
8d71250
Merge branch 'sn/fuzzing' of https://github.com/jewelofchaos9/noir in…
jewelofchaos9 Mar 13, 2025
6149bea
Update tooling/ssa_fuzzer/src/builder.rs
jewelofchaos9 Mar 18, 2025
2785822
Update tooling/ssa_fuzzer/src/compiler.rs
jewelofchaos9 Mar 18, 2025
b24c715
Update tooling/ssa_fuzzer/src/compiler.rs
jewelofchaos9 Mar 18, 2025
9db0375
something
jewelofchaos9 Mar 18, 2025
641e92c
Merge branch 'sn/fuzzing' of https://github.com/jewelofchaos9/noir in…
jewelofchaos9 Mar 18, 2025
9a7111a
tests
jewelofchaos9 Mar 18, 2025
b8acba6
resolving
jewelofchaos9 Mar 18, 2025
dc9a64d
fromatting
jewelofchaos9 Mar 18, 2025
87bc829
passing ci
jewelofchaos9 Mar 18, 2025
251199b
AAAAA
jewelofchaos9 Mar 18, 2025
8277f5c
LLL
jewelofchaos9 Mar 18, 2025
4144f2f
groebner
jewelofchaos9 Mar 18, 2025
790b10c
clippy
jewelofchaos9 Mar 18, 2025
e21270f
if clippy was so cool, where is clippy commit2?
jewelofchaos9 Mar 18, 2025
7c16532
if clippy2 commit was so cool, where is clippy commit3?
jewelofchaos9 Mar 18, 2025
399b0f4
please be patient i have problems
jewelofchaos9 Mar 18, 2025
5ae98fd
nargo exeute
jewelofchaos9 Mar 18, 2025
6292bcb
docs
jewelofchaos9 Mar 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 118 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ members = [
"acvm-repo/bn254_blackbox_solver",
# Utility crates
"utils/iter-extended",

"tooling/ssa_fuzzer",
"tooling/ssa_fuzzer/fuzzer",
"utils/protobuf",
]
default-members = [
Expand Down
36 changes: 18 additions & 18 deletions compiler/noirc_evaluator/src/acir/generated_acir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,55 @@ pub(crate) const PLACEHOLDER_BRILLIG_INDEX: BrilligFunctionId = BrilligFunctionI

#[derive(Debug, Default)]
/// The output of the Acir-gen pass, which should only be produced for entry point Acir functions
pub(crate) struct GeneratedAcir<F: AcirField> {
pub struct GeneratedAcir<F: AcirField> {
/// The next witness index that may be declared.
/// If witness index is `None` then we have not yet created a witness
/// and thus next witness index that be declared is zero.
/// This field is private should only ever be accessed through its getter and setter.
///
/// Equivalent to acvm::acir::circuit::Circuit's field of the same name.
current_witness_index: Option<u32>,
pub current_witness_index: Option<u32>,

/// The opcodes of which the compiled ACIR will comprise.
opcodes: Vec<AcirOpcode<F>>,
pub opcodes: Vec<AcirOpcode<F>>,

/// All witness indices that comprise the final return value of the program
pub(crate) return_witnesses: Vec<Witness>,
pub return_witnesses: Vec<Witness>,

/// All witness indices which are inputs to the main function
pub(crate) input_witnesses: Vec<Witness>,
pub input_witnesses: Vec<Witness>,

pub(crate) locations: OpcodeToLocationsMap,
pub locations: OpcodeToLocationsMap,

/// Brillig function id -> Opcodes locations map
/// This map is used to prevent redundant locations being stored for the same Brillig entry point.
pub(crate) brillig_locations: BTreeMap<BrilligFunctionId, BrilligOpcodeToLocationsMap>,
pub brillig_locations: BTreeMap<BrilligFunctionId, BrilligOpcodeToLocationsMap>,

/// Source code location of the current instruction being processed
/// None if we do not know the location
pub(crate) call_stack: CallStack,
pub call_stack: CallStack,

/// Correspondence between an opcode index and the error message associated with it.
pub(crate) assertion_payloads: BTreeMap<OpcodeLocation, AssertionPayload<F>>,
pub assertion_payloads: BTreeMap<OpcodeLocation, AssertionPayload<F>>,

/// Correspondence between error selectors and types associated with them.
pub(crate) error_types: BTreeMap<ErrorSelector, ErrorType>,
pub error_types: BTreeMap<ErrorSelector, ErrorType>,

pub(crate) warnings: Vec<SsaReport>,
pub warnings: Vec<SsaReport>,

/// Name for the corresponding entry point represented by this Acir-gen output.
/// Only used for debugging and benchmarking purposes
pub(crate) name: String,
pub name: String,

/// Maps the opcode index to a Brillig std library function call.
/// As to avoid passing the ACIR gen shared context into each individual ACIR
/// we can instead keep this map and resolve the Brillig calls at the end of code generation.
pub(crate) brillig_stdlib_func_locations: BTreeMap<OpcodeLocation, BrilligStdlibFunc>,
pub brillig_stdlib_func_locations: BTreeMap<OpcodeLocation, BrilligStdlibFunc>,

/// Brillig function id -> Brillig procedure locations map
/// This maps allows a profiler to determine which Brillig opcodes
/// originated from a reusable procedure.
pub(crate) brillig_procedure_locs: BTreeMap<BrilligFunctionId, BrilligProcedureRangeMap>,
pub brillig_procedure_locs: BTreeMap<BrilligFunctionId, BrilligProcedureRangeMap>,
}

/// Correspondence between an opcode index (in opcodes) and the source code call stack which generated it
Expand All @@ -91,7 +91,7 @@ pub(crate) type BrilligOpcodeToLocationsMap = BTreeMap<BrilligOpcodeLocation, Ca
pub(crate) type BrilligProcedureRangeMap = BTreeMap<ProcedureDebugId, (usize, usize)>;

#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
pub(crate) enum BrilligStdlibFunc {
pub enum BrilligStdlibFunc {
Inverse,
Quotient,
ToLeBytes,
Expand All @@ -109,7 +109,7 @@ impl BrilligStdlibFunc {

impl<F: AcirField> GeneratedAcir<F> {
/// Returns the current witness index.
pub(crate) fn current_witness_index(&self) -> Witness {
pub fn current_witness_index(&self) -> Witness {
Witness(self.current_witness_index.unwrap_or(0))
}

Expand All @@ -121,11 +121,11 @@ impl<F: AcirField> GeneratedAcir<F> {
}
}

pub(crate) fn opcodes(&self) -> &[AcirOpcode<F>] {
pub fn opcodes(&self) -> &[AcirOpcode<F>] {
&self.opcodes
}

pub(crate) fn take_opcodes(&mut self) -> Vec<AcirOpcode<F>> {
pub fn take_opcodes(&mut self) -> Vec<AcirOpcode<F>> {
std::mem::take(&mut self.opcodes)
}

Expand Down
Loading
Loading