Promote despecialized parameter tangents - #5000
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Member
Author
|
The downstream SciMLBase reconstruction half is now the separate draft SciML/SciMLBase.jl#1544. The two PRs are independently scoped and the official LTS |
Member
Author
|
Baseline CI audit for the unrelated Spell Check and docs
Neither failure is caused by this PR's focused diff. |
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.
Ignore this PR until it has been reviewed by @ChrisRackauckas.
What changed and why
Teach ModelingToolkitBase's ChainRules extension to promote a
Tangent{SciMLBase.DespecializedParameters}by unthunking its wrapped parameter cotangent and delegating to the existing promotion path. This preserves the documented AutoDespecialize wrapper boundary during observed-value pullbacks.The extension test covers promoted type, values, and element type. ModelingToolkitBase is bumped from 1.67.0 to 1.67.1. No new public name or dependency is added.
Root cause
ModelingToolkit's AutoDespecialize default introduced by 5585668 causes observed-value AD to return a structural tangent for
DespecializedParameters. ModelingToolkitBase's promotion helper only handled the underlying primal parameter values.Failing before
The official SciMLBase LTS
remake_autodiff.jlpath fails deterministically before this extension method:The matching downstream job is https://github.com/SciML/SciMLBase.jl/actions/runs/32353474895/job/96378948536.
The focused extension regression fails on the same unhandled tangent before the patch.
Passing after
The native owning gate on Julia LTS passes:
With this patch plus the separate SciMLBase ODESolution-container fix, the identical official downstream file passes:
Runic over the changed Julia files, typos over the four-file diff, and
git diff --checkpass on the rebased branch.QA baseline
The required native QA command was run on both the feature work and exact clean current master. The targeted JET fixtures pass 54/54 and all 20 non-package-JET checks pass. The sole clean-master failure is the package-wide JET assertion with 263 reports spanning generated Moshi/JET false positives and multiple independent source areas.
That aggregate master failure was independently audited and is already tracked; it was not changed or silenced here:
The hard package-JET boundary is 92c27bb. The same 263 reports reproduce across older and current JET/SciMLTesting versions.
Not verified
The docs build was not run because this adds no public declaration, signature, docstring, or documentation entry. Root ModelingToolkit functional groups, Julia prerelease, and GPU paths were not run locally.