Skip to content

fix: validate gradient check points#13

Merged
kholdrex merged 1 commit into
masterfrom
fix/validate-gradient-check-inputs
Jun 4, 2026
Merged

fix: validate gradient check points#13
kholdrex merged 1 commit into
masterfrom
fix/validate-gradient-check-inputs

Conversation

@kholdrex

@kholdrex kholdrex commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Harden the gradient-check helper path so invalid base points are rejected before user-provided density or gradient closures run. This keeps finite-difference diagnostics consistent with the sampler constructors' finite, non-empty vector expectations.

Changes

  • Add point validation for empty and non-finite vectors in finite_difference_gradient and gradient_check.
  • Document the new error behavior in the gradient helper rustdoc.
  • Extend regression coverage for empty, NaN, and infinite gradient-check points.

Test Plan

  • Rust formatting check passed.
  • Clippy passed across all targets and features with warnings denied.
  • Full test suite passed across all features.
  • Rustdoc generation passed with warnings denied.
  • Benchmark compilation passed across all features.

@kholdrex kholdrex merged commit acc40ff into master Jun 4, 2026
7 checks passed
@kholdrex kholdrex deleted the fix/validate-gradient-check-inputs branch June 4, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant