-
Notifications
You must be signed in to change notification settings - Fork 226
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
chore(ci): Generate circuit benchmark summaries on PRs #3250
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5c3b420
chore(ci): add circuit size diff reporting
TomAFrench 71d8ce7
chore: update rayon to avoid stack overflow on eddsa
TomAFrench 85a5b83
chore: wait until nargo is built to run benchmarking
TomAFrench 8f95ad7
chore: fix typo
TomAFrench 8736d8a
chore: remove references to gas
TomAFrench 019ac5b
chore: disable eddsa in CI
TomAFrench 06358aa
chore: move gates report to repo root
TomAFrench File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Report gates diff | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
build-nargo: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: [x86_64-unknown-linux-gnu] | ||
|
||
steps: | ||
- name: Checkout Noir repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup toolchain | ||
uses: dtolnay/rust-toolchain@1.66.0 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: ${{ matrix.target }} | ||
cache-on-failure: true | ||
save-if: ${{ github.event_name != 'merge_group' }} | ||
|
||
- name: Build Nargo | ||
run: cargo build --package nargo_cli --release | ||
|
||
- name: Package artifacts | ||
run: | | ||
mkdir dist | ||
cp ./target/release/nargo ./dist/nargo | ||
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nargo | ||
path: ./dist/* | ||
retention-days: 3 | ||
|
||
|
||
compare_gas_reports: | ||
needs: [build-nargo] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Download nargo binary | ||
uses: actions/download-artifact@v3 | ||
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 gates report | ||
working-directory: ./tooling/nargo_cli/tests | ||
run: | | ||
./gates_report.sh | ||
mv gates_report.json ../../../gates_report.json | ||
|
||
- name: Compare gates reports | ||
id: gates_diff | ||
uses: TomAFrench/noir-gates-diff@e7cf131b7e7f044c01615f93f0b855f65ddc02d4 | ||
with: | ||
report: gates_report.json | ||
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) | ||
|
||
- name: Add gates diff to sticky comment | ||
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
# delete the comment in case changes no longer impact circuit sizes | ||
delete: ${{ !steps.gates_diff.outputs.markdown }} | ||
message: ${{ steps.gates_diff.outputs.markdown }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -88,6 +88,7 @@ | |
"prettytable", | ||
"printstd", | ||
"pseudocode", | ||
"quantile", | ||
"rustc", | ||
"rustup", | ||
"schnorr", | ||
|
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# These tests are incompatible with gas reporting | ||
excluded_dirs=("workspace" "workspace_default_member") | ||
|
||
# These tests cause failures in CI with a stack overflow for some reason. | ||
ci_excluded_dirs=("eddsa") | ||
|
||
current_dir=$(pwd) | ||
base_path="$current_dir/execution_success" | ||
test_dirs=$(ls $base_path) | ||
|
||
# We generate a Noir workspace which contains all of the test cases | ||
# This allows us to generate a gates report using `nargo info` for all of them at once. | ||
|
||
echo "[workspace]" > Nargo.toml | ||
echo "members = [" >> Nargo.toml | ||
|
||
for dir in $test_dirs; do | ||
if [[ " ${excluded_dirs[@]} " =~ " ${dir} " ]]; then | ||
continue | ||
fi | ||
|
||
if [[ ${CI-false} = "true" ]] && [[ " ${ci_excluded_dirs[@]} " =~ " ${dir} " ]]; then | ||
continue | ||
fi | ||
|
||
echo " \"execution_success/$dir\"," >> Nargo.toml | ||
done | ||
|
||
echo "]" >> Nargo.toml | ||
|
||
nargo info --json > gates_report.json | ||
|
||
rm Nargo.toml |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can change this in a followup PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we need to do some iterations before we can make a proper releases of the action.