From 1e64f8a7e0481f43f8afeb3dc3c33300f6fa5857 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 15:33:00 -0500 Subject: [PATCH] chore(ci): Unify compilation/execution report jobs that take averages with single runs (#7048) --- .github/workflows/reports.yml | 45 +++++++++-------------------- test_programs/compilation_report.sh | 8 +---- test_programs/execution_report.sh | 6 +--- 3 files changed, 15 insertions(+), 44 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 56e12b173a4..4207d1afffd 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -300,17 +300,17 @@ jobs: matrix: include: # - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-contracts, is_library: true } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner, take_average: true } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail, take_average: true } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset, take_average: true } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private, take_average: true } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public, take_average: true } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-merge, take_average: true } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner, num_runs: 5 } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail, num_runs: 5 } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset, num_runs: 5 } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private, num_runs: 5 } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public, num_runs: 5 } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-merge, num_runs: 5 } #- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-root-empty } #- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-single-tx } #- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-root } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-merge, take_average: true } - - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-root, take_average: true } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-merge, num_runs: 5 } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-root, num_runs: 5 } name: External repo compilation and execution reports - ${{ matrix.project.repo }}/${{ matrix.project.path }} steps: @@ -344,41 +344,22 @@ jobs: path: test-repo ref: ${{ matrix.project.ref }} - - name: Generate compilation report without averages + - name: Generate compilation report working-directory: ./test-repo/${{ matrix.project.path }} - if: ${{ !matrix.project.take_average }} run: | mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh touch parse_time.sh chmod +x parse_time.sh cp /home/runner/work/noir/noir/scripts/test_programs/parse_time.sh ./parse_time.sh - ./compilation_report.sh 1 - - - name: Generate compilation report with averages - working-directory: ./test-repo/${{ matrix.project.path }} - if: ${{ matrix.project.take_average }} - run: | - mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh - touch parse_time.sh - chmod +x parse_time.sh - cp /home/runner/work/noir/noir/scripts/test_programs/parse_time.sh ./parse_time.sh - ./compilation_report.sh 1 1 + ./compilation_report.sh 1 ${{ matrix.project.num_runs }} - - name: Generate execution report without averages + - name: Generate execution report working-directory: ./test-repo/${{ matrix.project.path }} - if: ${{ !matrix.project.is_library && !matrix.project.take_average }} - run: | - mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh - mv /home/runner/work/noir/noir/scripts/test_programs/parse_time.sh ./parse_time.sh - ./execution_report.sh 1 - - - name: Generate execution report with averages - working-directory: ./test-repo/${{ matrix.project.path }} - if: ${{ !matrix.project.is_library && matrix.project.take_average }} + if: ${{ !matrix.project.is_library }} run: | mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh mv /home/runner/work/noir/noir/scripts/test_programs/parse_time.sh ./parse_time.sh - ./execution_report.sh 1 1 + ./execution_report.sh 1 ${{ matrix.project.num_runs }} - name: Move compilation report id: compilation_report diff --git a/test_programs/compilation_report.sh b/test_programs/compilation_report.sh index df15ef00008..b12e3984740 100755 --- a/test_programs/compilation_report.sh +++ b/test_programs/compilation_report.sh @@ -37,15 +37,9 @@ for dir in ${tests_to_profile[@]}; do PACKAGE_NAME=$(basename $current_dir) fi - NUM_RUNS=1 + NUM_RUNS=$2 TOTAL_TIME=0 - # Passing a second argument will take an average of five runs - # rather than - if [ "$2" == "1" ]; then - NUM_RUNS=5 - fi - for ((i = 1; i <= NUM_RUNS; i++)); do NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo compile --force --silence-warnings done diff --git a/test_programs/execution_report.sh b/test_programs/execution_report.sh index b929c367f7d..827b7806d37 100755 --- a/test_programs/execution_report.sh +++ b/test_programs/execution_report.sh @@ -46,12 +46,8 @@ for dir in ${tests_to_profile[@]}; do fi - NUM_RUNS=1 + NUM_RUNS=$2 TOTAL_TIME=0 - - if [ "$2" == "1" ]; then - NUM_RUNS=5 - fi for ((i = 1; i <= NUM_RUNS; i++)); do NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo execute --silence-warnings