Repository navigation
Normalize Mooncake promote_f tuple tangents - #4242
Merged
ChrisRackauckas merged 1 commit intoAug 22, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
This was referenced Aug 14, 2026
Co-Authored-By: Chris Rackauckas <[email protected]>
ChrisRackauckas-Claude
force-pushed
the
agent/fix-mooncake-promote-f-tangent
branch
from
August 20, 2026 19:25
b89414a to
d1f8288
Compare
This was referenced Aug 20, 2026
ChrisRackauckas
marked this pull request as ready for review
August 22, 2026 07:31
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.
What changed
Mooncake represents the tangent and forward data for a tuple whose fields are both nondifferentiable as a single
NoTangent/NoFData, not as a two-element tuple. Thepromote_frules added in #4201 always constructed the latter, so FullSpecialize solves failed a generated type assertion before integration.This normalizes the two nondifferentiable fields to Mooncake's collapsed representation in both the reverse and forward rules, while preserving tuple representation when either field carries data. The regression test covers both Mooncake gradient and scalar derivative paths through a FullSpecialize solve.
Verification
Julia 1.12.6, current upstream
master293f1195207aa66a9416be563297f05f13a53c61.Failing before, clean master:
GROUP=AD julia +release --startup-file=no --project=. -e 'using Pkg; Pkg.test(coverage=false)'The first phases passed, then the existing discrete-adjoint gradient errored:
Passing after:
GROUP=AD julia +release --startup-file=no --project=. -e 'using Pkg; Pkg.test(coverage=false)'GROUP=QA julia +release --startup-file=no --project=. -e 'using Pkg; Pkg.test(coverage=false)'DiffEqBase QA also passed
9/9. Runic, typos over the diff, andgit diff --checkpassed.No public API or documentation changed, so I did not run the docs build.
Not verified
I did not run Julia LTS/pre-release, GPU, or downstream package groups locally.