From c2a03ab37af3d0aee85ff502616cdbe8df4860eb Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Fri, 11 Sep 2026 11:45:09 -0400 Subject: [PATCH] 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 (611c1cba) Agent-Model: SWE-2 High Agent-Session: local session transcript /home/crackauc/sandbox/tmp_20260911_112052_59120/history_6a789c0b69c64ca3.md --- .github/workflows/benchmark.yml | 29 ++++++++++++++++++ benchmark/benchmarks.jl | 52 +++++++++++++++++++++++++++++++++ 2 files changed, 81 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..bb1f281 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,29 @@ +name: Benchmark this PR + +on: + pull_request: + branches: [master] + 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: "DiffEqBase" + job-summary: true diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 0000000..3575248 --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,52 @@ +using DiffEqNoiseProcess, DiffEqBase, BenchmarkTools + +const SUITE = BenchmarkGroup() + +# ============================================================================= +# Noise process simulation +# ============================================================================= + +SUITE["simulate"] = BenchmarkGroup() + +W_scalar = WienerProcess(0.0, 0.0, 0.0) +prob_w = NoiseProblem(W_scalar, (0.0, 1.0); seed = 1234) + +W_vec = WienerProcess!(0.0, zeros(10), zeros(10)) +prob_wv = NoiseProblem(W_vec, (0.0, 1.0); seed = 1234) + +gbm = GeometricBrownianMotionProcess(0.01, 0.2, 0.0, 1.0, 1.0) +prob_gbm = NoiseProblem(gbm, (0.0, 1.0); seed = 1234) + +ou = OrnsteinUhlenbeckProcess(1.0, 0.0, 0.5, 0.0, 0.0) +prob_ou = NoiseProblem(ou, (0.0, 1.0); seed = 1234) + +SUITE["simulate"]["wiener_scalar"] = @benchmarkable solve($prob_w; dt = 0.001) +SUITE["simulate"]["wiener_vector"] = @benchmarkable solve($prob_wv; dt = 0.001) +SUITE["simulate"]["geometric_brownian"] = @benchmarkable solve($prob_gbm; dt = 0.001) +SUITE["simulate"]["ornstein_uhlenbeck"] = @benchmarkable solve($prob_ou; dt = 0.001) + +# ============================================================================= +# Bridge processes +# ============================================================================= + +SUITE["bridge"] = BenchmarkGroup() + +Wb = BrownianBridge(0.0, 1.0, 0.0, 1.0) +prob_wb = NoiseProblem(Wb, (0.0, 1.0); seed = 1234) + +gbmb = GeometricBrownianBridge(0.01, 0.2, 0.0, 1.0, 1.0, 1.5) +prob_gbmb = NoiseProblem(gbmb, (0.0, 1.0); seed = 1234) + +SUITE["bridge"]["brownian"] = @benchmarkable solve($prob_wb; dt = 0.001) +SUITE["bridge"]["geometric_brownian"] = @benchmarkable solve($prob_gbmb; dt = 0.001) + +# ============================================================================= +# Ensemble simulation +# ============================================================================= + +SUITE["ensemble"] = BenchmarkGroup() + +eprob = EnsembleProblem(prob_w) +SUITE["ensemble"]["trajectories_100"] = @benchmarkable solve( + $eprob; dt = 0.01, trajectories = 100 +)