-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ssa_refactor)!: Add Slices (#1728)
* initial slices work on frontend * cargo clippy * develop comment cleanup * working push_back and len slices commands * cargo clippy * cleanup * fix clippy * empty slice being processed * cargo clippy * delete old comment * remove unused import * add enable_slices flag to avoid slices in old SSA * add new SSA type for slices * missing Slice conversion * Update crates/noirc_evaluator/src/ssa_refactor/acir_gen/mod.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * PR comments, fix slice/array subtyping * hack to handle duplicate methods and mismatched types when compiling w/ old SSA pass that does not handle slices * cleanup enable_slices tech debt to be part of the NodeInterner * reference enable_slices flag issue * cleanup name * remove SSA Value::Slice * remove dbg * fix array len from slice params * remove old debug * unwrap_array_element_type method in monomorphization pass * cargo clippy * mark issue in TODO comment for tech debt that removes slice module in stdlib * Update crates/noirc_evaluator/src/ssa_refactor/ir/instruction.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * fix stdlib crate check * Update noir_stdlib/src/slice.nr Co-authored-by: jfecher <jake@aztecprotocol.com> * Update noir_stdlib/src/slice.nr Co-authored-by: jfecher <jake@aztecprotocol.com> * Update noir_stdlib/src/slice.nr Co-authored-by: jfecher <jake@aztecprotocol.com> * Update noir_stdlib/src/slice.nr Co-authored-by: jfecher <jake@aztecprotocol.com> * PR comments and stdlib crate assert * cargo fmt * keep enable slices check in expr type check * increase timeout time * increase timeout to 60m * back to 30m timeout * excldue 6_array from old ssa test and move 6_array into ssa_refactor tests * unwrap_or_else for first_elem_type * only test new ssa :D * add back old ssa tests * remove Vec type * remove Vec type check * remove Vec from stdlib as we have no primitive type until we add in Vec using mutable refs * try w/ a pub input to 6_array * im dumb and misplaced the pub * remove pub * temp: remove unused tests for debugging * Revert "temp: remove unused tests for debugging" This reverts commit daac684. --------- Co-authored-by: jfecher <jake@aztecprotocol.com> Co-authored-by: kevaundray <kevtheappdev@gmail.com>
- Loading branch information
1 parent
26d078d
commit 4bee979
Showing
36 changed files
with
337 additions
and
150 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
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 |
---|---|---|
|
@@ -5,5 +5,4 @@ t = "10" | |
|
||
#7128 | ||
#15309 | ||
#16349 | ||
|
||
#16349 |
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 |
---|---|---|
|
@@ -51,4 +51,3 @@ fn main(x: [u32; 5], y: [u32; 5], mut z: u32, t: u32) { | |
} | ||
} | ||
} | ||
|
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/slices/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.6.0" | ||
|
||
[dependencies] |
2 changes: 2 additions & 0 deletions
2
crates/nargo_cli/tests/test_data_ssa_refactor/slices/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 = "5" | ||
y = "10" |
23 changes: 23 additions & 0 deletions
23
crates/nargo_cli/tests/test_data_ssa_refactor/slices/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,23 @@ | ||
use dep::std::slice; | ||
|
||
fn main(x : Field, y : pub Field) { | ||
|
||
let mut slice: [Field] = [0; 2]; | ||
|
||
assert(slice[0] == 0); | ||
assert(slice[0] != 1); | ||
slice[0] = x; | ||
assert(slice[0] == x); | ||
|
||
let slice_plus_10 = slice.push_back(y); | ||
assert(slice_plus_10[2] == 10); | ||
assert(slice_plus_10[2] != 8); | ||
assert(slice_plus_10.len() == 3); | ||
|
||
let mut new_slice: [Field] = []; | ||
for i in 0..5 { | ||
new_slice = new_slice.push_back(i); | ||
} | ||
assert(new_slice.len() == 5); | ||
} | ||
|
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.