You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flight.__handle_impact_event() assumes that cubic interpolation always returns exactly one valid root in the current solver step. It already reports multiple valid roots explicitly, but it indexes an empty list when no valid root is found.
The resulting exception does not identify the failed numerical operation:
IndexError: list index out of range
To reproduce
At cb6106a717207dd8fc2dfe1446d80ff75022f21b, make find_roots_cubic_function() return roots outside the open solver interval, such as [-1 + 0j, 2 + 0j] for a one-second step, and call the impact event handler. valid_t_root is empty and valid_t_root[0] raises IndexError.
Expected behavior
The impact handler should report the failed root selection directly, consistent with the existing rail-exit handling:
ValueError: No valid roots found when solving for impact time.
The single-root path should remain unchanged, and multiple valid roots should continue to raise the existing ValueError.
Proposed fix
Check for an empty valid_t_root list before indexing it. Add focused tests for zero, one, and multiple valid roots.
Environment
Base SHA: cb6106a717207dd8fc2dfe1446d80ff75022f21b
Activity
BUG: report missing impact roots explicitly (#1147) (#1148)
Gui-FernandesBR commentedon Aug 14, 2026
solved by #1148
Gui-FernandesBR commentedon Nov 2, 2026
Reopened: the fix is merged on
developand will close when v1.14.0 is released tomaster.