Skip to content

SimpleOptimization: make imports explicit - #1416

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:qa/simpleopt-explicit-imports
Draft

ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:qa/simpleopt-explicit-imports

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

SimpleOptimization now imports the OptimizationBase, SciMLBase, SimpleNonlinearSolve, ADTypes, LinearAlgebra, and CommonSolve module bindings and the individual names its implementation uses (plus ForwardDiff / Enzyme in the AD extensions). Unused Reexport was dropped from the package deps because nothing called @reexport. The QA suite no longer marks no_implicit_imports as broken, and SimpleOptimization.ADTypes remains available for the extensions.

Verification

Group env var confirmed in lib/SimpleOptimization/test/runtests.jl as OPTIMIZATION_TEST_GROUP. Commands below ran from lib/SimpleOptimization, with the Julia depot and temporary directory isolated under this job directory.

  • Baseline QA, before changes:

    export TMPDIR=/home/crackauc/sandbox/goals/qa-hygiene/jobs/simpleopt-imports/tmp
    export JULIA_DEPOT_PATH=/home/crackauc/sandbox/goals/qa-hygiene/jobs/simpleopt-imports/scratch/julia-depot
    export JULIA_CONDAPKG_BACKEND=Null JULIA_PYTHONCALL_EXE=/usr/bin/python3
    ulimit -n 65536
    OPTIMIZATION_TEST_GROUP=QA julia --project -e 'using Pkg; Pkg.test()'

    Output tail: Quality Assurance | 20 1 21 1m03.1s; Testing SimpleOptimization tests passed.

  • QA after change: same commands — output tail: Quality Assurance | 21 21 1m03.6s; Testing SimpleOptimization tests passed.

  • Core:

    export TMPDIR=/home/crackauc/sandbox/goals/qa-hygiene/jobs/simpleopt-imports/tmp
    export JULIA_DEPOT_PATH=/home/crackauc/sandbox/goals/qa-hygiene/jobs/simpleopt-imports/scratch/julia-depot
    export JULIA_CONDAPKG_BACKEND=Null JULIA_PYTHONCALL_EXE=/usr/bin/python3
    ulimit -n 65536
    OPTIMIZATION_TEST_GROUP=Core julia --project -e 'using Pkg; Pkg.test()'

    Output tail: Core | 22 22 25.1s; Testing SimpleOptimization tests passed.

  • From the repository root, julia --project=@runic -e 'using Runic; exit(Runic.main(ARGS))' -- --inplace lib/SimpleOptimization/src/SimpleOptimization.jl lib/SimpleOptimization/ext/SimpleOptimizationForwardDiffExt.jl lib/SimpleOptimization/ext/SimpleOptimizationEnzymeExt.jl lib/SimpleOptimization/test/qa/qa.jl — exit 0.

  • From the repository root, typos on the same files plus Project.toml — exit 0.

  • Scanned lib/, test/, and docs/ for qualified SimpleOptimization.x references. In-repo code uses SimpleOptimization.ADTypes (extensions) and SimpleOptimization.instantiate_gradient (extensions); both remain available. No other qualified bindings were required.

Not verified: CI, the full Optimization.jl monorepo suite, and downstream packages.

Please ignore this draft until reviewed by @ChrisRackauckas.

Risk assessment

  • Risk: low
  • Blast radius: imports, unused Reexport dep removal, and QA status for SimpleOptimization. Exports and docstrings are unchanged. Names that were only incidentally reachable as SimpleOptimization.x through the old blanket using (e.g. SimpleOptimization.solve, SimpleOptimization.dot) no longer are; nothing in lib/, test/ or docs/ uses them, but downstream code spelling them that way would break.
  • Evidence: QA changed from 20 pass / 1 broken to 21 pass; Core passes 22/22; ExplicitImports no_implicit_imports, no_stale_explicit_imports, via_owners, and are_public return ok; Runic and typos exit 0.
  • Independent review: pending
  • Merge: needs review

Cursor Agent CLI 2026.10.01-14929f9 (model: auto); transcript: /home/crackauc/sandbox/goals/qa-hygiene/jobs/simpleopt-imports/log.txt

Made with Cursor

Replace blanket using statements with explicit imports of the module
bindings and names the implementation uses, drop unused Reexport, and
enable the no_implicit_imports QA check.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/simpleopt-imports/log.txt on amdci2

This branch has not been deployed

No deployments
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.

2 participants