From ee5e498ff0dc0b9a77ade68c3372517ba22d84ae Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sat, 12 Sep 2026 04:16:27 -0400 Subject: [PATCH 1/2] Add AirspeedVelocity benchmarking CI Adds a benchmark workflow (Julia 1 and lts) and a benchmark/benchmarks.jl suite covering representative workloads so PRs check for performance regressions. Co-Authored-By: Chris Rackauckas Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Agent-Harness: devin 3000.10.21 Agent-Model: SWE-2 Max Agent-Session: local session transcript /home/crackauc/.local/share/devin/cli/summaries/history_ccb52064e6514b21.md --- .github/workflows/benchmark.yml | 29 +++++++++++++++++++ benchmark/benchmarks.jl | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/benchmark.yml create mode 100644 benchmark/benchmarks.jl diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..7ffe9b5 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,29 @@ +name: Benchmark this PR + +on: + pull_request: + branches: [main] + paths-ignore: ['docs/**'] + +permissions: + pull-requests: write + contents: read + +jobs: + benchmark: + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + version: ["1", "lts"] + env: + # Force consistent Julia depot path for self-hosted runners + JULIA_DEPOT_PATH: ~/.julia + steps: + - uses: MilesCranmer/AirspeedVelocity.jl@action-v1 + with: + julia-version: ${{ matrix.version }} + script: "benchmark/benchmarks.jl" + extra-pkgs: "DifferentialEquations,Distributions,ModelingToolkit" + job-summary: true diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 0000000..95ff594 --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,50 @@ +using EasyModelAnalysis, BenchmarkTools +using DifferentialEquations, Distributions, ModelingToolkit +using ModelingToolkit: t_nounits as t, D_nounits as D + +const SUITE = BenchmarkGroup() + +@parameters σ ρ β +@variables x(t) y(t) z(t) + +eqs = [ + D(D(x)) ~ σ * (y - x), + D(y) ~ x * (ρ - z) - y, + D(z) ~ x * y - β * z, +] + +@mtkbuild sys = ODESystem(eqs, t) + +u0 = [D(x) => 2.0, x => 1.0, y => 0.0, z => 0.0] +p = [σ => 28.0, ρ => 10.0, β => 8 / 3] +tspan = (0.0, 50.0) +prob = ODEProblem(sys, u0, tspan, p; jac = true) +sol = solve(prob) + +t_measure = [0.0, 1.0, 2.0, 5.0, 10.0] + +# ============================================================================= +# Timeseries extraction and extremes +# ============================================================================= + +SUITE["timeseries"] = BenchmarkGroup() + +SUITE["timeseries"]["get_timeseries"] = @benchmarkable get_timeseries( + $prob, $x, $t_measure +) +SUITE["timeseries"]["get_min_t"] = @benchmarkable get_min_t($prob, $x) +SUITE["timeseries"]["get_max_t"] = @benchmarkable get_max_t($prob, $x) +SUITE["timeseries"]["stop_at_threshold"] = @benchmarkable stop_at_threshold( + $prob, $x, 5.0 +) + +# ============================================================================= +# Sensitivity analysis (Morris over parameter bounds) +# ============================================================================= + +SUITE["sensitivity"] = BenchmarkGroup() + +pbounds = [ρ => [0.0, 20.0], β => [0.0, 10.0]] +SUITE["sensitivity"]["morris"] = @benchmarkable EasyModelAnalysis.get_sensitivity( + $prob, 40.0, $y, $pbounds; samples = 100 +) From 21e64d24a32370726edf739b96ef009e4d8ec05b Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sat, 12 Sep 2026 05:14:40 -0400 Subject: [PATCH 2/2] Bump benchmark job timeout to 60 minutes The dep install + precompile plus benchmarking both the base and PR revs exceeds the 30 minute job timeout on this package's dependency tree. Co-Authored-By: Chris Rackauckas Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Agent-Harness: devin 3000.10.21 Agent-Model: SWE-2 Max Agent-Session: local session transcript /home/crackauc/.local/share/devin/cli/summaries/history_5872b13ce3ce43b6.md --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7ffe9b5..b714053 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -12,7 +12,7 @@ permissions: jobs: benchmark: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 60 strategy: fail-fast: false matrix: