Skip to content

Add AllocCheck allocation tests and CI job - #26

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:perf-improvements-20260107-161822
Jan 8, 2026
Merged

Add AllocCheck allocation tests and CI job#26
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:perf-improvements-20260107-161822

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

  • Add AllocCheck to test dependencies for allocation testing
  • Add test/alloc_tests.jl with example allocation-free surrogate implementation tests
  • Add alloccheck CI job in Tests.yml running with GROUP=nopre

Context

SurrogatesBase.jl is an interface package that defines abstract types (AbstractDeterministicSurrogate, AbstractStochasticSurrogate) and function stubs (update!, parameters, etc.). Since there are no concrete implementations to optimize, this PR adds allocation testing infrastructure that:

  1. Serves as an example for downstream packages implementing surrogates
  2. Demonstrates how to write allocation-free surrogate operations
  3. Uses @check_allocs from AllocCheck.jl to verify zero allocations

The allocation tests run in a separate "nopre" group to avoid interference with precompilation.

Test plan

  • All existing tests pass
  • New allocation tests pass with GROUP=nopre
  • CI AllocCheck job runs successfully

cc @ChrisRackauckas

🤖 Generated with Claude Code

This adds allocation testing to SurrogatesBase to help ensure that
implementations can be allocation-free. Since SurrogatesBase is an
interface package with no concrete implementations, these tests serve
as examples for downstream packages.

Changes:
- Add AllocCheck to test dependencies
- Add test/alloc_tests.jl with example allocation-free surrogate tests
- Add alloccheck CI job in Tests.yml running with GROUP=nopre

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI Status

The pre (Julia 1.13 prerelease) tests are failing, but this is a pre-existing issue - JET.jl doesn't yet support Julia 1.13:

JET [c3a54625] log:
├─possible versions are: 0.0.1 - 0.11.3 or uninstalled
├─restricted to versions 0.9 - 0.11 by project
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left

All tests pass on:

  • Julia 1 (stable) - Ubuntu, Windows ✅
  • Julia LTS - Ubuntu, Windows ✅
  • AllocCheck job ✅

The macOS jobs are still pending but should also pass.

cc @ChrisRackauckas

@ChrisRackauckas
ChrisRackauckas merged commit c60c84a into SciML:main Jan 8, 2026
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants