Skip to content

Fix callable interpolation builder symtype#480

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:agent/fix-parametrized-interpolation-symtype
Closed

Fix callable interpolation builder symtype#480
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:agent/fix-parametrized-interpolation-symtype

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Jul 13, 2026

Copy link
Copy Markdown
Member

Please ignore this PR until reviewed by @ChrisRackauckas.

Summary

  • register CachedInterpolation as returning a callable Real -> Real symbolic value
  • derive that callable symtype through public SymbolicUtils.@syms and SymbolicUtils.symtype APIs
  • directly regress calling the bound interpolator before constructing and solving its ODEProblem

Why

@register_symbolic otherwise gives the interpolation builder a scalar Real return type. The builder actually returns an interpolation function, so later symbolic calls fail with fntype_X_Y(::Type{Real}). This is the failure reported in SciML/ModelingToolkit.jl#4527 and reproduced by the ParametrizedInterpolation documentation example.

The implementation intentionally does not use SymbolicUtils.FnType, which is not public. The public construction was checked with both SymbolicUtils 4.40.0 and the package floor 4.38.1; in both cases the builder symtype is callable and calling it has symtype Real.

This final head is eb23f169, rebased on current upstream d0243bd3 after #477 and #478 merged. The paired strict documentation repair and end-to-end build are in #481.

Local validation

  • Julia 1.12.6 focused reproduction: problem=ODEProblem, retcode=Success, samples=8
  • final rebased full test/sources.jl: exit 0; ParametrizedInterpolation 10 passed and 1 pre-existing broken
  • GROUP=QA Pkg.test() before the base-only Fix isothermal domain test connections #478 rebase: 19 passed, 19 total; the rebase changed only the unrelated isothermal test
  • final stacked strict documentation build in Repair documentation example setup #481: exit 0 through CrossReferences, CheckDocument, Populate, RenderDocument, HTMLWriter, and inventory generation
  • repository-wide Runic check on the final rebased tree: exit 0
  • git diff --check: exit 0

No test or example is skipped, disabled, loosened, or made warn-only by this PR.

Independent failures observed

Current upstream already contains the Chua and isothermal repairs from #477 and #478. The official GROUP=Core run now progresses through those tests and stops at the untouched exact-equality assertion in test/magnetic.jl:66, where the residual is one floating-point ULP. That clean-main failure is under a separate bisect and focused audit; no unrelated numerical assertion is changed here.

An exploratory run with DataInterpolations 9.0.2 exposed an unrelated ForwardDiff error, but 9.x is outside this package's declared test compatibility (DataInterpolations = "8"). The supported resolver choice, 8.10.0, passes the complete source test file as reported above.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Validation checkpoint for 37ae899a:

  • focused ODE reproduction built and solved successfully (retcode=Success, 8 samples)
  • full compatible test/sources.jl completed with sources_test_exit=0 (ParametrizedInterpolation: 10 pass, 1 existing broken)
  • GROUP=QA Pkg.test() completed 19/19
  • repository-wide Runic completed with runic_exit=0
  • public callable-symtype construction checked on SymbolicUtils 4.38.1 and 4.40.0; no non-public FnType dependency is used

The complete Core run remains independently blocked after the open #477/#478 test repairs by the untouched magnetic assertion documented in the PR body.

Register CachedInterpolation's symbolic result as a callable Real-to-Real value, derived through public SymbolicUtils APIs. Add a regression that calls the bound interpolator before building and solving the ODEProblem.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the agent/fix-parametrized-interpolation-symtype branch from 11ec3b3 to eb23f16 Compare July 13, 2026 10:50
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Final rebase and validation checkpoint:

  • refetched upstream and origin; upstream remains d0243bd3, and source head eb23f169 is based directly on it
  • final test/sources.jl exited 0: ParametrizedInterpolation 10 passed and 1 pre-existing broken
  • the final stacked strict documentation build in Repair documentation example setup #481 exited 0 through rendering and inventory generation
  • repository-wide Julia Runic check and git diff --check both exited 0 on the final tree
  • current clean-main Core proceeds through merged test: use Base.ifelse in Chua circuit #477/Fix isothermal domain test connections #478 and then stops at the independently audited one-ULP magnetic equality; no magnetic assertion is changed here

The PR description now reflects the final base and evidence.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI downgrade checkpoint: the failed downgrade job resolves the clean-main ModelingToolkitBase 1.0 floor and reaches the already-reproduced array_variable_assignments symbolic-index error in test/continuous.jl. That independent minimum-compatibility failure is the subject of focused draft #482, whose MTKBase 1.1 floor makes the regression pass 1/1 and continuous pass 76/76 locally and in its own CI before the separate motor blocker. No change to #480's interpolation implementation is justified by this failure.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI documentation checkpoint: #480's docs job confirms the callable interpolation repair itself gets past the prior fntype_X_Y(::Type{Real}) failure. The remaining strict example failures are exactly the three docs-only repairs isolated in #481:

  • incomplete position-domain initialization in connectors/connections.md
  • ambiguous bare @extend OnePort() in tutorials/custom_component.md (with cascading undefined names)
  • missing direct OrdinaryDiffEqSDIRK ownership for ImplicitEuler

The final stacked #481 tree passes the unchanged strict local build end-to-end. Those docs changes remain separate from #480's source/API fix.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

All three hosted Core variants now confirm the same unrelated blocker described above: Core/magnetic.jl passes 2 assertions and fails only the exact reconstructed-flux equality at line 66. The focused one-ULP regression repair is published separately as #484; #480’s sources.jl interpolation coverage itself passed locally (10 pass, 1 pre-existing broken).

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

This is now fully superseded by merged #481. Rebasing this branch onto current main drops its sole commit as an already-upstream patch: #481 carried the same callable interpolation builder source fix and regression tests along with the documentation repair. Closing to avoid retaining a zero-diff draft.

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