Handle despecialized observable parameter tangents - #1545
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Handle despecialized observable parameter tangents#1545ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
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
Make the observable-AD fixture extract its parameter tangent through either the legacy direct
tunablefield or the currentDespecializedParameters.paramswrapper, then retain the sametunable ≈ gp_refnumerical contract.This is test-only compatibility with the documented AutoDespecialize boundary. No assertion is removed or loosened, and there is no public API, dependency, docs, or version change.
Root cause
ModelingToolkit commit SciML/ModelingToolkit.jl@5585668 from SciML/ModelingToolkit.jl#4919 changed generated problem defaults to AutoDespecialize. The returned parameter tangent is therefore wrapped in
DespecializedParameters.params; the existing test continued assuming the prior directtunableshape.The exact binary boundary is ModelingToolkitBase 1.65.0 → 1.66.0. Pinning ModelingToolkit root alone is insufficient because the constructor lives in ModelingToolkitBase.
Failing before
On current ModelingToolkit 11.39.1 / ModelingToolkitBase 1.67.0, the unchanged focused file reaches:
The true old-stack control—ModelingToolkit 11.39.0 plus ModelingToolkitBase 1.65.0—passes the original initialization assertion 4/4.
Passing after
On the current stack after this test-only fix:
The final owning gates pass:
Runic, typos over the diff, and
git diff --checkpass.Upstream prerequisite / not verified
Registered Mooncake 0.5.46 currently fails earlier in this same file at lines 82 and 123 because its tuple-copy helper asserts the concrete reconstructed NamedTuple type against an abstract-field NamedTuple. The final DownstreamAD run used a locally validated Mooncake fix to reach and prove this independent fixture regression; no Mooncake PR has been opened.
The Mooncake patch has its own standalone no-SciML fail/pass reproducer and passed Mooncake's full Julia 1.12
basicgroup (29,487 pass, 2 pre-existing broken). Until that upstream fix is released, standalone CI may stop before reaching this PR's corrected assertion.Julia LTS/prerelease, GPU paths, and docs were not run for this test-only PR.