Repository navigation
make types safe to print when verbose stacktraces are on - #419
Closed
KristofferC wants to merge 4 commits into
Closed
KristofferC wants to merge 4 commits into
KristofferC wants to merge 4 commits into
Conversation
Member
|
@avik-pal can we incorporate this into the macro? |
Codecov Report
@@ Coverage Diff @@
## master #419 +/- ##
==========================================
- Coverage 53.85% 53.26% -0.60%
==========================================
Files 46 46
Lines 3589 3588 -1
==========================================
- Hits 1933 1911 -22
- Misses 1656 1677 +21
... and 9 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Author
|
Author
|
Also, in cases like one should run |
Member
|
Thanks. Replaced by #420, where now everything uses the macro and the macro incorporates your improvements from here. |
ChrisRackauckas
added a commit
that referenced
this pull request
Aug 26, 2026
…1550) * Restore the SciMLOperators operator interface on `using SciMLBase` #1472 dropped `@reexport using SciMLOperators` from `src/SciMLBase.jl`. Reexport exports `filter(x -> Base.isexported(m, x), names(m; all = true, imported = true))`, so that line had been putting SciMLOperators' 33 exported names plus the `SciMLOperators` module binding into scope for every `using SciMLBase`. Removing it silently deleted all 34 from SciMLBase's public surface: nothing in SciMLBase's own tests imports them, so CI stayed green while `using SciMLBase; MatrixOperator(A)` started failing with `UndefVarError` across the ecosystem. SciMLBase is the root of the SciML dependency tree, so the blast radius is every package and script that reached an operator through it. `OptimizationBase` records the same surface from the other side: its comment notes that blanket-reexporting SciMLBase "put 256 names into every downstream namespace -- `DynamicalSDEFunction`, `BlockDiagonalOperator`, `AddVector` and the rest of SciMLOperators". Restore the surface as an explicit `export` list rather than the blanket reexport, following the Sundials.jl#553 pattern. The list is the operator interface SciMLBase's own documentation is written in terms of: `SciMLFunctions.md` documents `jac_prototype` as "an `AbstractSciMLOperator`" whose Jacobian update goes through `update_coefficients!`/`update_coefficients`, and `SplitFunction`, `SplitODEProblem` and `IncrementingODEProblem` are all specified as operator-valued. That means the premade operator types, the operator traits, and the update/cache verbs -- 32 names. Deliberately excluded from the 34: `WOperator` and `StaticWOperator`. They are the stiff-solver W = M - gamma*J machinery, constructed by OrdinaryDiffEq and consumed by LinearSolve, both of which depend on SciMLOperators directly. A `using SciMLBase` user never builds one. `jacobian_stale`, `mark_jacobian_updated!` and `mark_jacobian_current!` are not in the list either: SciMLOperators only started exporting them in #419, after #1472, so they were never part of this surface. `AbstractSciMLOperator` is a common assumption in reports about this breakage, but it was never reexported here: SciMLOperators has never exported it, and its `@public` declaration landed in #418, after #1472 -- and Reexport filters on `Base.isexported` regardless. It stays reachable the documented way, qualified as `SciMLOperators.AbstractSciMLOperator`, which is why the `SciMLOperators` binding itself is back in the export list. `const isconstant = SciMLOperators.isconstant` becomes an ordinary `using SciMLOperators: isconstant`, matching what `solve!` already does with CommonSolve. The alias made SciMLBase the binding owner, which would have failed `run_api_docs`' docstring check once the name was exported; imported, the docstring resolves to SciMLOperators. QA declares the list through `reexports_allow`, and a new "Reexport surface" testset asserts every approved name is both in `names(SciMLBase)` and actually in scope from a bare `using SciMLBase`, evaluated in a dedicated module so the extension trigger packages `test/qa/qa.jl` loads cannot mask a missing export. The allow-list cannot drift from the exports in either direction. Restoring names that used to be exported is not breaking; no version bump here. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ * docs: render the reexported API A restored export that is not documented is only half the fix: nothing tells the next reader, or the next QA sweep, that the name is deliberately part of SciMLBase's surface or which package actually owns it. Add `docs/src/interfaces/Reexported_API.md`, wired into `docs/pages.jl`, listing every name `using SciMLBase` provides that SciMLBase does not define. The 32 SciMLOperators names are grouped by role -- the `SciMLOperators` module binding, operator types (trivial / matrix-backed / scalar / matrix-free / structured and lazy), and the operator interface and traits (updating / caching and materialization / structural traits / supported-operation traits / lazy algebra) -- each stated as owned and documented by SciMLOperators, with links to its Premade Operators and interface pages. The CommonSolve verbs already exported here get the same treatment. The page closes with the boundary: anything else from SciMLOperators must be imported from SciMLOperators directly. Two exclusions are spelled out rather than left to look like oversights. `AbstractSciMLOperator` and the other abstract and lazy-algebra types are public but deliberately not exported by SciMLOperators, so they are not exported here either and are used qualified -- which is what the reexported `SciMLOperators` binding is for. `WOperator`, `StaticWOperator`, `jacobian_stale`, `mark_jacobian_updated!` and `mark_jacobian_current!` are stiff-solver W-matrix machinery for packages that depend on SciMLOperators directly. `SciMLFunctions.md` already describes `jac_prototype` in terms of `AbstractSciMLOperator` and `update_coefficients!`, so it now points at the new page for the exact list. The list now lives in three places -- the page, the `export` block in `src/SciMLBase.jl`, and `_scimloperators_reexports` in `test/qa/qa.jl`. All three are identical, the two code copies carry cross-references to the other two, and the "Reexport surface" testset holds the code copies to the actual export surface. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ * compat: raise the SciMLOperators floor to 1.19 Downgrade CI resolved SciMLOperators to the declared floor, 1.3.0, where the new `using SciMLOperators: ...` line fails at precompile time: ERROR: LoadError: UndefVarError: `BlockDiagonalOperator` not defined ERROR: LoadError: Failed to precompile SciMLBase That is the honest consequence of the restoration: the reexported names are newer than the floor SciMLBase carried, and until now nothing in SciMLBase referenced them, so the floor was never tested against them. `BlockDiagonalOperator` is only the first name the loader reaches. Walking every registered 1.x tag of SciMLOperators and extracting its `export` blocks gives the introduction point of each of the 32 restored names: - 1.0.0 -- the other 27 names - 1.13.0 -- `has_concretization` - 1.19.0 -- `BlockDiagonalOperator`, `TensorSumOperator`, `kronsum` so 1.19.0 is the first registered version that exports all of them, and every release from 1.19.0 through 1.28.0 (and master's 1.29.0) still does. 1.19.0 is not yanked, and its registered git-tree-sha1 matches the `v1.19.0` tag. 1.18.0 is missing three of the names, so this floor is minimal rather than merely sufficient. Verified by resolving SciMLOperators to exactly 1.19.0 against this branch: SciMLBase precompiles, `names(SciMLBase)` is 498, and all 32 names are in scope from a bare `using SciMLBase`. Julia floors match (both 1.10), and SciMLOperators 1.19.0's own bounds are already satisfied by SciMLBase's -- `ArrayInterface` 7.19 exactly, `Adapt`, `DocStringExtensions` and `StaticArraysCore` above -- except `Accessors`, where SciMLOperators 1.19.0 wants 0.1.42 and SciMLBase declares 0.1.39. That needs no change here: the downgrade action resolves a jointly minimal version set rather than pinning each direct dependency, so it lifts Accessors to satisfy the transitive bound, and SciMLBase's own 0.1.39 floor remains accurate for its own use. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ * docs: fix the CommonSolve owner link (#1555) AI-Agent: OpenAI Codex Codex-Session-ID: 01a03a11-47c2-77e0-858b-167004f0b79c Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ Co-authored-by: ChrisRackauckas-Claude <[email protected]> Co-authored-by: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Chris Rackauckas - Beep Boop Edition <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first commit invokes the show method for general
Types in order for it to be safe. So at least people that hit SciML/TruncatedStacktraces.jl#18 can now disable it and get working code:The second commit was made by "pattern recognition". I am not sure, but it looks like a typo that those
showmethods were defined on the instance of the struct and not the type. But I might be wrong.