diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 700707ce..ec3b005a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,3 +5,6 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + ignore: + - dependency-name: "crate-ci/typos" + update-types: ["version-update:semver-patch", "version-update:semver-minor"] diff --git a/test/Project.toml b/test/Project.toml index 8563be04..d5b04460 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -7,6 +7,7 @@ FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196" InvertedIndices = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb" LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/test/jet_tests.jl b/test/jet_tests.jl new file mode 100644 index 00000000..b4827dad --- /dev/null +++ b/test/jet_tests.jl @@ -0,0 +1,62 @@ +using ComponentArrays +using JET +using Test + +@testset "JET Static Analysis" begin + # Create test ComponentArrays for analysis + ca = ComponentArray(a = 1.0, b = [2.0, 3.0], c = (x = 4.0, y = 5.0)) + ca_simple = ComponentArray(a = 1.0, b = 2.0) + cmat = ca .* ca' + + @testset "Core operations type stability" begin + # Test getindex with integer - should be type stable + rep = @report_opt target_modules = (ComponentArrays,) ca[1] + @test length(JET.get_reports(rep)) == 0 + + # Test similar - should be type stable + rep = @report_opt target_modules = (ComponentArrays,) similar(ca) + @test length(JET.get_reports(rep)) == 0 + + # Test copy - should be type stable + rep = @report_opt target_modules = (ComponentArrays,) copy(ca) + @test length(JET.get_reports(rep)) == 0 + + # Test getdata - should be type stable + rep = @report_opt target_modules = (ComponentArrays,) getdata(ca) + @test length(JET.get_reports(rep)) == 0 + + # Test getaxes - should be type stable + rep = @report_opt target_modules = (ComponentArrays,) getaxes(ca) + @test length(JET.get_reports(rep)) == 0 + + # Test broadcast - should be type stable + rep = @report_opt target_modules = (ComponentArrays,) broadcast(+, ca, ca) + @test length(JET.get_reports(rep)) == 0 + + # Test vcat - should be type stable + rep = @report_opt target_modules = (ComponentArrays,) vcat(ca_simple, ca_simple) + @test length(JET.get_reports(rep)) == 0 + + # Test hcat - should be type stable + rep = @report_opt target_modules = (ComponentArrays,) hcat(ca_simple, ca_simple) + @test length(JET.get_reports(rep)) == 0 + end + + @testset "No runtime errors in basic usage" begin + # Check that basic operations don't have potential runtime errors + rep = @report_call ca[1] + @test length(JET.get_reports(rep)) == 0 + + rep = @report_call similar(ca) + @test length(JET.get_reports(rep)) == 0 + + rep = @report_call copy(ca) + @test length(JET.get_reports(rep)) == 0 + + rep = @report_call getdata(ca) + @test length(JET.get_reports(rep)) == 0 + + rep = @report_call getaxes(ca) + @test length(JET.get_reports(rep)) == 0 + end +end diff --git a/test/runtests.jl b/test/runtests.jl index f73a2a87..c60044aa 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -982,3 +982,7 @@ end @testset "Reactant" begin include("reactant_tests.jl") end + +@testset "JET" begin + include("jet_tests.jl") +end