Skip to content

Fix HomotopyCtx docs/reexport CI failures on top of #5044 - #5048

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-homotopy-public-api-docs
Aug 30, 2026
Merged

Fix HomotopyCtx docs/reexport CI failures on top of #5044#5048
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix-homotopy-public-api-docs

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Ignore until reviewed by @ChrisRackauckas. Opened as a draft.

Read this first: what this PR contains

This is #5044 by @pankgeorg (commit 86b1805, unmodified) plus one fix commit on top (e86e6fc).

It is not an independent change and it deliberately overlaps @pankgeorg's open PR. The intent was a stacked PR whose base is #5044's branch, but that branch lives on a fork, so a stacked base branch cannot be created inside SciML from this account. Merging #5044 first and cherry-picking e86e6fc onto it is equally good and is the outcome I would prefer — the fix is two files and belongs in #5044, not in a competing PR.

Authorship of the feature is @pankgeorg's; only e86e6fc is mine.

The fix (e86e6fc, 2 files, +5 −2)

#5044 declares three new public names in ModelingToolkitBase — @public HomotopyCtx, homotopy_enabled, strip_homotopy — but only homotopy_enabled and strip_homotopy got a rendered docs entry, and none were added to the reexport allow-list. That is the "public and documented move together" rule, and it breaks three CI checks that are green on master:

Check On #5044 Same job on master
build (Documentation) terminates on [:cross_references, :linkcheck]; Cannot resolve @ref for md"[`HomotopyCtx`](@ref)" in docs/src/basics/Homotopy.md terminates on [:linkcheck] only
sublibrary-ci [QA] public API is rendered in docs: isempty([:HomotopyCtx]) — 18 passed, 3 failed 19 passed, 2 failed
tests / QA isempty([:HomotopyCtx, :Unknown, :homotopy_enabled, :scalarize, :shape, :strip_homotopy, :unwrap]) isempty([:Unknown, :scalarize, :shape, :unwrap])

Two changes, no source change — the API surface #5044 chose is untouched, only its documentation and the allow-list that records it:

  • docs/src/basics/Homotopy.md — add ModelingToolkitBase.HomotopyCtx to the page's @docs block. This renders the type (fixing the QA check) and creates the anchor that homotopy_enabled's docstring [`HomotopyCtx`](@ref) resolves against (fixing the docs build).
  • test/qa/qa.jl — add :HomotopyCtx, :homotopy_enabled and :strip_homotopy to REEXPORTED_API, the version-controlled record of what ModelingToolkit deliberately reexports. :ProblemTypeCtx is the closest existing precedent.

Verification of e86e6fc

Run locally on Julia 1.12.7 against the same SciMLTesting build CI uses (SciMLTesting/wvTmj, v2.13.0), before and after the fix.

run_api_docs(ModelingToolkitBase) — before:

┌ Info: run_api_docs: public API names not rendered in a @docs block
│   unrendered =
│    1-element Vector{Symbol}:
└     :HomotopyCtx
Test Summary:                    | Pass  Fail  Total  Time
Public API documentation         |    1     1      2  4.9s
  public API has docstrings      |    1            1  0.0s
  public API is rendered in docs |          1      1  4.2s
ERROR: LoadError: Some tests did not pass: 1 passed, 1 failed, 0 errored, 0 broken.

After:

Test Summary:            | Pass  Total  Time
Public API documentation |    2      2  0.5s

public_reexports(ModelingToolkit; allow = REEXPORTED_API) — before:

allow-list entries: 490
UNAPPROVED PUBLIC REEXPORTS: [:HomotopyCtx, :Unknown, :homotopy_enabled, :scalarize, :shape, :strip_homotopy, :unwrap]

After:

allow-list entries: 493
UNAPPROVED PUBLIC REEXPORTS: [:Unknown, :scalarize, :shape, :unwrap]

The remaining four are preexisting on master — that test fails identically on master (run 33198168273). What matters is that the three names #5044 added are gone.

Documenter cross-references. The full docs build needs the network and fails on :linkcheck on master regardless, so the :cross_references class was isolated locally: a reduced doc set (the Homotopy page plus a stub index) built with doctest = false, linkcheck = false, warnonly = [:cross_references]. This harness is local only; nothing about it is committed. Unresolved @refs, before:

      1 Cannot resolve @ref for md"[`HomotopyCtx`](@ref)"
      3 Cannot resolve @ref for md"[`SciMLBase.HomotopyProblem`](@ref)"

After:

      1 Cannot resolve @ref for md"[`mtkcompile`](@ref)"
      3 Cannot resolve @ref for md"[`SciMLBase.HomotopyProblem`](@ref)"

HomotopyCtx is resolved. The residuals are artifacts of the reduced set — both anchors exist in the full manual (mtkcompile at docs/src/API/model_building.md:153, SciMLBase.HomotopyProblem at docs/src/API/problems.md:52) — and mtkcompile appears only after the fix because rendering HomotopyCtx's docstring is what introduces that reference.

Formatting and spelling: runic --check (Runic v1.10.0, matching #5046) clean on test/qa/qa.jl; typos clean on both files.

What was NOT verified

  • The feature commit 86b1805 was not re-verified by me. Its tests are @pankgeorg's; I checked only that my two files fix the three CI checks above. Treat Add homotopy keyword to mtkcompile to opt out of homotopy lowering #5044's own verification as the source of truth for the feature.
  • The full docs build was not run — it needs Plots/FMI and network linkcheck, and :linkcheck fails on master anyway. Only the :cross_references class was isolated, as described.
  • The full QA test groups were not run, only the two failing checks in isolation.
  • No GPU or downstream jobs.

Expected remaining CI failures, all preexisting on master

This branch is based on f913198, which predates #5046 ("Format files with Runic 1.10"), so it will still show the three Runic failures in MTKBifurcationKitExt.jl, parameter_buffer.jl and accessor_functions.jl — none of which either PR touches. A rebase onto current master clears those. Also red on master and not addressed here: tests/Optimization (12 errors in dynamic_optimization.jl), sublibrary-ci [InterfaceII] (2 failures at jumpsystem.jl:1506-1507), downgrade-mtkbase (QA), and the :linkcheck half of the docs build.

🤖 Generated with Claude Code (model: claude-opus-5[1m])
https://claude.ai/code/session_01Aief3rKoTbHGqMPJZ7t2Jk

pankgeorg and others added 2 commits August 29, 2026 23:07
`mtkcompile(sys; homotopy = false)` replaces every Modelica
`homotopy(actual, simplified)` node by `actual` before compilation, so the
generated code only contains `actual`, problem construction never selects a
`HomotopyProblem`, and the initialization / event affect systems derived from
the compiled system are compiled the same way (recorded via `HomotopyCtx`).
Needed by targets that cannot lower to a continuation solver, e.g.
SciML/DiffEqGPU.jl#516.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVSnyFkgc26AFHAwz857n7
…orts

`mtkcompile(sys; homotopy = false)` declares `HomotopyCtx`, `homotopy_enabled`
and `strip_homotopy` public, but only the latter two got a rendered docs entry
and none were added to the reexport allow-list. That breaks three CI checks that
are green on master.

`HomotopyCtx` gains a `@docs` entry on the Homotopy page, which both renders it
and gives `homotopy_enabled`'s docstring a target for its `[`HomotopyCtx`](@ref)`.
The three names are added to `REEXPORTED_API`, which is the deliberate,
version-controlled record of what `ModelingToolkit` reexports as its own API.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.251
Agent-Model: claude-opus-5[1m]
Agent-Session: https://claude.ai/code/session_01Aief3rKoTbHGqMPJZ7t2Jk
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 30, 2026 10:06
@ChrisRackauckas
ChrisRackauckas merged commit 6b06080 into SciML:master Aug 30, 2026
44 of 45 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.

3 participants