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
Follow-up from #144 / PR #146 (surfaced in the multi-agent review of #146).
#144 added std::isfinite guards to RootFinder::newton / ternarySearch that throw RootFinder::ConvergenceError on a non-finite evaluation. This is a strict improvement (fast-fail instead of spinning to maxIterations), but the new error lands in the same type as ordinary non-convergence.
Three sites catch ConvergenceError without inspecting .what():
src/domains/BoundaryComponent.cpp:76
src/domains/InvertedEllipseComponent.cpp:96
src/domains/SplineBoundaryComponent.cpp:146
So a NaN-producing objective now fast-fails but is swallowed into the same fallback as "didn't converge" — including the documented AnalyticBoundaryComponent::findParameterization atan2 fallback, which silently returns wrong values for non-circular boundaries.
Proposal
Introduce RootFinder::NonFiniteEvaluationError : public ConvergenceError and throw it from the isfinite guards (keeps existing catch (const ConvergenceError&) sites working — they still catch it).
Update the three catch sites to distinguish "geometry produced NaN/inf" from "failed to converge," surfacing the former instead of routing it through the (wrong) atan2 fallback.
Related
The atan2 silent-wrong-value behavior in findParameterization is a separate correctness bug already earmarked as out-of-scope in Guard genuine division/NaN hazards surfaced by the #40 epsilon audit #144 (needs a real fix + tests). This issue is about the error-type plumbing that would let catch sites tell the two failure modes apart; fixing the atan2 fallback itself is its own issue.
Follow-up from #144 / PR #146 (surfaced in the multi-agent review of #146).
#144 added
std::isfiniteguards toRootFinder::newton/ternarySearchthat throwRootFinder::ConvergenceErroron a non-finite evaluation. This is a strict improvement (fast-fail instead of spinning tomaxIterations), but the new error lands in the same type as ordinary non-convergence.Three sites catch
ConvergenceErrorwithout inspecting.what():src/domains/BoundaryComponent.cpp:76src/domains/InvertedEllipseComponent.cpp:96src/domains/SplineBoundaryComponent.cpp:146So a NaN-producing objective now fast-fails but is swallowed into the same fallback as "didn't converge" — including the documented
AnalyticBoundaryComponent::findParameterizationatan2 fallback, which silently returns wrong values for non-circular boundaries.Proposal
RootFinder::NonFiniteEvaluationError : public ConvergenceErrorand throw it from theisfiniteguards (keeps existingcatch (const ConvergenceError&)sites working — they still catch it).Related
findParameterizationis a separate correctness bug already earmarked as out-of-scope in Guard genuine division/NaN hazards surfaced by the #40 epsilon audit #144 (needs a real fix + tests). This issue is about the error-type plumbing that would let catch sites tell the two failure modes apart; fixing the atan2 fallback itself is its own issue.Depends on #144 (merged via PR #146).