Skip to content

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

This PR adds JET.jl static analysis tests to the test suite and fixes a type instability issue in the VEGAS algorithm.

Changes:

  1. Added JET tests (test/jet_tests.jl) that verify type stability for key entry points:

    • QuadGKJL
    • HCubatureJL
    • TrapezoidalRule
    • SimpsonsRule
    • Infinite bounds transformation
    • VEGAS (with bounded allowed reports)
  2. Fixed type instability in VEGAS algorithm: The assertion on line 349 was calling length(y) and eltype(y) on what could be a scalar Float64, which caused runtime dispatch errors. Added a type-stable helper function _is_real_scalar() that properly handles both Number and AbstractArray types.

  3. Added JET to test dependencies in Project.toml

JET Analysis Results:

Algorithm Reports Before Reports After
QuadGKJL 0 0
HCubatureJL 0 0
TrapezoidalRule 0 0
SimpsonsRule 0 0
Infinite bounds 0 0
VEGAS 4 2

The remaining 2 reports for VEGAS are:

  1. Captured variable y in closure (inherent to in-place operations)
  2. Runtime dispatch for _is_real_scalar call (unavoidable due to type-unstable prob.f(mid, p) return)

Test Plan

  • Core tests pass (Explicit Imports, Quality Assurance, Interface Tests, etc.)
  • JET Static Analysis tests pass (6/6)
  • No new type instabilities introduced

cc @ChrisRackauckas

🤖 Generated with Claude Code

Changes:
- Add JET.jl as a test dependency with JET tests for key entry points
- Fix type instability in VEGAS algorithm: the assertion on line 349
  was calling `length(y)` and `eltype(y)` on what could be a scalar
  Float64, which caused runtime dispatch errors
- Add `_is_real_scalar` helper function that handles both Number and
  AbstractArray types in a type-stable way

JET analysis results:
- QuadGKJL: 0 reports
- HCubatureJL: 0 reports
- TrapezoidalRule: 0 reports
- SimpsonsRule: 0 reports
- Infinite bounds transformation: 0 reports
- VEGAS: 2 reports (down from 4) - remaining are inherent closure
  capture and unavoidable runtime dispatch for type checking

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
ChrisRackauckas and others added 2 commits January 8, 2026 07:03
The JET tests have been moved from the Core group to their own JET
group, which is excluded from running on Julia pre-release versions.
This prevents CI failures due to JET compatibility issues with
unreleased Julia versions.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ChrisRackauckas-Claude
Copy link
Contributor Author

Moved JET tests to a separate CI group that skips pre-release Julia:

Changes:

  • Created new JET test group in test/runtests.jl (no longer runs with Core or All)
  • Added JET group to CI matrix in .github/workflows/CI.yml
  • Excluded JET group from running on Julia pre version

This prevents CI failures from JET compatibility issues with unreleased Julia versions.

🤖 Generated with Claude Code

Move JET tests to test/nopre/ directory with its own Project.toml
so JET is not a test dependency of the main package. This follows
the pattern used in OrdinaryDiffEq.jl for tests with additional
dependencies.

Changes:
- Create test/nopre/Project.toml with JET dependency
- Move jet_tests.jl to test/nopre/jet_tests.jl
- Update runtests.jl to activate nopre environment before running tests
- Remove JET from main Project.toml extras and test targets
- Rename JET group to nopre in CI.yml
- Exclude nopre tests from both pre and lts Julia versions

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ChrisRackauckas-Claude
Copy link
Contributor Author

Updates to nopre group structure

This commit consolidates the JET tests into a proper nopre group following the pattern from OrdinaryDiffEq.jl:

Changes:

  1. Created test/nopre/ directory with its own Project.toml containing the JET dependency
  2. Moved jet_tests.jl to test/nopre/jet_tests.jl
  3. Updated runtests.jl to:
    • Add activate_nopre_env() function that activates the nopre environment and develops the main package
    • Renamed JET group to nopre
  4. Removed JET from main Project.toml extras and test targets
  5. Updated CI.yml to:
    • Rename JET group to nopre
    • Exclude nopre tests from both pre and lts Julia versions

This approach ensures JET is not a test dependency of the main package, while still allowing JET tests to run on stable Julia versions.

🤖 Generated with Claude Code

ChrisRackauckas and others added 3 commits January 8, 2026 07:30
The runtests.jl uses Pkg for activating the nopre environment, so it
needs to be in the test dependencies.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ChrisRackauckas ChrisRackauckas merged commit ca28059 into SciML:master Jan 9, 2026
10 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