Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2299096
feat(bench): torc integration for benchmark orchestration (#159)
pesap Apr 13, 2026
f8b3e4f
feat(bench): monitor workflow benchmarks with rmon
pesap Apr 13, 2026
17cec59
chore(benchmarks): remove arco-bench crate
pesap Apr 14, 2026
f32e657
feat(benchmarks): add CLI benchmark runner using rmon
pesap Apr 14, 2026
13f5417
chore: remove obsolete benchmark conversion script
pesap Apr 14, 2026
3484cfc
ci: always upload artifacts even on benchmark failure
pesap Apr 14, 2026
602040b
ci: add caching for rmon, arco-cli, and rust toolchain
pesap Apr 14, 2026
3d52423
chore: removing benchmarks from repo will migrate to another
pesap Apr 14, 2026
249d230
fix(ty): fixing ty.
pesap Apr 14, 2026
895ee0a
chore: removing wrong file
pesap Apr 14, 2026
24674c0
chore: making more exploirable the example
pesap Apr 14, 2026
ae33687
refactor: comprehensive codebase quality cleanup
pesap Apr 15, 2026
23b5ef8
fixup! refactor: comprehensive codebase quality cleanup
pesap Apr 15, 2026
5a70160
docs: updating readme for examples
pesap Apr 14, 2026
8e567cd
fix: apply fixes
pesap Apr 15, 2026
dc2a667
fix: removing slop
pesap Apr 15, 2026
3cb3e3a
fix: ci and linting errors
pesap Apr 15, 2026
f8bc90c
fix: benchmark was failing
pesap Apr 15, 2026
d6d26d9
fix: adding fix for runner
pesap Apr 15, 2026
c7bb965
fix: Issue 169
pesap Apr 15, 2026
847addd
fix: benchmark binary location
pesap Apr 15, 2026
0c5daab
fix: benchmark ci work
pesap Apr 16, 2026
d720a61
fix: rmon measurementtt check
pesap Apr 16, 2026
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
74 changes: 57 additions & 17 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- "Cargo.toml"
- "Cargo.lock"
- "justfile"
- "scripts/bench.py"
- "benchmarks/**"
- ".github/workflows/benchmarks.yaml"
push:
branches:
Expand All @@ -16,6 +18,8 @@ on:
- "Cargo.toml"
- "Cargo.lock"
- "justfile"
- "scripts/bench.py"
- "benchmarks/**"
- ".github/workflows/benchmarks.yaml"
workflow_dispatch:

Expand All @@ -32,12 +36,16 @@ env:
JUST_VERSION: "1.43.0"
PYTHON_LATEST: "3.12"
RUST_TOOLCHAIN_VERSION: "1.85"
# Enable sparse index for faster crate resolution
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# Faster cargo builds
CARGO_INCREMENTAL: 1

jobs:
benchmark:
name: Run benchmarks
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 20
permissions:
contents: read
pull-requests: write # Required to post benchmark summaries/comments back to the PR.
Expand All @@ -46,43 +54,75 @@ jobs:
with:
persist-credentials: false

# Cache 1: rmon binary (saves ~20-40s avoiding git install)
- name: Cache rmon binary
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
id: rmon-cache
with:
path: ~/.local/bin/rmon
key: ${{ runner.os }}-rmon-${{ hashFiles('.github/workflows/benchmarks.yaml') }}
restore-keys: |
${{ runner.os }}-rmon-
- name: Set up build environment
uses: ./.github/actions/setup-build-env
with:
python-version: ${{ env.PYTHON_LATEST }}
uv-version: ${{ env.UV_VERSION }}
just-version: ${{ env.JUST_VERSION }}
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
install-uv: "true"
sync-python-licenses: "false"
save-rust-cache: "false"
rust-cache-shared-key: rust-bench
# Cache 3: Pre-built arco-cli binary (saves ~2-5min when Cargo.lock unchanged)
- name: Cache arco-cli binary
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
id: arco-binary-cache
with:
path: target/release/arco
key: ${{ runner.os }}-arco-cli-${{ hashFiles('Cargo.lock', 'crates/arco-cli/**', 'crates/arco_*/**') }}
restore-keys: |
${{ runner.os }}-arco-cli-

- name: Run arco-bench
timeout-minutes: 20
- name: Build arco CLI
if: steps.arco-binary-cache.outputs.cache-hit != 'true'
run: cargo build --release -p arco-cli

- name: Ensure rmon is installed
run: |
cargo run --release -p arco-bench -- run \
--scenario model-build,kdl-compile \
--cases 100,1000,10000,100000 \
--repetitions 3 \
--output bench-results.jsonl
if [ ! -x "$HOME/.local/bin/rmon" ]; then
uv tool install --force git+https://github.com/NatLabRockies/resource_monitor
fi
"$HOME/.local/bin/rmon" --version

- name: Convert results to benchmark action format
run: uv run scripts/convert_bench_to_github.py bench-results.jsonl
benchmark-results.json
# Ensure rmon is in PATH even if cached
- name: Add local bin to PATH
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"

- name: Run CLI benchmarks
timeout-minutes: 15
run: |
python scripts/bench.py \
--arco-binary target/release/arco \
--workflows validate,run \
--repetitions 3 \
--output artifacts/benchmark-results.json

# Cache 4: Benchmark data for trend analysis (already exists, but optimized key)
- name: Restore previous benchmark data
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
id: benchmark-data-restore
with:
path: ./cache
key: ${{ runner.os }}-benchmark
restore-keys: ${{ runner.os }}-benchmark
key: ${{ runner.os }}-benchmark-${{ github.ref_name }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-benchmark-main-
${{ runner.os }}-benchmark-

- name: Store benchmark results
uses: benchmark-action/github-action-benchmark@a60cea5bc7b49e15c1f58f411161f99e0df48372 # v1.22.0
with:
tool: customSmallerIsBetter
output-file-path: benchmark-results.json
output-file-path: artifacts/benchmark-results.json
external-data-json-path: ./cache/benchmark-data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
summary-always: true
Expand All @@ -91,8 +131,8 @@ jobs:
fail-on-alert: true

- name: Save benchmark data
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && steps.benchmark-data-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: ./cache
key: ${{ runner.os }}-benchmark
key: ${{ runner.os }}-benchmark-${{ github.ref_name }}-${{ github.run_id }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
uv-version: ${{ env.UV_VERSION }}
just-version: ${{ env.JUST_VERSION }}
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
install-uv: "false"
install-uv: "true"
sync-python-licenses: "false"
rust-cache-shared-key: rust-clippy
save-rust-cache: "false"
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -590,3 +590,5 @@ benchmarks/output/
!examples/capacity-expansion/data/*.csv
!examples/price-taker-battery/data/*.csv
!examples/simple-electricity-market-storage/data/*.csv
!examples/dense-lp/data/*.csv
.plans/
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
members = ["crates/*", "bindings/python"]
exclude = ["scripts"]
default-members = [
"crates/arco-bench",
"crates/arco-blocks",
"crates/arco-cli",
"crates/arco-core",
"crates/arco-expr",
"crates/arco-highs",
"crates/arco-kdl",
"crates/arco-solver",
"crates/arco-solver-types",
"crates/arco-tools",
"crates/arco-xpress",
]
Expand All @@ -33,6 +33,7 @@ arco-tools = { path = "crates/arco-tools" }
arco-blocks = { path = "crates/arco-blocks" }
arco-kdl = { path = "crates/arco-kdl" }
arco-cli = { path = "crates/arco-cli" }
arco-solver-types = { path = "crates/arco-solver-types" }

[workspace.package]
version = "0.4.0"
Expand Down
24 changes: 3 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,25 +488,6 @@ graph TB
| `arco-highs` | HiGHS solver integration (embedded) |
| `arco-blocks` | DAG-based block composition and orchestration |
| `arco-tools` | Memory instrumentation and diagnostics |
| `arco-bench` | Benchmarking framework for regression testing |

## Benchmarking

Use `arco-bench` to run performance benchmarks and catch regressions:

```bash
# Run default benchmark scenarios
just bench-run

# Run with custom parameters
just bench-run --scenario model-build,fac25 --cases 1000,10000 --repetitions 3

# Generate report
just bench-report artifacts/bench/results.jsonl

# Compare and gate on regressions
just bench-gate baseline.jsonl candidate.jsonl 5 5
```

## Contributing

Expand All @@ -522,9 +503,10 @@ just clippy # Run linter
just check # Type-check workspace

# Testing
just test # Run Rust tests
just test # Run Rust tests + curated CLI example smoke checks
just test-example-formulations # Run only curated CLI example smoke checks
just test-example-formulations "--examples dense-lp --commands run --fail-fast" # Debug a single workflow
just py-test # Run Python doctests

# Full CI gate
just ci
```
Expand Down
Loading
Loading