Skip to content

Commit 197bb73

Browse files
Merge branch 'feat/new-execution' into feat/edwards-curve-new-execution
2 parents 2e59e6f + a6be3df commit 197bb73

File tree

368 files changed

+27793
-21873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+27793
-21873
lines changed

.config/nextest.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Nextest configuration for OpenVM project
2+
3+
# Define test groups with different weights
4+
[[profile.default.overrides]]
5+
# Match all tests with "persistent" in their name
6+
filter = 'test(~persistent)'
7+
# Give these tests 5x the default weight because they use more memory
8+
threads-required = 16
9+
10+
# custom profile for heavy tests
11+
[profile.heavy]
12+
# Run fewer tests in parallel for heavy workloads
13+
test-threads = 2

.github/workflows/benchmark-call.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,15 @@ jobs:
250250
fi
251251
252252
##########################################################################
253-
# Update s3 for latest main metrics upon a push event #
253+
# Update s3 for latest branch metrics upon a push event #
254254
##########################################################################
255-
- name: Update latest main result in s3
256-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
255+
- name: Update latest branch result in s3
256+
if: github.event_name == 'push'
257257
run: |
258-
s5cmd cp $METRIC_PATH "${{ env.S3_METRICS_PATH }}/main-${METRIC_NAME}.json"
258+
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
259+
# for backwards compatibility
260+
REF_HASH="main"
261+
else
262+
REF_HASH=$(echo "${{ github.ref }}" | sha256sum | cut -d' ' -f1)
263+
fi
264+
s5cmd cp $METRIC_PATH "${{ env.S3_METRICS_PATH }}/${REF_HASH}-${METRIC_NAME}.json"
Lines changed: 67 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
name: "benchmarks-execute"
1+
name: "Execution benchmarks"
22

33
on:
44
push:
5-
branches: ["main"]
5+
# TODO(ayush): remove after feat/new-execution is merged
6+
branches: ["main", "feat/new-execution"]
67
pull_request:
78
types: [opened, synchronize, reopened, labeled]
89
branches: ["**"]
@@ -18,95 +19,83 @@ on:
1819
- ".github/workflows/benchmarks-execute.yml"
1920
workflow_dispatch:
2021

22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
24+
cancel-in-progress: true
25+
2126
env:
2227
CARGO_TERM_COLOR: always
2328

2429
jobs:
25-
execute-benchmarks:
30+
codspeed-walltime-benchmarks:
31+
name: Run codspeed walltime benchmarks
2632
runs-on:
2733
- runs-on=${{ github.run_id }}
28-
- runner=8cpu-linux-x64
34+
- family=m5a.xlarge # 2.5Ghz clock speed
35+
- image=ubuntu24-full-x64
36+
- extras=s3-cache
37+
38+
env:
39+
CODSPEED_RUNNER_MODE: walltime
40+
2941
steps:
42+
- uses: runs-on/action@v1
3043
- uses: actions/checkout@v4
31-
32-
- name: Set up Rust
33-
uses: actions-rs/toolchain@v1
44+
- uses: dtolnay/rust-toolchain@stable
45+
- uses: Swatinem/rust-cache@v2
3446
with:
35-
profile: minimal
36-
toolchain: stable
37-
override: true
47+
cache-on-failure: true
3848

39-
- name: Run execution benchmarks
40-
working-directory: benchmarks/execute
41-
run: cargo run | tee benchmark_output.log
49+
- name: Install cargo-binstall
50+
uses: cargo-bins/cargo-binstall@main
51+
- name: Install codspeed
52+
run: cargo binstall --no-confirm --force cargo-codspeed
4253

43-
- name: Parse benchmark results
54+
- name: Build benchmarks
4455
working-directory: benchmarks/execute
45-
run: |
46-
# Determine if running in GitHub Actions environment
47-
if [ -n "$GITHUB_STEP_SUMMARY" ]; then
48-
SUMMARY_FILE="$GITHUB_STEP_SUMMARY"
49-
echo "### Benchmark Results Summary" >> "$SUMMARY_FILE"
50-
else
51-
SUMMARY_FILE="benchmark_summary.md"
52-
echo "### Benchmark Results Summary" > "$SUMMARY_FILE"
53-
echo "Saving summary to $SUMMARY_FILE"
54-
fi
55-
56-
# Set up summary table header
57-
echo "| Program | Total Time (ms) |" >> "$SUMMARY_FILE"
58-
echo "| ------- | --------------- |" >> "$SUMMARY_FILE"
59-
60-
# Variables to track current program and total time
61-
current_program=""
62-
total_time=0
63-
64-
# Process the output file line by line
65-
while IFS= read -r line; do
66-
# Check if line contains "Running program" message
67-
if [[ $line =~ i\ \[info\]:\ Running\ program:\ ([a-zA-Z0-9_-]+) ]]; then
68-
# If we were processing a program, output its results
69-
if [[ -n "$current_program" ]]; then
70-
echo "| $current_program | $total_time |" >> "$SUMMARY_FILE"
71-
fi
72-
73-
# Start tracking new program
74-
current_program="${BASH_REMATCH[1]}"
75-
total_time=0
76-
fi
77-
78-
# Check for program completion to catch programs that might have no execution segments
79-
if [[ $line =~ i\ \[info\]:\ Completed\ program:\ ([a-zA-Z0-9_-]+) ]]; then
80-
completed_program="${BASH_REMATCH[1]}"
81-
# If no segments were found for this program, ensure it's still in the output
82-
if [[ "$current_program" == "$completed_program" && $total_time == 0 ]]; then
83-
echo "| $current_program | 0 |" >> "$SUMMARY_FILE"
84-
current_program=""
85-
fi
86-
fi
87-
88-
# Check if line contains execution time (looking for the format with ms or s)
89-
if [[ $line =~ execute_segment\ \[\ ([0-9.]+)(ms|s)\ \|\ [0-9.]+%\ \]\ segment ]]; then
90-
segment_time="${BASH_REMATCH[1]}"
91-
unit="${BASH_REMATCH[2]}"
56+
run: cargo codspeed build
57+
- name: Run benchmarks
58+
uses: CodSpeedHQ/action@v3
59+
with:
60+
working-directory: benchmarks/execute
61+
run: cargo codspeed run
62+
token: ${{ secrets.CODSPEED_TOKEN }}
63+
env:
64+
CODSPEED_RUNNER_MODE: walltime
65+
66+
codspeed-instrumentation-benchmarks:
67+
name: Run codspeed instrumentation benchmarks
68+
runs-on:
69+
- runs-on=${{ github.run_id }}
70+
- family=m5a.xlarge
71+
- image=ubuntu24-full-x64
72+
- extras=s3-cache
73+
if: github.event_name != 'pull_request'
9274

93-
# Convert to milliseconds if in seconds
94-
if [[ "$unit" == "s" ]]; then
95-
segment_time=$(echo "scale=6; $segment_time * 1000" | bc)
96-
fi
75+
env:
76+
CODSPEED_RUNNER_MODE: instrumentation
9777

98-
# Add segment time to total
99-
total_time=$(echo "scale=6; $total_time + $segment_time" | bc)
100-
fi
101-
done < benchmark_output.log
78+
steps:
79+
- uses: runs-on/action@v1
80+
- uses: actions/checkout@v4
81+
- uses: dtolnay/rust-toolchain@stable
82+
- uses: Swatinem/rust-cache@v2
83+
with:
84+
cache-on-failure: true
10285

103-
# Output the last program result if there was one
104-
if [[ -n "$current_program" ]]; then
105-
echo "| $current_program | $total_time |" >> "$SUMMARY_FILE"
106-
fi
86+
- name: Install cargo-binstall
87+
uses: cargo-bins/cargo-binstall@main
88+
- name: Install codspeed
89+
run: cargo binstall --no-confirm --force cargo-codspeed
10790

108-
# If not in GitHub Actions, print the summary to the terminal
109-
if [ -z "$GITHUB_STEP_SUMMARY" ]; then
110-
echo -e "\nBenchmark Summary:"
111-
cat "$SUMMARY_FILE"
112-
fi
91+
- name: Build benchmarks
92+
working-directory: benchmarks/execute
93+
run: cargo codspeed build
94+
- name: Run benchmarks
95+
uses: CodSpeedHQ/action@v3
96+
with:
97+
working-directory: benchmarks/execute
98+
run: cargo codspeed run
99+
token: ${{ secrets.CODSPEED_TOKEN }}
100+
env:
101+
CODSPEED_RUNNER_MODE: instrumentation

.github/workflows/benchmarks.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "OpenVM Benchmarks: Coordinate Runner & Reporting"
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: ["main", "feat/new-execution"]
66
pull_request:
77
types: [opened, synchronize, reopened, labeled]
88
branches: ["**"]
@@ -211,9 +211,21 @@ jobs:
211211
json_file_list=$(echo -n "$json_files" | paste -sd "," -)
212212
echo $json_file_list
213213
214-
prev_json_files=$(echo $matrix | jq -r '
214+
# For PRs, get the latest commit from the target branch
215+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
216+
if [[ "${{ github.base_ref }}" == "main" ]]; then
217+
REF_HASH="main"
218+
else
219+
REF_HASH=$(echo "refs/heads/${{ github.base_ref }}" | sha256sum | cut -d' ' -f1)
220+
fi
221+
echo "Target branch REF_HASH: $REF_HASH"
222+
else
223+
REF_HASH="main"
224+
fi
225+
226+
prev_json_files=$(echo $matrix | jq -r --arg target "$REF_HASH" '
215227
.[] |
216-
"main-\(.id).json"')
228+
"\($target)-\(.id).json"')
217229
prev_json_file_list=$(echo -n "$prev_json_files" | paste -sd "," -)
218230
echo $prev_json_file_list
219231

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
runs-on:
1717
- runs-on=${{ github.run_id }}
1818
- runner=64cpu-linux-arm64
19+
- image=ubuntu24-full-arm64
1920
- extras=s3-cache
2021
steps:
2122
- uses: runs-on/action@v1

.github/workflows/cli.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
runs-on:
3737
- runs-on=${{ github.run_id }}
3838
- disk=large
39-
- runner=32cpu-linux-arm64
39+
- runner=64cpu-linux-arm64
40+
- image=ubuntu24-full-arm64
4041
- extras=s3-cache
4142

4243
steps:
@@ -47,7 +48,8 @@ jobs:
4748
cache-on-failure: true
4849
- uses: taiki-e/install-action@nextest
4950
- name: Install solc # svm should support arm64 linux
50-
run: (hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.19 && solc --version
51+
run: |
52+
(hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.19 && solc --version
5153
5254
- name: Install cargo-openvm
5355
working-directory: crates/cli
@@ -80,8 +82,7 @@ jobs:
8082
working-directory: crates/cli
8183
run: |
8284
export RUST_BACKTRACE=1
83-
cargo build
84-
cargo run --bin cargo-openvm -- openvm keygen --config ./example/app_config.toml --output-dir .
85+
cargo openvm keygen --config ./example/app_config.toml --output-dir .
8586
8687
- name: Set USE_LOCAL_OPENVM environment variable
8788
run: |
@@ -94,4 +95,5 @@ jobs:
9495
- name: Run CLI tests
9596
working-directory: crates/cli
9697
run: |
97-
cargo nextest run --cargo-profile=fast
98+
export SKIP_INSTALL=1
99+
cargo nextest run --cargo-profile=fast --test-threads=1

.github/workflows/extension-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
runs-on:
4141
- runs-on=${{ github.run_id }}
4242
- runner=64cpu-linux-arm64
43+
- image=ubuntu24-full-arm64
4344
- tag=extension-${{ matrix.extension.name }}
4445
- extras=s3-cache
4546

@@ -69,7 +70,7 @@ jobs:
6970

7071
- name: Run ${{ matrix.extension.name }} circuit crate tests
7172
working-directory: extensions/${{ matrix.extension.path }}/circuit
72-
run: cargo nextest run --cargo-profile=fast
73+
run: cargo nextest run --cargo-profile=fast --test-threads=32
7374

7475
- name: Run ${{ matrix.extension.name }} guest crate tests
7576
if: hashFiles(format('extensions/{0}/guest', matrix.extension.path)) != ''
@@ -86,4 +87,4 @@ jobs:
8687
working-directory: extensions/${{ matrix.extension.path }}/tests
8788
run: |
8889
rustup component add rust-src --toolchain nightly-2025-02-14
89-
cargo nextest run --cargo-profile=fast --no-tests=pass
90+
cargo nextest run --cargo-profile=fast --profile=heavy --no-tests=pass

.github/workflows/guest-lib-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
runs-on:
4242
- runs-on=${{ github.run_id }}
4343
- runner=64cpu-linux-arm64
44+
- image=ubuntu24-full-arm64
4445
- tag=crate-${{ matrix.crate.name }}
4546
- extras=s3-cache
4647

.github/workflows/native-compiler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
runs-on:
2626
- runs-on=${{ github.run_id }}
2727
- runner=64cpu-linux-arm64
28+
- image=ubuntu24-full-arm64
2829
- extras=s3-cache
2930

3031
steps:

.github/workflows/primitives.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
runs-on:
2727
- runs-on=${{ github.run_id }}
2828
- runner=32cpu-linux-arm64
29+
- image=ubuntu24-full-arm64
2930
- extras=s3-cache
3031

3132
steps:

0 commit comments

Comments
 (0)