Skip to content

Convert remaining include-file LinearAlgebra imports to explicit form - #311

Merged
ChrisRackauckas merged 1 commit into
masterfrom
agent/231-explicit-imports
Nov 10, 2026
Merged

ChrisRackauckas merged 1 commit into
masterfrom
agent/231-explicit-imports

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

🚧 UNREVIEWED — awaiting review by @ChrisRackauckas. Filed by an AI agent running as @ChrisRackauckas; Chris has not seen this.
Harness: Muse CLI Code · Model: muse-ember-1.0
Conversation: local job 231-muse (no session URL)

Remove implicit using LinearAlgebra from include files that share the ExponentialUtilities module scope. The top-level module already lists all names used by these files (norm, mul!, rmul!, I, etc.), so the change is purely mechanical. Also make src/StegrWork.jl's standalone Stegr submodule explicit (BlasInt, @blasfunc only, import libblastrampoline_jll).

Risk assessment

  • Risk: low (L4: mechanical explicit-import declarations and QA check un-breaking; no runtime or public API change)
  • Blast radius: module loading and the five Higham2005 generated kernels (exp1.jl–exp5.jl) plus src/kiops.jl; the Stegr submodule is not included by src/ExponentialUtilities.jl and is not exercised by the package.
  • Evidence: GROUP=QA passes locally; see verification below.
  • Independent review: not yet available — awaiting reviewer.
  • Merge: needs human review — docs suggest no behavior change but the CI run still needs to confirm ExplicitImports on Julia 1.10/1.12.

Verification

I ran these exact commands with a writable depot over the shared depot:

  • julia --project=test/qa test/qa/qa.jl (after Pkg.develop(path=".", io=devnull) so the local checkout is the module under test):
Test Summary:     | Pass  Total  Time
Extensions loaded |    1      1  0.1s
Test Summary:     | Pass  Total     Time
Quality Assurance |   21     21  1m08.2s
Test Summary:   | Pass  Total  Time
ExplicitImports |    6      6  0.3s
Test Summary:                                     | Broken  Total   Time
AllocCheck static analysis of the Krylov hot path |      2      2  36.6s
  • julia -m Runic --check src/kiops.jl src/exp_generated/exp_1.jl src/exp_generated/exp_2.jl src/exp_generated/exp_3.jl src/exp_generated/exp_4.jl src/exp_generated/exp_5.jl src/StegrWork.jl src/ExponentialUtilities.jl → exit 0, no diff.
  • typos src/ → no output (clean).
  • Smoke test on the same depot (julia --project=test/qa): exponential!(copy(A), ExpMethodHigham2005()) matches exp(A) to 1.6e-16 and kiops returns the expected vector.

What I did NOT verify

  • The GROUP=Core run was started but not run to completion (timeout after precompile); the five kernels and kiops were exercised only via the smoke test above.
  • docs/make.jl was not run (no docstring or public-API change).
  • The GROUP=QA invocation via GROUP=QA julia --project -e 'using Pkg; Pkg.test()' was not run end-to-end (the test/qa/qa.jl invocation is equivalent for this repo); rely on CI for the grouped harness.
  • src/StegrWork.jl is not included by the package, so its explicit imports were not exercised at runtime (it has no loaded test coverage).

What a reviewer should push back on

  • src/StegrWork.jl is orphaned (not included since Migrate QA to SciMLTesting 2.4 #258). I made it explicit but left the file in place; consider deleting it or wiring it into the test suite.
  • Docstring examples still say using LinearAlgebra (for user-facing examples in src/arnoldi.jl and src/krylov_phiv_error_estimate.jl). Those are intentional and not seen by ExplicitImports; flag if you want them changed to using LinearAlgebra: Hermitian for consistency.
  • The top-level import LinearAlgebra bare import is still needed for qualified accesses (LinearAlgebra.ishermitian, LinearAlgebra.opnorm). A stricter explicit-import style would drop the qualified accesses; left as is.

Closes #231


🤖 Posted by an AI agent — harness: Muse CLI Code · model: muse-ember-1.0
Conversation: local job 231-muse (no session URL)

Replace implicit 'using LinearAlgebra' in include files that share the
ExponentialUtilities module scope (src/kiops.jl and src/exp_generated/exp_*.jl)
with reliance on the explicit 'import LinearAlgebra: ...' list in
src/ExponentialUtilities.jl, and make src/StegrWork.jl's standalone Stegr
submodule explicit (using LinearAlgebra: BlasInt and BLAS @blasfunc only,
import libblastrampoline_jll). The top-level module already lists all names
used by these files (norm, mul!, rmul!, I, etc.), so behavior is unchanged.

Verified: ExplicitImports.check_no_implicit_imports passes on
ExponentialUtilities and ExponentialUtilitiesStaticArraysExt; GROUP=QA
passes (Quality Assurance 21/21, ExplicitImports 6/6) after
Pkg.develop of the local checkout. Runic --check and typos are clean.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Muse <noreply@meta.com>
Agent-Harness: Muse CLI Code
Agent-Model: muse-ember-1.0
Agent-Session: local job 231-muse (no session URL)
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review November 10, 2026 10:28
@ChrisRackauckas
ChrisRackauckas merged commit ed71797 into master Nov 10, 2026
39 checks passed
@ChrisRackauckas
ChrisRackauckas deleted the agent/231-explicit-imports branch November 10, 2026 10:28
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.

QA: ExplicitImports no_implicit_imports broken — ~31 implicit names from LinearAlgebra/SparseArrays/Printf/PrecompileTools

2 participants