Update observable AD fixtures for despecialized parameters - #1576
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Update observable AD fixtures for despecialized parameters#1576ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512
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
Normalize AutoZygote parameter gradients through the optional
DespecializedParameters.paramsstructural wrapper in the two initialization-observable fixtures. The numerical contracts are unchanged: the ODE case still compares the complete inner parameter gradient, and the DAE case still requires exactly one nonzero tunable gradient.This is a five-line test-only compatibility fix. It adds no public API, dependency, documentation, or version change.
Root cause
ModelingToolkit commit SciML/ModelingToolkit.jl@5585668 from SciML/ModelingToolkit.jl#4919 changed generated initialization problems from
AutoSpecializetoAutoDespecialize. The registered boundary is ModelingToolkitBase 1.65.0 to 1.66.0: the two tags show the default changing fromSciMLBase.AutoSpecializetoSciMLBase.AutoDespecializeinInitializationProblem.Zygote correctly mirrors the documented
DespecializedParameters.paramsfield in its structural gradient. The fixtures instead continued comparing/accessing the pre-wrapper shape directly. This is the AutoZygote counterpart of the Mooncake fixture adjustment already merged in #1545. That PR's full local validation used Julia 1.12, whereZYGOTE_BACKENDSis empty, so these Julia LTS assertions were not exercised.Failing before
On clean SciMLBase master
3d95609f7dc1c86a8fded41b9d357bcf25b83ad3, ModelingToolkit 11.40.0 / ModelingToolkitBase 1.68.2, and Julia 1.10.12, focused reproductions of the unchanged assertions fail as follows:At the direct parent of the introducing ModelingToolkit commit (
8b337a8f0ff800c12799244a15fd805af68df5b6), the original assertions pass 2/2:Passing after
The same focused reproductions on the current dependency stack pass after this fixture update:
Repository gates:
Independent failures / not verified
The full Julia LTS
DownstreamADgroup was run locally and is not green on current master:It first stops in
remake_autodiff.jlat the independent observable-solution cotangent bug fixed by #1574; after that is bypassed, the registered Mooncake_copy_outputNamedTuple type assertions fail before this file can execute the changed initialization fixtures. The hosted master failure is https://github.com/SciML/SciMLBase.jl/actions/runs/33447000990/job/99668297921.The focused AutoZygote tests above exercise both changed assertions without disabling or weakening them. Docs were not built because this PR changes neither public API nor documentation. Julia 1.12 does not execute these AutoZygote loops; GPU paths were not run.
🤖 Generated with Claude Code
https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512