Skip to content

Update observable AD fixtures for despecialized parameters - #1576

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/autozygote-wrapper-fixtures
Draft

Update observable AD fixtures for despecialized parameters#1576
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/autozygote-wrapper-fixtures

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 1, 2026

Copy link
Copy Markdown
Member

Ignore this PR until it has been reviewed by @ChrisRackauckas.

What changed and why

Normalize AutoZygote parameter gradients through the optional DespecializedParameters.params structural 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 AutoSpecialize to AutoDespecialize. The registered boundary is ModelingToolkitBase 1.65.0 to 1.66.0: the two tags show the default changing from SciMLBase.AutoSpecialize to SciMLBase.AutoDespecialize in InitializationProblem.

Zygote correctly mirrors the documented DespecializedParameters.params field 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, where ZYGOTE_BACKENDS is 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:

ODE initialization parameter tangent | 1 failed
Evaluated: (params = (tunable = [...], ...),) == (tunable = [...], ...)

DAE initialization parameter tangent | 1 error
type NamedTuple has no field tunable
Available fields: params

At the direct parent of the introducing ModelingToolkit commit (8b337a8f0ff800c12799244a15fd805af68df5b6), the original assertions pass 2/2:

ODE initialization parameter tangent | 1/1
DAE initialization parameter tangent | 1/1

Passing after

The same focused reproductions on the current dependency stack pass after this fixture update:

ODE initialization parameter tangent | 1/1
DAE initialization parameter tangent | 1/1

Repository gates:

JULIA_CONDAPKG_BACKEND=Null JULIA_PYTHONCALL_EXE=/usr/bin/python3 GROUP=QA \
  timeout 7200 julia +1.10.12 --threads=11 --project=. -e 'using Pkg; Pkg.test()'
QA | 121/121
Testing SciMLBase tests passed

Runic --check --diff: pass
typos: pass
git diff --check: pass

Independent failures / not verified

The full Julia LTS DownstreamAD group was run locally and is not green on current master:

GROUP=DownstreamAD timeout 10800 julia +1.10.12 --threads=11 \
  --project=. -e 'using Pkg; Pkg.test()'
Autodiff Remake | 4 pass, 1 error, 1 broken, 6 total, 24m27.5s

It first stops in remake_autodiff.jl at the independent observable-solution cotangent bug fixed by #1574; after that is bypassed, the registered Mooncake _copy_output NamedTuple 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

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
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