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: Sync from noir #11294

Merged
merged 62 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
5a889cb
[1 changes] chore(ssa): Use correct prefix when printing array values…
AztecBot Jan 17, 2025
9f63bed
chore: apply sync fixes
AztecBot Jan 17, 2025
606b9ac
[1 changes] fix: defunctionalize pass on the caller runtime to apply …
AztecBot Jan 18, 2025
a72b1b8
chore: apply sync fixes
AztecBot Jan 18, 2025
67d362a
fix: defunctionalize pass on the caller runtime to apply (https://git…
AztecBot Jan 18, 2025
de1be34
[1 changes] fix: defunctionalize pass on the caller runtime to apply …
AztecBot Jan 19, 2025
470f921
chore: apply sync fixes
AztecBot Jan 19, 2025
9a8ae15
fix: defunctionalize pass on the caller runtime to apply (https://git…
AztecBot Jan 19, 2025
92fe93c
[1 changes] fix: defunctionalize pass on the caller runtime to apply …
AztecBot Jan 20, 2025
1ae9dc8
chore: apply sync fixes
AztecBot Jan 20, 2025
16c1348
fix: defunctionalize pass on the caller runtime to apply (https://git…
AztecBot Jan 20, 2025
dda6bed
Merge branch 'master' into sync-noir
TomAFrench Jan 20, 2025
cde04e6
Merge branch 'master' into sync-noir
TomAFrench Jan 20, 2025
23d6947
[1 changes] fix: don't always use an exclusive lock in `nargo check` …
AztecBot Jan 20, 2025
f21b821
chore: apply sync fixes
AztecBot Jan 20, 2025
a5c1b5f
fix: don't always use an exclusive lock in `nargo check` (https://git…
AztecBot Jan 20, 2025
ebb0774
DEBUGGING
aakoshh Jan 20, 2025
3404fce
[1 changes] fix: Prevent overlapping associated types impls (https://…
AztecBot Jan 21, 2025
053fc55
chore: apply sync fixes
AztecBot Jan 21, 2025
57ac507
fix: Prevent overlapping associated types impls (https://github.com/n…
AztecBot Jan 21, 2025
e3febe6
Parse Prover.toml or Prover.json
aakoshh Jan 21, 2025
374dc8a
Merge branch 'sync-noir' of github.com:AztecProtocol/aztec-packages i…
aakoshh Jan 21, 2025
efe1851
Extra logging when simulation fails
aakoshh Jan 21, 2025
8d3ae19
Add missing flag to CheckCmd
aakoshh Jan 21, 2025
89a2cab
Re-enable preprocessing
aakoshh Jan 21, 2025
1d03119
Preserve type in get_from_call_data
aakoshh Jan 22, 2025
0391234
Update noir/noir-repo/compiler/noirc_evaluator/src/acir/mod.rs
TomAFrench Jan 22, 2025
e9bfd0c
Log failing protocol circuit hash
aakoshh Jan 22, 2025
df04af5
[1 changes] feat: add `noir-inspector` (https://github.com/noir-lang/…
AztecBot Jan 24, 2025
d174172
chore: apply sync fixes
AztecBot Jan 24, 2025
eb2f133
feat: add `noir-inspector` (https://github.com/noir-lang/noir/pull/7136)
AztecBot Jan 24, 2025
bf16c04
Merge branch 'master' into sync-noir
TomAFrench Jan 24, 2025
a148954
Fix merge
aakoshh Jan 24, 2025
7c47422
Add back missing test program
aakoshh Jan 24, 2025
2143ac7
temporarily comment out tests
vezenovm Jan 24, 2025
9331891
comment out 512 test
vezenovm Jan 24, 2025
7bc19a4
Merge branch 'master' into sync-noir
vezenovm Jan 24, 2025
9dc9809
[1 changes] chore: let `add_definition_location` take a Location (htt…
AztecBot Jan 25, 2025
bdf5fa7
chore: apply sync fixes
AztecBot Jan 25, 2025
d672928
chore: let `add_definition_location` take a Location (https://github.…
AztecBot Jan 25, 2025
c127228
[1 changes] chore: let `add_definition_location` take a Location (htt…
AztecBot Jan 26, 2025
0d1bd03
chore: apply sync fixes
AztecBot Jan 26, 2025
feee294
chore: let `add_definition_location` take a Location (https://github.…
AztecBot Jan 26, 2025
1c42a35
[1 changes] chore: let `add_definition_location` take a Location (htt…
AztecBot Jan 27, 2025
09f355a
chore: apply sync fixes
AztecBot Jan 27, 2025
f56fe2d
chore: let `add_definition_location` take a Location (https://github.…
AztecBot Jan 27, 2025
e5267d7
Fix merge
aakoshh Jan 27, 2025
9c70d4c
Display which test panicked
aakoshh Jan 27, 2025
285662a
Comment out panicky tests again
aakoshh Jan 27, 2025
d654c1c
Merge branch 'master' into sync-noir
TomAFrench Jan 27, 2025
5fe6a89
Prefer const
aakoshh Jan 27, 2025
4a9dd59
Merge branch 'sync-noir' of github.com:AztecProtocol/aztec-packages i…
aakoshh Jan 27, 2025
39f42b8
TEMP FIX: Reverse the order of the call stack
aakoshh Jan 28, 2025
dc9b7b9
TEMP FIX: Keep inc_rs for array params
aakoshh Jan 28, 2025
ac9e584
TEMP FIX: Fix regression in private_kernel_init_simulated test
aakoshh Jan 29, 2025
4608c49
TEMP FIX: Track mutated arrays on the function level
aakoshh Jan 29, 2025
578a92d
TEMP FIX: Diable Mem2Reg (1st) pass; fixes the simulator test
aakoshh Jan 30, 2025
722e3aa
Merge branch 'master' into sync-noir
TomAFrench Jan 30, 2025
aad1248
.
TomAFrench Jan 30, 2025
c30734b
TEMP FIX: Do not panic, just simplify unhandled instructions
aakoshh Jan 30, 2025
dc6d0b3
TEMP FIX: Increase the balance to pay for increased gas cost
aakoshh Jan 30, 2025
feca4ed
TEMP FIX: Invert fee check in C++
aakoshh Jan 30, 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
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c172880ae47ec4906cda662801bd4b7866c9586b
dd7084545dfd93a07599fc10676b6c8ec1e3d458
142 changes: 120 additions & 22 deletions noir/noir-repo/.github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ jobs:

./gates_report_brillig.sh 9223372036854775807
jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_max.json

./gates_report_brillig.sh 0
jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_zero.json

./gates_report_brillig.sh -9223372036854775808
jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json

Expand Down Expand Up @@ -176,14 +176,14 @@ jobs:
- name: Generate Brillig execution report
working-directory: ./test_programs
run: |
mkdir ./reports
mkdir ./reports

./gates_report_brillig_execution.sh 9223372036854775807
jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_max.json

./gates_report_brillig_execution.sh 0
jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_zero.json

./gates_report_brillig_execution.sh -9223372036854775808
jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_min.json

Expand Down Expand Up @@ -296,15 +296,15 @@ jobs:
run: |
./execution_report.sh 0 1
mv execution_report.json ../execution_report.json

- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
name: in_progress_compilation_report
path: compilation_report.json
retention-days: 3
overwrite: true

- name: Upload execution report
uses: actions/upload-artifact@v4
with:
Expand All @@ -315,7 +315,7 @@ jobs:

external_repo_compilation_and_execution_report:
needs: [build-nargo]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
fail-fast: false
Expand Down Expand Up @@ -404,7 +404,7 @@ jobs:
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.project.path }}/execution_report.json ./execution_report_$PACKAGE_NAME.json
echo "execution_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT

- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
Expand All @@ -422,13 +422,17 @@ jobs:
overwrite: true

upload_compilation_report:
name: Upload compilation report
name: Upload compilation report
needs: [generate_compilation_and_execution_report, external_repo_compilation_and_execution_report]
# We want this job to run even if one variation of the matrix in `external_repo_compilation_and_execution_report` fails
if: always()
runs-on: ubuntu-latest
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -465,9 +469,29 @@ jobs:
header: compilation
message: ${{ steps.compilation_report.outputs.markdown }}

- name: Convert to `benchmark-action` format
run: |
jq ".compilation_reports | map({name: .artifact_name, value: (.time[:-1] | tonumber), unit: \"s\"}) " ./compilation_report.json > time_bench.json

- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Compilation Time"
tool: "customSmallerIsBetter"
output-file-path: ./time_bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
# We want this to only run on master to avoid garbage data from PRs being added.
auto-push: ${{ github.ref == 'refs/heads/master' }}
alert-threshold: "110%"
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@TomAFrench"
max-items-in-chart: 50

external_repo_memory_report:
needs: [build-nargo]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
Expand Down Expand Up @@ -508,6 +532,7 @@ jobs:
path: scripts
sparse-checkout: |
test_programs/memory_report.sh
test_programs/parse_memory.sh
sparse-checkout-cone-mode: false

- name: Checkout
Expand All @@ -521,6 +546,7 @@ jobs:
working-directory: ./test-repo/${{ matrix.project.path }}
run: |
mv /home/runner/work/noir/noir/scripts/test_programs/memory_report.sh ./memory_report.sh
mv /home/runner/work/noir/noir/scripts/test_programs/parse_memory.sh ./parse_memory.sh
./memory_report.sh 1
# Rename the memory report as the execution report is about to write to the same file
cp memory_report.json compilation_memory_report.json
Expand Down Expand Up @@ -569,13 +595,17 @@ jobs:
overwrite: true

upload_compilation_memory_report:
name: Upload compilation memory report
name: Upload compilation memory report
needs: [generate_memory_report, external_repo_memory_report]
# We want this job to run even if one variation of the matrix in `external_repo_memory_report` fails
if: always()
runs-on: ubuntu-latest
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -614,14 +644,38 @@ jobs:
header: compilation_memory
message: ${{ steps.compilation_mem_report.outputs.markdown }}

- name: Convert to `benchmark-action` format
run: |
jq ".memory_reports | map({name: .artifact_name, value: (.peak_memory | tonumber), unit: \"MB\"}) " ./memory_report.json > memory_bench.json

- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Compilation Memory"
tool: "customSmallerIsBetter"
output-file-path: ./memory_bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
# We want this to only run on master to avoid garbage data from PRs being added.
auto-push: ${{ github.ref == 'refs/heads/master' }}
alert-threshold: "110%"
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@TomAFrench"
max-items-in-chart: 50

upload_execution_memory_report:
name: Upload execution memory report
name: Upload execution memory report
needs: [generate_memory_report, external_repo_memory_report]
# We want this job to run even if one variation of the matrix in `external_repo_memory_report` fails
if: always()
runs-on: ubuntu-latest
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -660,14 +714,39 @@ jobs:
header: execution_memory
message: ${{ steps.execution_mem_report.outputs.markdown }}

- name: Convert to `benchmark-action` format
run: |
jq ".memory_reports | map({name: .artifact_name, value: (.peak_memory | tonumber), unit: \"MB\"}) " ./execution_memory_report.json > memory_bench.json

- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Execution Memory"
tool: "customSmallerIsBetter"
output-file-path: ./memory_bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
# We want this to only run on master to avoid garbage data from PRs being added.
auto-push: ${{ github.ref == 'refs/heads/master' }}
alert-threshold: "110%"
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@TomAFrench"
max-items-in-chart: 50


upload_execution_report:
name: Upload execution report
name: Upload execution report
needs: [generate_compilation_and_execution_report, external_repo_compilation_and_execution_report]
# We want this job to run even if one variation of the matrix in `external_repo_compilation_and_execution_report` fails
if: always()
runs-on: ubuntu-latest
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -704,3 +783,22 @@ jobs:
header: execution_time
message: ${{ steps.execution_report.outputs.markdown }}

- name: Convert to `benchmark-action` format
run: |
jq ".execution_reports | map({name: .artifact_name, value: (.time[:-1] | tonumber), unit: \"s\"}) " ./execution_report.json > time_bench.json

- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Execution Time"
tool: "customSmallerIsBetter"
output-file-path: ./time_bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
# We want this to only run on master to avoid garbage data from PRs being added.
auto-push: ${{ github.ref == 'refs/heads/master' }}
alert-threshold: "110%"
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@TomAFrench"
max-items-in-chart: 50
11 changes: 7 additions & 4 deletions noir/noir-repo/compiler/noirc_evaluator/src/acir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2909,7 +2909,7 @@ mod test {
use std::collections::BTreeMap;

use crate::{
acir::BrilligStdlibFunc,
acir::{BrilligStdlibFunc, Function},
brillig::Brillig,
ssa::{
function_builder::FunctionBuilder,
Expand Down Expand Up @@ -3341,7 +3341,8 @@ mod test {
build_basic_foo_with_return(&mut builder, foo_id, true, InlineType::default());
build_basic_foo_with_return(&mut builder, bar_id, true, InlineType::default());

let ssa = builder.finish();
let mut ssa = builder.finish();
ssa.globals = Function::new("globals".to_owned(), ssa.main_id);
let brillig = ssa.to_brillig(false);

let (acir_functions, brillig_functions, _, _) = ssa
Expand Down Expand Up @@ -3479,7 +3480,8 @@ mod test {

build_basic_foo_with_return(&mut builder, foo_id, true, InlineType::default());

let ssa = builder.finish();
let mut ssa = builder.finish();
ssa.globals = Function::new("globals".to_owned(), ssa.main_id);
// We need to generate Brillig artifacts for the regular Brillig function and pass them to the ACIR generation pass.
let brillig = ssa.to_brillig(false);
println!("{}", ssa);
Expand Down Expand Up @@ -3568,7 +3570,8 @@ mod test {
// Build an ACIR function which has the same logic as the Brillig function above
build_basic_foo_with_return(&mut builder, bar_id, false, InlineType::Fold);

let ssa = builder.finish();
let mut ssa = builder.finish();
ssa.globals = Function::new("globals".to_owned(), ssa.main_id);
// We need to generate Brillig artifacts for the regular Brillig function and pass them to the ACIR generation pass.
let brillig = ssa.to_brillig(false);
println!("{}", ssa);
Expand Down
14 changes: 12 additions & 2 deletions noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ pub(crate) mod brillig_black_box;
pub(crate) mod brillig_block;
pub(crate) mod brillig_block_variables;
pub(crate) mod brillig_fn;
pub(crate) mod brillig_globals;
pub(crate) mod brillig_slice_ops;
mod constant_allocation;
mod variable_liveness;

use acvm::FieldElement;
use fxhash::FxHashMap as HashMap;

use self::{brillig_block::BrilligBlock, brillig_fn::FunctionContext};
use super::{
brillig_ir::{
artifact::{BrilligArtifact, BrilligParameter, GeneratedBrillig, Label},
BrilligContext,
},
Brillig,
Brillig, BrilligVariable, ValueId,
};
use crate::{
errors::InternalError,
Expand All @@ -25,6 +27,7 @@ use crate::{
pub(crate) fn convert_ssa_function(
func: &Function,
enable_debug_trace: bool,
globals: &HashMap<ValueId, BrilligVariable>,
) -> BrilligArtifact<FieldElement> {
let mut brillig_context = BrilligContext::new(enable_debug_trace);

Expand All @@ -35,7 +38,13 @@ pub(crate) fn convert_ssa_function(
brillig_context.call_check_max_stack_depth_procedure();

for block in function_context.blocks.clone() {
BrilligBlock::compile(&mut function_context, &mut brillig_context, block, &func.dfg);
BrilligBlock::compile(
&mut function_context,
&mut brillig_context,
block,
&func.dfg,
globals,
);
}

let mut artifact = brillig_context.artifact();
Expand All @@ -53,6 +62,7 @@ pub(crate) fn gen_brillig_for(
arguments,
FunctionContext::return_values(func),
func.id(),
true,
);
entry_point.name = func.name().to_string();

Expand Down
Loading
Loading