Repository navigation
Evaluate paired spacecraft forces and torques once per RHS - #72
Merged
Merged
Conversation
Pair force and torque evaluations only when spacecraft binding identity and depletion-suppression policy match. This preserves independent callback results for differently bound acceleration and torque channels while retaining aggregate per-RHS reuse.\n\nVerified with PYTHONPATH=/home/yeager7/.cache/claude/ssatk-wt/sixdof-force-reuse MPLBACKEND=Agg /home/yeager7/envs/env_python3/bin/python -m pytest tests/test_propagators_6dof.py tests/test_6dof_variational.py -q: 58 passed in 15.54s, plus an independent callback check producing acceleration area=2 and torque area=3 with pairing disabled.
Restrict the combined force/torque fast path to the five built-in models with unchanged public delegators. Subclasses or instances overriding acceleration, torque, or the private combined method now use the public callbacks independently; aggregate children apply the same guard.\n\nVerified bounded direct and aggregate subclass reproductions: public acceleration/torque outputs were preserved and the fast path was bypassed. Inherited subclasses remained eligible; instance and class overrides were rejected.\n\nValidation: PYTHONPATH=/home/yeager7/.cache/claude/ssatk-wt/sixdof-force-reuse MPLBACKEND=Agg /home/yeager7/envs/env_python3/bin/python -m pytest tests/test_propagators_6dof.py tests/test_6dof_variational.py -q: 58 passed in 24.90s.
Reject combined force/torque pairing when any resolved __call__, acceleration, torque, or private combined method differs from the marker owner. This catches overrides introduced by intermediate base classes and direct __call__-only subclasses; aggregate children use the same eligibility predicate.\n\nVerified two-level FacetDrag subclasses through both direct and models=[...] propagation: torque override reached omega_y=4.56 and __call__ override reached v_x=1.23. Inherited non-overriding subclasses remained eligible.\n\nValidation: PYTHONPATH=/home/yeager7/.cache/claude/ssatk-wt/sixdof-force-reuse MPLBACKEND=Agg /home/yeager7/envs/env_python3/bin/python -m compileall -q ssatk/accelerations_6dof ssatk/propagators_6dof; targeted propagation/variational suite: 58 passed in 3.45s.
Do not infer toolkit aggregate closures from an arbitrary _models attribute. Mark only _sum_model_accelerations and _sum_model_torques outputs, leaving opaque user composites on their public acceleration and torque callbacks.\n\nVerified an opaque model with _models=(child,), public acceleration=2*ones and torque=3*ones through both direct and models=[...] propagation: v=[0.02,0.02,0.02] and omega=[0.03,0.03,0.03] in both paths.\n\nValidation: PYTHONPATH=/home/yeager7/.cache/claude/ssatk-wt/sixdof-force-reuse MPLBACKEND=Agg /home/yeager7/envs/env_python3/bin/python -m compileall -q ssatk/propagators_6dof; targeted propagation/variational suite: 58 passed in 6.59s.
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.
Summary
Use a combined per-RHS evaluation for eligible built-in force/torque models and toolkit-created sums, without a mutable state cache. Preserve independent callbacks when bindings, depletion policies, public methods, or subclass overrides differ. Opaque user models are not inferred to be linear sums from private attributes.
Validation
Standalone numerical suite: 739 passed, 5 optional skips. Final direct/aggregate opaque-model, binding/suppression, class/instance/MRO override checks pass; 58 propagation/variational tests passed on the final correction. Policy, release metadata, syntax Ruff and whitespace checks pass. The full publishing/browser run is in progress.
The continuation will freshly validate both full suites and docs against current main, then wait for every CI check. Broader variational/extended finite-difference redesign is deliberately outside this patch because it requires explicit callback-derivative contracts.