Skip to content

Make has_sys public API - #1474

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/public-has-sys
Aug 1, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/public-has-sys

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Jul 28, 2026 •

Copy link
Copy Markdown
Member

Ignore this PR until it has been reviewed by @ChrisRackauckas.

Summary

has_sys is the only member of the AbstractSciMLFunction field-existence trait family that is neither public nor documented. Its siblings — has_jac, has_jvp, has_vjp, has_tgrad, has_analytic, has_initialization_data — are all in the @public block and all render in docs/src/interfaces/SciMLFunctions.md.

Concretely, NonlinearSolveBase's AutoDePSpecialize path needs it: it declines parameter de-specialization for problems carrying symbolic metadata, since p must stay concrete for symbolic indexing and the initialization pipeline. Today that access trips ExplicitImports' non-public-qualified-access check.

This PR:

  • adds a docstring to has_sys at its definition site
  • adds it to the @public trait block
  • renders it in the SciMLFunctions trait docs
  • adds has_sys coverage to test/existence_functions.jl, including the no-sys-field short-circuit
  • bumps to 3.42.0 (new public API is a minor bump)

Rebase note

This PR originally also made ImmutableNonlinearProblem public. That half has been dropped from this PR because #1482 landed on master first and already does it — declares it @public, gives it a docstring, and adds the @docs entry next to NonlinearProblem. Nothing is lost; only the has_sys half remains here.

The version bump also moved: the original target 3.41.0 was taken by #1482 and is registered in General, so this is now 3.42.0.

Validation

Run locally on the rebased branch (master @ 79ed05e):

$ julia --project=. test/existence_functions.jl
Test Summary: | Pass  Total  Time
has_sys       |    3      3  0.2s

$ GROUP=QA julia --project=. -e 'using Pkg; Pkg.test()'
Test Summary: | Pass  Total     Time
QA            |   51     51  2m57.7s
     Testing SciMLBase tests passed

The QA group runs api_docs_kwargs = (; rendered = true, ...), so it is what verifies the new public name actually carries a docstring and appears in the rendered docs.

Runic --check on the changed source files exits 0.

Follow-up: SciML/NonlinearSolve.jl will consume this to drop its internal has_sys access.

@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Make has_sys public API Make has_sys and ImmutableNonlinearProblem public API Jul 28, 2026
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Rebased onto current master (e0733ef, picking up #1472 / #1475 / #1477). No conflicts, and #1475's QA changes do not touch either of these two names.

Re-verified after the rebase:

$ GROUP=QA julia --project=. -e 'using Pkg; Pkg.test()'
QA            |   35     35  1m47.2s
     Testing SciMLBase tests passed

$ julia --project=. -e 'include("test/existence_functions.jl")'
has_sys       |    3      3  0.2s
existence_functions OK

Runic 1.7.0 --check on the four changed source files exits 0.

Note on why this PR previously showed no checks at all: the workflows only ever ran against my first commit (2ed1c64); nothing was triggered for the second one, so the status rollup was empty. The rebase re-triggered the full matrix.

Note on the failures that did appear on 2ed1c64 — Documentation, IntegrationTest and ReleaseTest — all three fail on master too, so none are caused by this PR:

workflow last 3 runs on master
Documentation failure, failure, failure
IntegrationTest failure, failure, failure
ReleaseTest failure, failure, failure

The Documentation one is a linkcheck 403 against https://docs.sciml.ai/SciMLBase/stable/interfaces/Problem_Traits/, a URL that several pre-existing docstrings already reference. Run Tests passed.

On versioning: master is at 3.40.0 and the registry's newest is 3.39.1, so 3.40.0 is itself unreleased. I have kept the bump to 3.41.0 rather than folding into 3.40.0 deliberately — if 3.40.0 were registered from a commit predating this one, a downstream SciMLBase = "3.40" floor would resolve to a version without has_sys. Consuming PR SciML/NonlinearSolve.jl#1124 floors on "3.41" for that reason.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI update after the rebase. Everything that has finished passes except one downstream job, and that one is not caused by this PR.

Passing so far: Downgrade (7m32s), Runic Format Check, Runic Suggestions, Spell Check. The rest of the matrix is still queued.

OrdinaryDiffEq.jl/Core / Downstream Tests - Core — fails, inherited from master.

The error is in DiffEqBase's test suite:

Plot Vars: Error During Test at SafeTestsets.jl:30
  Got exception outside of a @test
  LoadError: UndefVarError: `solve` not defined
  in expression starting at downstream/lib/DiffEqBase/test/plot_vars.jl:18
Test Summary: | Error  Total  Time
Plot Vars     |     1      1  1.0s

solve is undefined because master no longer exports it. b9c3507 (#1472, "Make strict QA owner-contract clean") dropped these two lines from src/SciMLBase.jl:

-export solve, solve!, init, discretize, symbolic_discretize
-export step!, deleteat!, addat!, get_tmp_cache,

master still does import CommonSolve: solve, init, step!, but importing is not exporting, so downstream code doing using SciMLBase loses the verbs.

This PR does not touch any of that — git diff origin/master -- src/SciMLBase.jl contains no line mentioning solve. This branch simply sits on top of e0733ef, which includes b9c3507, and inherits the breakage.

#1476 is the fix-forward and restores exactly those exports:

+export solve, solve!, init, step!, discretize, symbolic_discretize

So this job should go green here once #1476 lands, with no change needed on this branch.

`has_sys` is the only member of the `AbstractSciMLFunction` field-existence
trait family that is neither public nor documented — `has_jac`, `has_jvp`,
`has_vjp`, `has_tgrad`, `has_analytic` and `has_initialization_data` all are.
Downstream solver code that must decide whether a problem carries symbolic
metadata (and therefore must keep `u0`/`p` concrete for symbolic indexing and
the initialization pipeline) has no public way to ask, so it reaches into the
internal name instead.

Give it a docstring, add it to the `@public` trait block, and render it
alongside its siblings in the SciMLFunctions interface docs.

Co-Authored-By: Chris Rackauckas <[email protected]>
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Make has_sys and ImmutableNonlinearProblem public API Make has_sys public API Aug 1, 2026
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 1, 2026 20:42
@ChrisRackauckas
ChrisRackauckas merged commit b6e131a into SciML:master Aug 1, 2026
28 of 48 checks passed
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