Skip to content

Add allocation tests for interface implementations - #27

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:perf-improvements-20260107-180944
Closed

Add allocation tests for interface implementations#27
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:perf-improvements-20260107-180944

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

  • Add AllocCheck and BenchmarkTools as test dependencies
  • Create allocation tests that demonstrate surrogate implementations can be allocation-free
  • Tests serve as a template for downstream package testing

Context

SurrogatesBase is an interface-only package with no computational code to optimize. The package defines abstract types (AbstractDeterministicSurrogate, AbstractStochasticSurrogate) and function stubs (update!, parameters, etc.) that downstream packages implement.

After profiling and analysis, the package is already well-optimized since it contains no computational code. However, allocation tests are valuable to:

  • Verify that interface implementations can be made allocation-free
  • Serve as documentation for downstream package developers
  • Catch any future regressions if computational code is added

Test plan

  • All existing tests pass
  • New allocation tests pass
  • BenchmarkTools confirms zero allocations for simple surrogate implementations

cc @ChrisRackauckas

🤖 Generated with Claude Code

SurrogatesBase is an interface-only package with no computational code
to optimize. The package defines abstract types and function stubs that
downstream packages implement.

This adds allocation tests using AllocCheck and BenchmarkTools to:
- Demonstrate that surrogate implementations can be allocation-free
- Serve as a template for downstream package testing
- Verify interface functions work correctly in performance-critical contexts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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