Skip to content

Add JET.jl static analysis tests#209

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:static-improvements-20251230-064411
Dec 30, 2025
Merged

Add JET.jl static analysis tests#209
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:static-improvements-20251230-064411

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

This PR adds JET.jl-based static analysis testing to the RootedTrees.jl test suite, complementing the existing @inferred tests.

Changes:

  • Add JET as a test dependency in test/Project.toml (supporting versions 0.9, 0.10, 0.11)
  • Add @test_opt tests for core type-stable functions

JET tests cover:

  • Core tree construction and properties (order, density, hash)
  • Iterator construction (RootedTreeIterator, SubtreeIterator)
  • ColoredRootedTree operations
  • RungeKuttaMethod and RosenbrockMethod construction

Background

JET analysis was run on the package and found:

  1. No type errors - report_package("RootedTrees") completed with 0 errors
  2. Some expected recursion optimization limitations in functions like symmetry (inherent to tree-traversal algorithms)
  3. False positives for impossible code paths (e.g., iterating over empty iterators where the code ensures non-empty iterators)

The package is already well-typed - these tests document and maintain that quality.

Test plan

  • Run Pkg.test() - all 580,761 tests pass

cc @ChrisRackauckas

🤖 Generated with Claude Code

This PR adds JET.jl-based static analysis testing to the RootedTrees.jl
test suite, complementing the existing @inferred tests.

Changes:
- Add JET as a test dependency in test/Project.toml
- Add @test_opt tests for core type-stable functions

The JET tests verify optimization analysis for:
- Core tree construction and properties (order, density, hash)
- Iterator construction (RootedTreeIterator, SubtreeIterator)
- ColoredRootedTree operations
- RungeKuttaMethod and RosenbrockMethod construction

Note: Some functions like `symmetry` use recursion which JET cannot
fully optimize, but they are still type-stable as verified by the
existing @inferred tests.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit e46c3e9 into SciML:main Dec 30, 2025
5 of 8 checks passed
@ranocha

ranocha commented Jan 1, 2026

Copy link
Copy Markdown
Member

Thanks for preparing JET.jl tests. However, CI never passed in this PR and fails in main, too:

@ChrisRackauckas

Copy link
Copy Markdown
Member

Yes sorry, this is a part of a series of changes related to improved static/interface testing. On these notes, I am the middle of a few things here:

Downgrade fails because of JET.jl

This needs a fix in General. Julia on v1.10 only works with JET v0.9, v1.11 only JET v0.10, v1.12 only JET v0.11. General allows all Julia versions on all JET. So we need to fix this in the registry for Downgrade to work. So we're ignoring it on the repo right now, but I'll do that General registry fix ASAP because this'll help a lot of people who must be noticing a lot of issues trying to use JET because of the wrong versions 😅

One of the JET.jl tests fails

JET tests are being moved to nopre setups. That PR was supposed to happen immediately after so I merged, but I ran out of hours 😅 . So that should be spawning in a second. When it's running on nopre that means pre is ignored for JET (because it tends to not have a valid JET version, it actually does right now but it's unstable and tends to give false positives/negatives).

The format checker fails

See the Slack thread on this. JuliaFormatter is being removed, so for now it's at least ignored. Whether we go to Runic or just drop formatter... see the discussion it ended very unclear from the straw poll.

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/General that referenced this pull request Jan 1, 2026
JET.jl has strict Julia version requirements that were not properly
reflected in the registry compat entries:

- JET 0.9.x (v0.8.28-0.9.18) requires Julia 1.10 only
- JET 0.9.19+ requires Julia 1.11 only
- JET 0.10.x and 0.11.x require Julia 1.12 only

The previous entries used unbounded ranges like "1.10.0-1" which allowed
incompatible Julia versions. This caused issues when the resolver would
select JET versions that don't work with the user's Julia version.

See: SciML/RootedTrees.jl#209 (comment)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ChrisRackauckas pushed a commit to JuliaRegistries/General that referenced this pull request Jan 6, 2026
* [JET] Add upper bounds to julia compat entries

JET.jl has strict Julia version requirements that were not properly
reflected in the registry compat entries:

- JET 0.9.x (v0.8.28-0.9.18) requires Julia 1.10 only
- JET 0.9.19+ requires Julia 1.11 only
- JET 0.10.x and 0.11.x require Julia 1.12 only

The previous entries used unbounded ranges like "1.10.0-1" which allowed
incompatible Julia versions. This caused issues when the resolver would
select JET versions that don't work with the user's Julia version.

See: SciML/RootedTrees.jl#209 (comment)

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

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

* [JET] Also cap older versions for better resolver behavior

Cap older JET versions at their appropriate Julia versions:
- JET 0.0.x: cap at Julia 1.6 (was 1.10)
- JET 0.5-0.6.1: cap at Julia 1.8 (was 1.10)
- JET 0.6.2-0.6.15: cap at Julia 1.8 (was 1.10)
- JET 0.6.21-0.7.14: cap at Julia 1.8 (was 1.10)
- JET 0.7.15-0.8.21: cap at Julia 1.9 (was 1.10)

This ensures the resolver picks the appropriate JET version for each
Julia version instead of potentially selecting older JET versions.

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

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

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/RootedTrees.jl that referenced this pull request Jan 12, 2026
- Remove JET from test dependencies, load it dynamically in runtests.jl
- JET tests only run on non-prerelease Julia versions (GROUP=all or GROUP=nopre)
- Disable downgrade tests temporarily (if: false) pending upstream fixes
- Add Pkg to test dependencies for dynamic package loading

This follows the pattern used in other SciML packages like NonlinearSolve.jl
where JET tests are excluded from prerelease Julia to avoid false positives
from incomplete JET support on bleeding-edge Julia versions.

Related: SciML#209

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/RootedTrees.jl that referenced this pull request Jan 12, 2026
- Remove JET from test dependencies, load it dynamically in runtests.jl
- JET tests only run on non-prerelease Julia versions (GROUP=all or GROUP=nopre)
- Disable downgrade tests temporarily (if: false) pending upstream fixes
- Add Pkg to test dependencies for dynamic package loading

This follows the pattern used in other SciML packages like NonlinearSolve.jl
where JET tests are excluded from prerelease Julia to avoid false positives
from incomplete JET support on bleeding-edge Julia versions.

Related: SciML#209

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/RootedTrees.jl that referenced this pull request Jan 12, 2026
- Remove JET from test dependencies, load it dynamically in runtests.jl
- JET tests only run on non-prerelease Julia versions (GROUP=all or GROUP=nopre)
- Disable downgrade tests temporarily (if: false) pending upstream fixes
- Add Pkg to test dependencies for dynamic package loading

This follows the pattern used in other SciML packages like NonlinearSolve.jl
where JET tests are excluded from prerelease Julia to avoid false positives
from incomplete JET support on bleeding-edge Julia versions.

Related: SciML#209

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/RootedTrees.jl that referenced this pull request Jan 12, 2026
- Remove JET from test dependencies, load it dynamically in runtests.jl
- JET tests only run on non-prerelease Julia versions (GROUP=all or GROUP=nopre)
- Disable downgrade tests temporarily (if: false) pending upstream fixes
- Add Pkg to test dependencies for dynamic package loading

This follows the pattern used in other SciML packages like NonlinearSolve.jl
where JET tests are excluded from prerelease Julia to avoid false positives
from incomplete JET support on bleeding-edge Julia versions.

Related: SciML#209

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ChrisRackauckas pushed a commit that referenced this pull request Jan 12, 2026
- Remove JET from test dependencies, load it dynamically in runtests.jl
- JET tests only run on non-prerelease Julia versions (GROUP=all or GROUP=nopre)
- Disable downgrade tests temporarily (if: false) pending upstream fixes
- Add Pkg to test dependencies for dynamic package loading

This follows the pattern used in other SciML packages like NonlinearSolve.jl
where JET tests are excluded from prerelease Julia to avoid false positives
from incomplete JET support on bleeding-edge Julia versions.

Related: #209

Co-authored-by: ChrisRackauckas-Claude <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.

4 participants