Default the IAS15 integrator to the modern (mode 2) adaptive step controller - #438
Merged
Merged
Conversation
Flip the g_ias15_adaptive_mode default from -1 (leave ASSIST's legacy mode 1) to 2, the Pham, Rein & Spiegel (2024) controller. The knob and its per-sim application (added in #324) are unchanged; this only changes the default, so the fit path, both predict paths, and the IOD picker all use the modern controller by default. The legacy controller drives the timestep toward zero at close-Earth approaches, so a single integration can hang and burn the wall clock -- the entire timeout/hang class in the MPC full-catalog run. Mode 2 steps through those encounters efficiently; correctness is mode-independent (the controller only decides whether/how fast a fit completes, not the resulting orbit). In the full-catalog run the 40 hardest close-NEO cases all completed in <0.5 s. Callers can still override via set_ias15_adaptive_mode(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update the default-value test to assert the new default (2), and add test_fit_is_mode_independent (requires_ephem): a well-behaved object fit under the legacy controller (mode 1) and the modern controller (mode 2) returns the same state, so correctness is controller-independent. Verified against a built layup (the two fits agree bit-for-bit). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Summary
Change the default of the IAS15 adaptive step-size controller from the legacy controller (mode 1) to the newer controller of Pham, Rein & Spiegel (2024) (mode 2). Concretely this flips a single global default in
orbit_fit.cpp(g_ias15_adaptive_mode,-1->2) and updates its comment. The knob itself and its per-simulation application were added in #324 and are unchanged.Motivation
assist_attach()sets IAS15 to the legacy adaptive controller, which drives the integration timestep toward zero during close encounters with the Earth. A single such integration can then fail to return, hanging the orbit fit and consuming the wall-clock budget. This was the entire "timeout / hang" class encountered while re-fitting the full Minor Planet Center (MPC) catalog: close-approaching near-Earth objects (NEOs) that never completed under the legacy controller.The mode-2 controller steps through these encounters efficiently. Crucially, correctness is independent of the controller -- the step controller only decides whether and how quickly an integration completes, never the resulting orbit. In the full-catalog run, the 40 hardest close-NEO cases (perihelion 0.24-1.02 AU) that hung under the legacy controller all completed in under 0.5 s under mode 2, with fitted states identical (to numerical tolerance) across controllers. Hanno Rein suggested this controller in the #324 review as a cleaner alternative to the minimum-timestep floor.
Change
src/lib/orbit_fit/orbit_fit.cpp:g_ias15_adaptive_modedefault-1->2(+ comment).set_ias15_adaptive_mode()/get_ias15_adaptive_mode()still let a caller override (e.g.-1to restore the legacy behavior,1to force it explicitly).apply_ias15_adaptive_mode()afterassist_attach, so all of them pick up the new default.Tests
test_ias15_settings.py: updated the default-value test to assert the new default (2).test_fit_is_mode_independent(guarded byrequires_ephem): a well-behaved object fit under the legacy controller (mode 1) and the modern controller (mode 2) returns the same state -- verified locally that the two fits agree bit-for-bit.Scope / caveats
Related