Defensive validation, numerical robustness, golub_welsch Result API (v0.2.0)#13
Merged
gvonness-apolitical merged 2 commits intomainfrom Mar 13, 2026
Merged
Conversation
…sult API (v0.2.0) Address 12 deferred codebase review items across 5 phases: - Reject ±Inf (not just NaN) in tanh-sinh, oscillatory, Cauchy PV, cubature - Replace partial_cmp().unwrap() with unwrap_or(Ordering::Equal) - Promote debug_assert to assert in CubatureRule::new - Split Lobatto n<2 error into ZeroOrder (n=0) vs InvalidInput (n=1) - Clamp global_error to non-negative in adaptive cubature - Add dimension cap (d≤30) for adaptive cubature - Clamp Newton iterates in Lobatto interior node computation - Fix tanh-sinh non-convergence error: use last two estimates instead of fabricated tol*10 - Fix ln_gamma reflection: .sin().ln() → .sin().abs().ln() - Document QUADPACK error simplification in gauss_kronrod - Make golub_welsch return Result, propagate through all compute_* functions - Bump version to 0.2.0, update CHANGELOG, SECURITY, README
967378c to
196c62e
Compare
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
Addresses 12 deferred items from the codebase review, implemented in 5 phases by risk:
±Inf(not justNaN) in tanh-sinh, oscillatory, Cauchy PV, and adaptive cubature. Replacepartial_cmp().unwrap()withunwrap_or(Ordering::Equal). Promotedebug_asserttoassertinCubatureRule::new.n<2error intoZeroOrdervsInvalidInput. Clampglobal_errornon-negative in adaptive cubature. Add dimension cap (d≤30). Clamp Newton iterates in Lobatto interior node computation.|prev - prev_prev|instead of fabricatedtol * 10.ln_gammareflection uses.sin().abs().ln()to handle negativesin(πx). QUADPACK error simplification documented ingauss_kronrod.golub_welsch()returnsResult, propagating QL non-convergence. All internalcompute_*functions propagate via?. Public constructors already returnedResult, so most downstream callers are unaffected.Bumps version to 0.2.0. Updates CHANGELOG, SECURITY (drops 0.1.x support), and README version references.
Test plan
cargo test --all-features— 263 tests pass (212 unit + 51 doc)cargo clippy --all-features -- -D warnings— cleancargo test --no-default-features— no_std mode passes