From c4b2fc07ec6c30e75cdb0bcec38c9de2d89b39a5 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sat, 12 Sep 2026 05:07:43 -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_5872b13ce3ce43b6.md --- .github/workflows/benchmark.yml | 29 ++++++++++++++++++++ benchmark/benchmarks.jl | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 76 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 00000000..0e234268 --- /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: "ModelingToolkit,OrdinaryDiffEq" + job-summary: true diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 00000000..86ba1da8 --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,47 @@ +using BenchmarkTools +using ModelingToolkit +using ModelingToolkit: t_nounits as t +using ModelingToolkitStandardLibrary.Electrical +using ModelingToolkitStandardLibrary.Blocks: Sine +using OrdinaryDiffEq + +const SUITE = BenchmarkGroup() + +function rc_circuit() + @named source = Sine(offset = 1, amplitude = 10, frequency = 5) + @named voltage = Voltage() + @named resistor = Resistor(R = 1) + @named capacitor = Capacitor(C = 1, v = 0.0) + @named ground = Ground() + @named voltage_sensor = VoltageSensor() + @named current_sensor = CurrentSensor() + + connections = [ + connect(source.output, voltage.V) + connect(voltage.p, resistor.p) + connect(resistor.n, current_sensor.p) + connect(current_sensor.n, capacitor.p) + connect(capacitor.n, voltage.n, ground.g) + connect(capacitor.p, voltage_sensor.p) + connect(capacitor.n, voltage_sensor.n) + ] + + return System( + connections, t; + systems = [ + resistor, capacitor, source, voltage, ground, + voltage_sensor, current_sensor, + ], name = :rc_circuit + ) +end + +SUITE["rc_circuit"] = BenchmarkGroup() +SUITE["rc_circuit"]["build"] = @benchmarkable rc_circuit() +model = rc_circuit() +SUITE["rc_circuit"]["mtkcompile"] = @benchmarkable mtkcompile($model) +sys = mtkcompile(model) +SUITE["rc_circuit"]["odeproblem"] = @benchmarkable ODEProblem($sys, [], (0.0, 10.0)) +prob = ODEProblem(sys, [], (0.0, 10.0)) +SUITE["rc_circuit"]["solve"] = @benchmarkable solve( + $prob, Tsit5(); save_everystep = false, abstol = 1.0e-8, reltol = 1.0e-8 +) From dcfd8bfa1125e3d9dfbee233283405f679d26f3e Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sat, 12 Sep 2026 05:15:01 -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 0e234268..cfc9f345 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: