Skip to content

fix: reference Symbolics-owned names through Symbolics in tests - #4991

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-hygiene-namespace-regressions
Aug 18, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-hygiene-namespace-regressions

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What broke

#4989 (mine) trimmed ModelingToolkitBase's import Symbolics: ... list using ExplicitImports' stale-import report. Five of the removed names were still reached as ModelingToolkitBase.<name> / ModelingToolkit.<name> from the test suite:

name referenced from
hessian_sparsity lib/ModelingToolkitBase/test/nonlinearsystem.jl:95,97
MultithreadedForm lib/ModelingToolkitBase/test/bigsystem.jl:60,80
SerialForm lib/ModelingToolkitBase/test/bigsystem.jl:79
CTarget lib/ModelingToolkitBase/test/ccompile.jl:12
derivative test/reduction.jl:270

ExplicitImports was right that src never uses them, but they were in ModelingToolkitBase's namespace because of those imports, and none of the five is exported by Symbolics (Base.isexported(Symbolics, :hessian_sparsity) == false, same for MultithreadedForm), so @reexport using Symbolics does not cover them.

Master is currently red as a result: InterfaceII on all three Julia versions and Extended on all three.

master @ 63f684c, tests/InterfaceII (julia 1):
  1037 passed, 0 failed, 3 errored, 7 broken
  UndefVarError: `hessian_sparsity` not defined in `ModelingToolkitBase`

master @ 63f684c, sublibrary [Extended] (julia 1):
  UndefVarError: `MultithreadedForm` not defined in `ModelingToolkitBase`

The fix

Reference each through Symbolics, the module that owns them — consistent with #4989's intent rather than reverting it. Test-only changes; no src change, so the import hygiene stays as merged.

Verification

lib/ModelingToolkitBase/test/nonlinearsystem.jl run directly against this branch:

EXIT: 0
Test Summary:             | Pass  Total  Time
...

Discriminating check — same branch, with only nonlinearsystem.jl reverted to master's version:

REVERTED EXIT: 1
  UndefVarError: `hessian_sparsity` not defined in `ModelingToolkitBase`

I searched for the complete set rather than fixing them one at a time: every identifier present in the import block before #4989 and absent after was cross-referenced against qualified ModelingToolkit(Base).<name> uses across lib/, src/ and test/. That yielded exactly these five, and none remain.

runic --check clean on all four files.

Not verified

I ran nonlinearsystem.jl directly, not the full InterfaceII or Extended groups (each ~50 min), and not ccompile.jl/bigsystem.jl, which need a C compiler and a large sparse build respectively. CI covers those.


Please ignore until reviewed by @ChrisRackauckas.

SciML#4989 trimmed `hessian_sparsity`, `MultithreadedForm`, `SerialForm`, `CTarget`
and `derivative` from ModelingToolkitBase's Symbolics import list, as
ExplicitImports reported them unused in `src`. They were still reached as
`ModelingToolkitBase.<name>` from tests, and none is exported by Symbolics, so
the re-export does not cover them. That broke InterfaceII and Extended.

Reference them through Symbolics, which owns them.

Co-Authored-By: Chris Rackauckas <[email protected]>
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 18, 2026 22:00
@ChrisRackauckas
ChrisRackauckas merged commit f0dbc2e into SciML:master Aug 18, 2026
69 of 92 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