From 70bca16dc4034aee8b0920257f7805aa3ee36cc7 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Fri, 11 Sep 2026 12:30:26 -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 | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 63 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..87afbc1 --- /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: "" + job-summary: true diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 0000000..dfcc771 --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,34 @@ +using FunctionProperties, BenchmarkTools + +const SUITE = BenchmarkGroup() + +# Representative functions with sample inputs +f_branching(x) = x > 0 ? x : -x +f_linear(x) = 2.0 * x +f_quad(x) = x^2 + 3.0x +f_smooth(x) = sin(x) +f_time(u, p, t) = p .* u .+ t +f_auto(u, p) = p .* u + +x = 1.5 +u = [1.0, 2.0] +p = [0.5, 0.5] + +# ============================================================================= +# Property queries (reflection-based analysis) +# ============================================================================= + +SUITE["queries"] = BenchmarkGroup() + +SUITE["queries"]["hasbranching_true"] = @benchmarkable hasbranching($f_branching, $x) +SUITE["queries"]["hasbranching_false"] = @benchmarkable hasbranching($f_linear, $x) +SUITE["queries"]["islinear"] = @benchmarkable islinear($f_linear, $x) +SUITE["queries"]["isquadratic"] = @benchmarkable isquadratic($f_quad, $x) +SUITE["queries"]["issmooth"] = @benchmarkable issmooth($f_smooth, $x) +SUITE["queries"]["isautonomous_true"] = @benchmarkable isautonomous( + $f_auto, $u, $p +) +SUITE["queries"]["isautonomous_false"] = @benchmarkable isautonomous( + $f_time, $u, $p, 0.5 +) +SUITE["queries"]["is_leaf"] = @benchmarkable is_leaf($f_linear)