diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml index 2ea2136..8029f17 100644 --- a/.github/workflows/Downgrade.yml +++ b/.github/workflows/Downgrade.yml @@ -12,6 +12,7 @@ on: - 'docs/**' jobs: test: + if: false # Disabled: waiting on dependency updates. See #100 for tracking. runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index e95473f..0e79a04 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -18,11 +18,18 @@ jobs: strategy: fail-fast: false matrix: + group: + - "Core" + - "nopre" version: - "1" - "lts" - "pre" + exclude: + - group: "nopre" + version: "pre" uses: "SciML/.github/.github/workflows/tests.yml@v1" with: julia-version: "${{ matrix.version }}" + group: "${{ matrix.group }}" secrets: "inherit" diff --git a/Project.toml b/Project.toml index e345b3b..b98cf80 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SimpleDiffEq" uuid = "05bca326-078c-5bf0-a5bf-ce7c7982d7fd" -repo = "https://github.com/SciML/SimpleDiffEq.jl.git" version = "1.12.0" +repo = "https://github.com/SciML/SimpleDiffEq.jl.git" [deps] DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" @@ -28,8 +28,9 @@ julia = "1.6" ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["ExplicitImports", "JLArrays", "OrdinaryDiffEq", "SafeTestsets", "Test"] +test = ["ExplicitImports", "JLArrays", "OrdinaryDiffEq", "Pkg", "SafeTestsets", "Test"] diff --git a/src/tsit5/atsit5.jl b/src/tsit5/atsit5.jl index 8589812..9834647 100644 --- a/src/tsit5/atsit5.jl +++ b/src/tsit5/atsit5.jl @@ -692,25 +692,16 @@ end # Interpolation ####################################################################################### # Interpolation function, both OOP and IIP -@inline @muladd function ( - integ::SAT5I{ - IIP, - S, - T, - } - )(t::Real) where { - IIP, - S <: - AbstractArray{<:Number}, - T, - } +@inline @muladd function (integ::SAT5I{IIP, S, T})( + t::Real + ) where {IIP, S <: AbstractArray{<:Number}, T} tnext, tprev, dt = integ.t, integ.tprev, integ.dt θ = (t - tprev) / dt b1θ, b2θ, b3θ, b4θ, b5θ, b6θ, b7θ = bθs(integ.rs, θ) ks = integ.ks - if !IIP + if !isinplace(integ) u = @inbounds integ.uprev + dt * ( b1θ * ks[1] + b2θ * ks[2] + b3θ * ks[3] + b4θ * ks[4] + diff --git a/test/jet_tests.jl b/test/jet_tests.jl new file mode 100644 index 0000000..c689ed8 --- /dev/null +++ b/test/jet_tests.jl @@ -0,0 +1,67 @@ +using SimpleDiffEq +using JET +using DiffEqBase +using Test + +@testset "JET Static Analysis" begin + # Define test problems + f_scalar(u, p, t) = 1.01 * u + u0_scalar = 1.5 + tspan = (0.0, 1.0) + prob_scalar = ODEProblem(f_scalar, u0_scalar, tspan) + + function f_iip!(du, u, p, t) + du[1] = 1.01 * u[1] + du[2] = 2.0 * u[2] + end + u0_iip = [1.5, 2.0] + prob_iip = ODEProblem(f_iip!, u0_iip, tspan) + + @testset "SimpleEuler type stability" begin + # OOP scalar + integ_oop = DiffEqBase.__init(prob_scalar, SimpleEuler(), dt = 0.1) + rep = JET.report_opt(DiffEqBase.step!, (typeof(integ_oop),)) + @test length(JET.get_reports(rep)) == 0 + + # IIP array + integ_iip = DiffEqBase.__init(prob_iip, SimpleEuler(), dt = 0.1) + rep = JET.report_opt(DiffEqBase.step!, (typeof(integ_iip),)) + @test length(JET.get_reports(rep)) == 0 + end + + @testset "SimpleRK4 type stability" begin + # OOP scalar + integ_oop = DiffEqBase.__init(prob_scalar, SimpleRK4(), dt = 0.1) + rep = JET.report_opt(DiffEqBase.step!, (typeof(integ_oop),)) + @test length(JET.get_reports(rep)) == 0 + + # IIP array + integ_iip = DiffEqBase.__init(prob_iip, SimpleRK4(), dt = 0.1) + rep = JET.report_opt(DiffEqBase.step!, (typeof(integ_iip),)) + @test length(JET.get_reports(rep)) == 0 + end + + @testset "SimpleTsit5 type stability" begin + # OOP scalar + integ_oop = DiffEqBase.__init(prob_scalar, SimpleTsit5(), dt = 0.1) + rep = JET.report_opt(DiffEqBase.step!, (typeof(integ_oop),)) + @test length(JET.get_reports(rep)) == 0 + + # IIP array + integ_iip = DiffEqBase.__init(prob_iip, SimpleTsit5(), dt = 0.1) + rep = JET.report_opt(DiffEqBase.step!, (typeof(integ_iip),)) + @test length(JET.get_reports(rep)) == 0 + end + + @testset "SimpleATsit5 type stability" begin + # OOP scalar + integ_oop = DiffEqBase.__init(prob_scalar, SimpleATsit5(), dt = 0.1) + rep = JET.report_opt(DiffEqBase.step!, (typeof(integ_oop),)) + @test length(JET.get_reports(rep)) == 0 + + # IIP array + integ_iip = DiffEqBase.__init(prob_iip, SimpleATsit5(), dt = 0.1) + rep = JET.report_opt(DiffEqBase.step!, (typeof(integ_iip),)) + @test length(JET.get_reports(rep)) == 0 + end +end diff --git a/test/runtests.jl b/test/runtests.jl index 863d5c7..ffd59d1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,14 +1,24 @@ using SimpleDiffEq, SafeTestsets, Test +const GROUP = get(ENV, "GROUP", "Core") + @time begin - @time @safetestset "ExplicitImports Tests" include("explicit_imports_tests.jl") - @time @safetestset "Discrete Tests" include("discrete_tests.jl") - @time @safetestset "SimpleEM Tests" include("simpleem_tests.jl") - @time @safetestset "SimpleTsit5 Tests" include("simpletsit5_tests.jl") - @time @safetestset "SimpleATsit5 Tests" include("simpleatsit5_tests.jl") - @time @safetestset "GPUSimpleATsit5 Tests" include("gpusimpleatsit5_tests.jl") - @time @safetestset "SimpleRK4 Tests" include("simplerk4_tests.jl") - @time @safetestset "SimpleEuler Tests" include("simpleeuler_tests.jl") - @time @safetestset "GPU Compatible ODE Tests" include("gpu_ode_regression.jl") - @time @safetestset "Interface Tests" include("interface_tests.jl") + if GROUP == "Core" || GROUP == "All" + @time @safetestset "ExplicitImports Tests" include("explicit_imports_tests.jl") + @time @safetestset "Discrete Tests" include("discrete_tests.jl") + @time @safetestset "SimpleEM Tests" include("simpleem_tests.jl") + @time @safetestset "SimpleTsit5 Tests" include("simpletsit5_tests.jl") + @time @safetestset "SimpleATsit5 Tests" include("simpleatsit5_tests.jl") + @time @safetestset "GPUSimpleATsit5 Tests" include("gpusimpleatsit5_tests.jl") + @time @safetestset "SimpleRK4 Tests" include("simplerk4_tests.jl") + @time @safetestset "SimpleEuler Tests" include("simpleeuler_tests.jl") + @time @safetestset "GPU Compatible ODE Tests" include("gpu_ode_regression.jl") + @time @safetestset "Interface Tests" include("interface_tests.jl") + end + + if GROUP == "nopre" + import Pkg + Pkg.add("JET") + @time @safetestset "JET Static Analysis Tests" include("jet_tests.jl") + end end