Migrate AD backends to a group env (test/AD/Project.toml)#339
Merged
ChrisRackauckas merged 1 commit intoJul 4, 2026
Merged
Conversation
The heavy optional AD backends (Mooncake, Zygote) were listed in the root
Project.toml old-style [extras] + [targets].test. Because the root has [extras],
the Downgrade CI lane resolves the root/test dependencies through the merged
[extras] joint graph, which drags the Mooncake/Zygote backend trees into the
root's minimum-version resolution. That joint graph is the fragile part of the
downgrade lane (Resolver.jl min-resolving all optional backends together).
Move the AD-only test dependencies into a group-specific test/AD/Project.toml so
the AD tests run in their own sub-environment (SciMLTesting folder-discovery
activates test/AD/Project.toml automatically for the AD group), while the
root/Core downgrade no longer floor-resolves the AD backend graph.
- test/AD/Project.toml: new group env with the exact deps test/AD/*.jl uses
(Integrals, Mooncake, Zygote, FiniteDiff, ForwardDiff, Cuba, Cubature,
FastGaussQuadrature, Test, SafeTestsets, SciMLTesting), [sources] Integrals =
{path = "../.."}, and [compat] mirroring the root floors so downgrade coverage
of the backends is preserved (now exercised in the AD env, not the root).
- Root Project.toml: drop Mooncake, Zygote, FiniteDiff, ForwardDiff from
[extras] and [targets].test. Mooncake/Zygote/ForwardDiff remain [weakdeps]
(their [compat] entries stay). FiniteDiff was a pure test dep (never a
weakdep), so its now-dangling [compat] entry is removed as well.
The cross-backend AD tests (test/AD/derivative_tests.jl,
test/AD/nested_ad_tests.jl) are unchanged; they still cross-compare
ForwardDiff/FiniteDiff/Zygote/Mooncake in a single environment.
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.
Note
Please ignore this PR until it has been reviewed by @ChrisRackauckas. Draft — opened by an automated agent.
What
Move the heavy optional AD backends Mooncake and Zygote (plus the AD-only quadrature helpers FiniteDiff, ForwardDiff) out of the root package's old-style
[extras]+[targets].testand into a group-specifictest/AD/Project.toml.Why
Integrals.jlis a hybrid: it uses SciMLTesting folder-model test groups (test/test_groups.tomldeclaresCore/AD/QA;test/runtests.jlis justrun_tests()), but the rootProject.tomlstill carries the old-style[extras]+[targets].testlisting all test deps, including Mooncake/Zygote.Because the root has
[extras], the Downgrade CI lane resolves the root/test dependencies through the merged[extras]joint graph. Mooncake/Zygote are[weakdeps]that are also test-[extras], so the downgrade harness floor-checks each backend against that root graph. Min-version resolving the optional AD backend trees against the root is the fragile part of the downgrade lane (Resolver.jl--minon the joint optional-backend graph).Moving the AD backends into their own group env means:
[extras], sointersect([weakdeps], [extras])(the harness's per-backend floor-check set) drops from 13 entries to 10 (Mooncake, Zygote, ForwardDiff gone).test/AD/Project.toml, whose[compat]mirrors the root floors.test/AD/Project.tomlfor theADgroup (_run_group_folder→activate_group_env), developing the root package by path. Noruntests.jlchange needed.Changes
test/AD/Project.toml— group env with exactly the depstest/AD/*.jluses (Integrals,Mooncake,Zygote,FiniteDiff,ForwardDiff,Cuba,Cubature,FastGaussQuadrature,Test,SafeTestsets,SciMLTesting),[sources] Integrals = {path = "../.."}, and[compat]mirroring the root floors (modeled ontest/qa/Project.toml).Project.toml— dropMooncake,Zygote,FiniteDiff,ForwardDifffrom[extras]and[targets].test. Mooncake/Zygote/ForwardDiff stay[weakdeps](their[compat]entries stay, since they still gate extensions).FiniteDiffwas a pure test dep (never a weakdep), so its now-dangling[compat]entry is removed too.The cross-backend AD tests (
test/AD/derivative_tests.jl,test/AD/nested_ad_tests.jl) are unchanged — they still cross-compare ForwardDiff / FiniteDiff / Zygote / Mooncake in a single environment.test/quadrule_tests.jl's onlyusing Zygoteis inside a#= ... =#block comment (a commented-out derivative example), so Core never actually needed Zygote.Local validation
mode=deps, julia=1): master floor-checks 13 weakdep extensions incl. Mooncake/Zygote/ForwardDiff (writesManifest-Mooncake.toml/-Zygote.toml/-ForwardDiff.toml); this branch floor-checks 10 and produces no Mooncake/Zygote/ForwardDiff manifests. BaseManifest.tomlcontains none of them. Root downgradeSuccessfully resolvedon both, but the AD joint graph is no longer in the root.activate test/AD+ develop root + instantiate resolves Mooncake 0.5.36, Zygote 0.7.11, ForwardDiff 1.4.1, FiniteDiff 2.31.1;IntegralsMooncakeExt/IntegralsZygoteExt/IntegralsForwardDiffExtprecompile.GROUP=Core, Julia 1.12): all 8 top-level test files pass (1740 assertions),Testing Integrals tests passed, with no Mooncake/Zygote in the env.GROUP=ADauto-activatestest/AD/Project.toml, develops Integrals by path, instantiates the AD backends.🤖 Generated with Claude Code