From 8ab9830d7e60530b7803fc41f73d7145133f9d7a Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Mon, 4 Aug 2025 00:30:30 -0400 Subject: [PATCH 1/2] Ignore crate-ci/typos patch and minor updates in dependabot This prevents dependabot from creating PRs for every minor and patch version update of the typos tool, reducing noise in the repository. --- .github/dependabot.yml | 3 +++ 1 file changed, 3 insertions(+) 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"] From ae89e7a500e2ebd024e7e5a2b47ed9033ca0a3f3 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas Date: Mon, 29 Dec 2025 04:18:15 -0500 Subject: [PATCH 2/2] Add JET.jl static analysis tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR adds JET.jl-based static analysis tests to the test suite to help track type stability and catch potential runtime errors. Changes: - Add test/jet_tests.jl with tests for core operations: - Type stability tests using @report_opt for getindex, similar, copy, getdata, getaxes, broadcast, vcat, hcat - Error analysis tests using @report_call for basic operations - Add JET dependency to test/Project.toml - Include jet_tests.jl in test/runtests.jl JET analysis findings: - The package is already well-typed for core operations - Some intentional type instabilities exist in construction paths (e.g., ViewAxis can return different types by design for flexibility) - All critical post-construction operations are type-stable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- test/Project.toml | 1 + test/jet_tests.jl | 62 +++++++++++++++++++++++++++++++++++++++++++++++ test/runtests.jl | 4 +++ 3 files changed, 67 insertions(+) create mode 100644 test/jet_tests.jl 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