Skip to content

Code Optimizations and Reverse AD support#75

Open
jmurphy6895 wants to merge 7 commits intoJuliaSpaceMissionDesign:mainfrom
jmurphy6895:feat-more-AD-backend-support
Open

Code Optimizations and Reverse AD support#75
jmurphy6895 wants to merge 7 commits intoJuliaSpaceMissionDesign:mainfrom
jmurphy6895:feat-more-AD-backend-support

Conversation

@jmurphy6895
Copy link
Copy Markdown

  • Added compile_rotation, compile_translation, and compile_direction — an opt-in API that extracts raw closures from the internal FunctionWrapper layer, producing zero-overhead, AD-transparent callables for use in hot loops (e.g., ODE right-hand sides).

  • Added ChainRulesCore and Mooncake package extensions that define rrule pullbacks for all 12 public transformation functions (vector3/6/9/12, rotation3/6/9/12, direction3/6/9/12), enabling reverse-mode AD through Zygote and Mooncake.

  • Cached graph path lookups inside FrameSystem so that repeated transformation calls no longer re-traverse the graph on every evaluation. The cache is lazily rebuilt after topology changes.

  • Fixed root-node self-edge bug (!isnothing(parentid) → parentid != id), fix Direction{O} → Translation{O} in direction construction, and relax Vararg{<:Number} → Vararg{Number} in Translation constructors.

  • New ad_rules.jl tests: Zygote and Mooncake gradients match ForwardDiff/FiniteDiff

  • New compiled.jl tests: compiled callables match FrameSystem outputs across identity, multi-hop, reverse, cross-axes, and order-selection cases; ForwardDiff differentiates through compiled callables

jackyarndley added a commit to jackyarndley/FrameTransformations.jl that referenced this pull request May 2, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jackyarndley added a commit to jackyarndley/FrameTransformations.jl that referenced this pull request May 2, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jackyarndley added a commit to jackyarndley/FrameTransformations.jl that referenced this pull request May 2, 2026
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.

1 participant