Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

  • Added AllocCheck.jl tests to prevent allocation regressions
  • The package is already well-optimized (zero allocations, type-stable, 25-70ns per call)
  • Tests cover all key functions: count_rand, ad_rand, pois_rand, procf, and PassthroughRNG

Benchmark Results (Already Optimized)

Function λ Median Time Allocations
pois_rand 0.5 25 ns 0
pois_rand 2.0 44 ns 0
pois_rand 5.0 66 ns 0
pois_rand 10.0 33 ns 0
pois_rand 50.0 31 ns 0

All functions are type-stable (@code_warntype shows Int64 return types).

Files Changed

  • Project.toml - Added AllocCheck to test dependencies
  • test/runtests.jl - Include allocation tests (run by default or with GROUP=nopre)
  • test/alloc_tests.jl - New AllocCheck tests

Test Plan

  • Run Pkg.test() locally - all tests pass
  • CI tests pass

cc @ChrisRackauckas

🤖 Generated with Claude Code

The package is already well-optimized with zero allocations and type-stable
code. This commit adds AllocCheck.jl tests to ensure future changes don't
introduce allocations.

Test coverage:
- count_rand (small λ algorithm)
- ad_rand (large λ algorithm)
- pois_rand (main entry point)
- pois_rand with PassthroughRNG
- procf (probability calculation helper)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add space after comma in NTuple type annotations to pass format check.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit c440b8b into SciML:master Dec 30, 2025
13 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