Skip to content

Commit

Permalink
chore: Try replace callstack with a linked list (noir-lang/noir#6747)
Browse files Browse the repository at this point in the history
chore: Use `NumericType` not `Type` for casts and numeric constants (noir-lang/noir#6769)
chore(ci): Extend compiler memory report to external repos (noir-lang/noir#6768)
chore(ci): Handle external libraries in compilation timing report (noir-lang/noir#6750)
feat(ssa): Implement missing brillig constraints SSA check (noir-lang/noir#6658)
fix: Do not merge expressions that contain output witnesses (noir-lang/noir#6757)
fix: parser would hand on function type with colon in it (noir-lang/noir#6764)
chore(docs): Update branding (noir-lang/noir#6759)
feat(cli): Run command on the package closest to the current directory (noir-lang/noir#6752)
chore: lock CI to use ubuntu 22.04 (noir-lang/noir#6755)
chore: free memory for silenced warnings early (noir-lang/noir#6748)
chore(stdlib)!: Remove Schnorr (noir-lang/noir#6749)
fix: Improve type error when indexing a variable of unknown type (noir-lang/noir#6744)
fix: println("{{}}") was printing "{{}}" instead of "{}" (noir-lang/noir#6745)
feat: `std::hint::black_box` function. (noir-lang/noir#6529)
feat(ci): Initial compilation report on test_programs (noir-lang/noir#6731)
chore: Cleanup unrolling pass (noir-lang/noir#6743)
fix: allow empty loop headers (noir-lang/noir#6736)
fix: map entry point indexes after all ssa passes (noir-lang/noir#6740)
chore: Update url to 2.5.4 (noir-lang/noir#6741)
feat: Order attribute execution by their source ordering (noir-lang/noir#6326)
feat(test): Check that `nargo::ops::transform_program` is idempotent (noir-lang/noir#6694)
feat: Sync from aztec-packages (noir-lang/noir#6730)
  • Loading branch information
AztecBot committed Dec 11, 2024
2 parents 9c79a87 + f73299e commit 17e7f3b
Show file tree
Hide file tree
Showing 50 changed files with 1,700 additions and 469 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f9abf724abd674ea4ccb342a770d237c70864ee1
f6957faf50025afc053a32d86398d0823253066b
27 changes: 27 additions & 0 deletions noir/noir-repo/.github/scripts/merge-bench-reports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -eu

echo "Merging reports"

REPORT_NAME=$1
NAME_PLURAL=""$REPORT_NAME"s"

combined_reports="[]"

# Iterate over each report and merge them
for report in ./reports/*; do
# The report is saved under ./$REPORT_NAME_{ matrix_report }/$REPORT_NAME_{ matrix_report }.json
FILE_PATH=$(echo $(ls $report))

# Extract the $NAME_PLURAL array from each report and merge it
combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report/$FILE_PATH")")
done

combined_reports=$(jq '[."'$NAME_PLURAL'"[]] + '"$combined_reports" <<< "$(cat ./$REPORT_NAME.json)")

# Wrap the merged memory reports into a new object as to keep the $NAME_PLURAL key
final_report="{\"$NAME_PLURAL\": $combined_reports}"

echo "$final_report" > $REPORT_NAME.json

cat $REPORT_NAME.json
260 changes: 259 additions & 1 deletion noir/noir-repo/.github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
path: ./dist/*
retention-days: 3


compare_gates_reports:
name: Circuit sizes
needs: [build-nargo]
Expand Down Expand Up @@ -218,6 +217,265 @@ jobs:
./memory_report.sh
mv memory_report.json ../memory_report.json
- name: Upload memory report
uses: actions/upload-artifact@v4
with:
name: in_progress_memory_report
path: memory_report.json
retention-days: 3
overwrite: true

generate_compilation_report:
name: Compilation time
needs: [build-nargo]
runs-on: ubuntu-22.04
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Download nargo binary
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Generate Compilation report
working-directory: ./test_programs
run: |
./compilation_report.sh
cat compilation_report.json
mv compilation_report.json ../compilation_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

external_repo_compilation_report:
needs: [build-nargo]
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-root }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset }
# TODO: Bring these back once they no longer time out
# - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private }
# - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public }

name: External repo compilation report - ${{ matrix.project.repo }}/${{ matrix.project.path }}
steps:
- name: Download nargo binary
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- uses: actions/checkout@v4
with:
path: scripts
sparse-checkout: |
test_programs/compilation_report.sh
sparse-checkout-cone-mode: false

- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ matrix.project.repo }}
path: test-repo
ref: ${{ matrix.project.ref }}

- name: Generate compilation report
working-directory: ./test-repo/${{ matrix.project.path }}
run: |
mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh
chmod +x ./compilation_report.sh
./compilation_report.sh 1
- name: Move compilation report
id: report
shell: bash
run: |
PACKAGE_NAME=${{ matrix.project.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.project.path }}/compilation_report.json ./compilation_report_$PACKAGE_NAME.json
echo "compilation_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
name: compilation_report_${{ steps.report.outputs.compilation_report_name }}
path: compilation_report_${{ steps.report.outputs.compilation_report_name }}.json
retention-days: 3
overwrite: true

upload_compilation_report:
name: Upload compilation report
needs: [generate_compilation_report, external_repo_compilation_report]
# We want this job to run even if one variation of the matrix in `external_repo_compilation_report` fails
if: always()
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Download initial compilation report
uses: actions/download-artifact@v4
with:
name: in_progress_compilation_report

- name: Download matrix compilation reports
uses: actions/download-artifact@v4
with:
pattern: compilation_report_*
path: ./reports

- name: Merge compilation reports using jq
run: |
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh compilation_report
- name: Parse compilation report
id: compilation_report
uses: noir-lang/noir-bench-report@0d7464a8c39170523932d7846b6e6b458a294aea
with:
report: compilation_report.json
header: |
# Compilation Report
memory_report: false

- name: Add memory report to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: compilation
message: ${{ steps.compilation_report.outputs.markdown }}

external_repo_memory_report:
needs: [build-nargo]
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
# TODO: Bring this report back under a flag. The `noir-contracts` report takes just under 30 minutes.
# - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/parity-root }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset }
- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail }

name: External repo memory report - ${{ matrix.project.repo }}/${{ matrix.project.path }}
steps:
- name: Download nargo binary
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- uses: actions/checkout@v4
with:
path: scripts
sparse-checkout: |
test_programs/memory_report.sh
sparse-checkout-cone-mode: false

- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ matrix.project.repo }}
path: test-repo
ref: ${{ matrix.project.ref }}

- name: Generate compilation report
working-directory: ./test-repo/${{ matrix.project.path }}
run: |
mv /home/runner/work/noir/noir/scripts/test_programs/memory_report.sh ./memory_report.sh
chmod +x ./memory_report.sh
./memory_report.sh 1
- name: Move compilation report
id: report
shell: bash
run: |
PACKAGE_NAME=${{ matrix.project.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.project.path }}/memory_report.json ./memory_report_$PACKAGE_NAME.json
echo "memory_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Upload memory report
uses: actions/upload-artifact@v4
with:
name: memory_report_${{ steps.report.outputs.memory_report_name }}
path: memory_report_${{ steps.report.outputs.memory_report_name }}.json
retention-days: 3
overwrite: true

upload_memory_report:
name: Upload 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
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Download initial memory report
uses: actions/download-artifact@v4
with:
name: in_progress_memory_report

- name: Download matrix memory reports
uses: actions/download-artifact@v4
with:
pattern: memory_report_*
path: ./reports

- name: Merge memory reports using jq
run: |
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh memory_report
- name: Parse memory report
id: memory_report
uses: noir-lang/noir-bench-report@0d7464a8c39170523932d7846b6e6b458a294aea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
name: nextest-archive
- name: Run tests
run: |
RUST_MIN_STACK=8388608 \
cargo nextest run --archive-file nextest-archive.tar.zst \
--partition count:${{ matrix.partition }}/4 \
--no-fail-fast
Expand Down
1 change: 1 addition & 0 deletions noir/noir-repo/.github/workflows/test-rust-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
name: nextest-archive
- name: Run tests
run: |
RUST_MIN_STACK=8388608 \
cargo nextest run --archive-file nextest-archive.tar.zst \
--partition count:${{ matrix.partition }}/4 \
--no-fail-fast
Expand Down
24 changes: 23 additions & 1 deletion noir/noir-repo/Cargo.lock

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

7 changes: 7 additions & 0 deletions noir/noir-repo/compiler/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ pub struct CompileOptions {
#[arg(long)]
pub skip_underconstrained_check: bool,

/// Flag to turn off the compiler check for missing Brillig call constrains.
/// Warning: This can improve compilation speed but can also lead to correctness errors.
/// This check should always be run on production code.
#[arg(long)]
pub skip_brillig_constraints_check: bool,

/// Setting to decide on an inlining strategy for Brillig functions.
/// A more aggressive inliner should generate larger programs but more optimized
/// A less aggressive inliner should generate smaller programs
Expand Down Expand Up @@ -631,6 +637,7 @@ pub fn compile_no_check(
},
emit_ssa: if options.emit_ssa { Some(context.package_build_path.clone()) } else { None },
skip_underconstrained_check: options.skip_underconstrained_check,
skip_brillig_constraints_check: options.skip_brillig_constraints_check,
inliner_aggressiveness: options.inliner_aggressiveness,
max_bytecode_increase_percent: options.max_bytecode_increase_percent,
};
Expand Down
1 change: 1 addition & 0 deletions noir/noir-repo/compiler/noirc_evaluator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cfg-if.workspace = true
[dev-dependencies]
proptest.workspace = true
similar-asserts.workspace = true
tracing-test = "0.2.5"
num-traits.workspace = true
test-case.workspace = true

Expand Down
Loading

0 comments on commit 17e7f3b

Please sign in to comment.