-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(brillig): foreign call/oracle compilation (#1600)
* remove mac runner * chore: generate brillig opcode for simple identity unconstrained function (#1536) * feat(brillig): added arithmetic operations on brillig (#1565) Co-authored-by: kevaundray <[email protected]> * make ranges be polymorphic integers * chore(brillig): Clean up handling of Binary operations (#1571) * chore(ssa refactor): Rename Brillig example (#1563) * chore(brillig): added tests for all field binary operations (#1586) * chore(brillig): added tests for brillig integer operations (#1590) * feat: process blocks and jumps when compiling brillig (#1591) * process jumps between blocks * fix jumps * add doc comments * cargo fmt * code refactor * update code comment --------- Co-authored-by: kevaundray <[email protected]> * feat: process blocks and jumps when compiling brillig (#1591) * process jumps between blocks * fix jumps * add doc comments * cargo fmt * code refactor * update code comment --------- Co-authored-by: kevaundray <[email protected]> * feat(brillig): start of oracles/foreign calls * fix: broken tests * feat(brillig): parsing oracles/foreign calls (#1596) * feat(brillig): start of oracles/foreign calls * fix: broken tests * Update execute.rs * feat: more foreign call work * self.data -> self.vars * chore(brillig): Add handling of the not instruction (#1609) * test: brillig oracle * Reinstate option * make behavior consistent * remove closure * change index_type * Update crates/noirc_frontend/src/hir/type_check/expr.rs * feat(brillig): loops (#1610) * make ranges be polymorphic integers * feat: brillig loop support * fix: fixed brillig returns and stop * fix: do not apply constants folding to brillig fns * chore: update acvm pointer, cleanup * style: newline on cargo toml * make behavior consistent * remove closure * change index_type * Update crates/noirc_frontend/src/hir/type_check/expr.rs * better debug information for unsupported instruction * remove edge case for optimizations * clippy fix * patch infinite loop --------- Co-authored-by: kevaundray <[email protected]> Co-authored-by: jfecher <[email protected]> * feat: Foreign calls compiling and basic print executed in nargo (#1612) * get foreign calls compiling and basic print executed in nargo * cargo clipy and cargo fmt * missing * Update crates/noirc_evaluator/src/brillig/brillig_gen.rs * add issue num for logging --------- Co-authored-by: kevaundray <[email protected]> * chore: resolve immutable array merge differences (#1617) * chore(ssa refactor): Switch to immutable arrays (#1578) * Represent SSA arrays with im::Vector * Get tests passing * Implement assign with immutable arrays * Add constant folding pass * Update comments * Clippy * Update comment * Update type of array * Update crates/noirc_evaluator/src/ssa_refactor/ir/instruction.rs Co-authored-by: Tom French <[email protected]> * Undo formatting changes in instruction.rs * Massive acir_gen update * Refactor acir array operations into a shared function * Appease clippy * Update to_radix and to_bits in acir_gen to return arrays * Disable assert * Fix convert_type for arrays * Include AcirType in AcirValue::Var variant * Fix black box functions * Appease clippy * Fix simple_radix * Add doc comments --------- Co-authored-by: Tom French <[email protected]> * feat: Make for-loop range be a polymorphic integer instead of just Field in unconstrained functions (#1583) * make ranges be polymorphic integers * make behavior consistent * remove closure * change index_type * Update crates/noirc_frontend/src/hir/type_check/expr.rs --------- Co-authored-by: jfecher <[email protected]> * chore(ssa refactor): fix brillig post master merge * chore(ssa refactor): accidental merge undelete --------- Co-authored-by: jfecher <[email protected]> Co-authored-by: Tom French <[email protected]> Co-authored-by: kevaundray <[email protected]> * chore(ssa refactor): Add more documentation for truncation (#1607) * add more documentation * small change * Update crates/noirc_evaluator/src/ssa_refactor/acir_gen/acir_ir/generated_acir.rs * Update .github/workflows/test.yml * Update .github/workflows/test.yml * remove dbg * change printer for foreign call * Update crates/noirc_evaluator/src/ssa_refactor/ir/function.rs * Update crates/noirc_evaluator/src/ssa_refactor/ir/instruction.rs Co-authored-by: kevaundray <[email protected]> * Update crates/noirc_evaluator/src/ssa_refactor/acir_gen/acir_ir/acir_variable.rs --------- Co-authored-by: kevaundray <[email protected]> Co-authored-by: guipublic <[email protected]> Co-authored-by: Álvaro Rodríguez <[email protected]> Co-authored-by: jfecher <[email protected]> Co-authored-by: Maxim Vezenov <[email protected]> Co-authored-by: joss-aztec <[email protected]> Co-authored-by: Tom French <[email protected]>
- Loading branch information
1 parent
66e7297
commit 6bd5a8d
Showing
22 changed files
with
200 additions
and
37 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ result | |
*.pk | ||
*.vk | ||
**/Verifier.toml | ||
**/target |
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
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/brillig_oracle/Nargo.toml
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/brillig_oracle/Prover.toml
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
x = "10" | ||
|
15 changes: 15 additions & 0 deletions
15
crates/nargo_cli/tests/test_data_ssa_refactor/brillig_oracle/src/main.nr
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Tests oracle usage in brillig/unconstrained functions | ||
fn main(x: Field) { | ||
// call through a brillig wrapper | ||
oracle_print_wrapper(x); | ||
} | ||
|
||
|
||
#[oracle(oracle_print_impl)] | ||
unconstrained fn oracle_print(_x : Field) {} | ||
|
||
unconstrained fn oracle_print_wrapper(x: Field) { | ||
oracle_print(x); | ||
} | ||
|
||
|
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
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
Oops, something went wrong.