Repository navigation
Fix Lambert solver accuracy, convergence, and transfer direction - #1653
Merged
Merged
Conversation
Correct both Gooding starters and use consistent minimum-time data. Safeguard the minimum search with a derivative bracket, bisection fallback, and finite/convergence checks. Handle coalesced roots explicitly. Add independent root and orbit regressions, including lambda = -0.99, and update module documentation, release notes, and known issues. Validation: 733 C/C++, 97 Rust, and 12717 Python tests passed (1 skipped). All 669 Lambert tests passed in 1.59 seconds (2.65 seconds with startup).
Allow Gooding and Izzo to solve retrograde transfers by selecting the orbit normal and complementary transfer angle from LambertProblemMsgPayload's transferDirection field. Preserve PROGRADE as the zero/default value and expose the choice through LambertPlanner.setTransferDirection. Reject unknown direction values and document the input-frame and polar conventions. Add reported-orbit, multi-revolution, minimum-time, unbound, polar, and planner-to-solver regression coverage, plus release and known issue notes. Validation: full build and documentation build passed; 733 C/C++, 97 Rust, and 12793 Python tests passed (1 skipped). All 745 Lambert tests passed in 1.61 seconds, or 2.70 seconds including startup. Modified headers compile in isolation, including the message payload as C. Fixes #1652.
…utions Bracket each root branch and require finite results, a small root step or correction, and a small flight-time residual before publishing velocities. Clear failed solution and performance slots independently on every update. Preserve accurate starters and converged corrections, resume high-order refinement after bisection, and evaluate near-parabolic flight times smoothly. Document the convergence contract and validator iteration limit, with release notes and known-issue updates. Add regression coverage for numerical failure and recovery, independent branch validity, near-minimum and parabolic transfers, iteration counts, and validator acceptance. Validation: 1,023 Lambert Python tests, three native tests, both Lambert scenarios, standalone header checks, and the documentation build pass.
…dling Correct the logarithmic interpolation exponent in the C++ solver and Python reference so intermediate zero-revolution starters stay between zero and one. This reduces unnecessary refinements and prevents iteration-limit rejection by the validator for affected transfers near the parabolic boundary. Handle exact parabolic flight times analytically in the Python reference and use a stable Newton step near that boundary, avoiding NaNs when a starter rounds to one while retaining the actual flight-time residual. Add interpolation, root accuracy, iteration-count, validator, and unmocked parabolic-boundary regressions. Update module documentation, release notes, and known issues. Validation: 1,196 Lambert Python tests passed in 2.05 seconds (3.22 seconds including startup), all three native Lambert tests passed, and documentation built without warnings. Additional independent boundary probes passed.
Recompute the alignment rejection flag on every update so one aligned input cannot permanently disable the solver. Return before normalizing a rejected orbit normal while retaining cleared solution and performance outputs. Add regressions that reuse one module and message without resets across aligned and valid requests, covering both algorithms, transfer directions, zero- and multi-revolution transfers, and alignment-threshold changes. Update module documentation, release notes, and known issues. Validation: 1,248 Lambert Python tests passed in 2.07 seconds (3.19 seconds including startup), all three native tests and both Lambert scenarios passed, and documentation built without warnings. Mixed-update recovery probes matched fresh-module results.
Reject nonfinite or nonpositive time and gravity, unusable endpoint norms, and invalid alignment thresholds before solving. Preserve accepted configuration after rejected values and allow corrected requests to recover. Use componentwise roundoff bounds to reject parallel and antiparallel endpoints before computing lambda or scaled flight time. Add Python and native regressions for validation, recovery, output clearing, and floating-point exceptions; update module documentation, release notes, and known issues.
Store LambertProblemMsgPayload.solverMethod as a raw integer and reject values other than IZZO or GOODING before converting to the internal enum or updating solver state. Preserve the Izzo default and recovery after corrected requests. Add Python and native regressions for integer boundaries, message transport, default selection, and recovery with both methods. Document the C++ payload type change in the module guide, release notes, and known issues.
Preserve endpoint velocities derived from classical orbital elements instead of overwriting them with solver outputs. Wrap elliptic mean-anomaly differences forward to obtain the correct flight time across periapsis. Add eight eccentric-orbit cases and sixteen corruption checks covering both endpoint velocities, both solvers, and all four conic cases. Document the analytical validation and its units while retaining fast single-step tests.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was
linked to
issues
Oct 26, 2026
Closed
Validate Lambert position components with std::isfinite to reject quiet NaNs without raising FE_INVALID on x86. Extend native regression coverage to every component of both endpoints. Generate the Corrosion patch from pristine cached source on each configuration, preserving unchanged output timestamps. Add regressions for repeated configuration with matching timestamps. Update module documentation, release notes, and known issues. Validation: 1,561 Lambert Python tests, 8 native tests, 23 Rust build tests, CMake target-query checks, isolated x86 checks, and documentation build.
6 tasks
Contributor
|
Thank you for fixing both issues so quickly, and for including the starting-value change. I will re-run the full sweep against develop and post the results here. |
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.
Description
Fix duplicate Gooding multi-revolution solutions and add explicit prograde/retrograde selection through the Lambert problem message and planner. Both algorithms now preserve distinct solution branches and handle coalesced roots at the minimum transfer time.
Additional fixes safeguard minimum-time and root searches, correct the intermediate Izzo starter, restore recovery after aligned inputs, and validate numeric inputs, configuration, and solver selections. Numerical failures return zeroed outputs with cleared validity flags; malformed inputs raise
BasiliskError.Nine focused commits separate the Gooding fix, transfer-direction support, convergence safeguards, Izzo starter correction, alignment recovery, input validation, solver-method validation, independent zero-revolution tests, and cross-platform CI fixes.
The final commit makes NaN validation safe when floating-point exceptions are enabled and fixes repeated Corrosion configuration by applying the patch to pristine source without rewriting unchanged output.
Reviewers should note these interface changes:
transferDirectiondefaults toPROGRADEin zero-initialized messages. C/C++ producers must initialize the new field.solverMethodis now an integer validated before enum conversion. C++ callers reading it intoSolverMethodmust validate and explicitly cast it.Verification
Added regression coverage for both algorithms, solution branches, minimum-time boundaries, parabolic transfers, transfer directions, invalid inputs, recovery, and validator integration. Zero-revolution tests compare against independent orbit-derived velocities, with mutation tests confirming that incorrect outputs are detected.
Additional regressions cover NaN values in every position-vector component, floating-point exception flags, repeated Corrosion configuration, timestamp collisions, and detection of changed upstream patch targets.
Local validation passed:
All eight CI checks passed for commit
18965b5c83, including Linux, Windows, macOS minimum and maximum Python configurations, latest dependencies, documentation, formatting, and pre-commit checks. The configured Python suites, native tests, and build-integration checks passed; skips in the macOS configuration with optional features disabled were expected.Linux also passed incremental-build checks, Rust workspace and minimum-supported-toolchain tests, and Clippy with warnings treated as errors. The Linux and Windows runs confirmed both CI fixes.
Full build logs were reviewed. No new C/C++ compiler or linker warnings were found.
Documentation
Updated solver and planner documentation, message-field comments, release-note snippets, and known issues. These describe direction conventions, compatibility requirements, convergence and failure semantics, input validation, and alignment recovery.
Release-note snippets also describe the NaN-validation and Corrosion-reconfiguration fixes.
The documentation build completed successfully without Sphinx or Doxygen warnings.
Future work
Address the pre-existing macOS Rust debug-stripping warnings in a separate PR. These arise when
rust-objcopycannot loadlibLLVM.dylib; compilation, linking, and tests still succeed. They do not block the Lambert changes.