Skip to content

fix: harden sampler input validation#12

Merged
kholdrex merged 1 commit into
masterfrom
fix/sampler-input-validation
Jun 2, 2026
Merged

fix: harden sampler input validation#12
kholdrex merged 1 commit into
masterfrom
fix/sampler-input-validation

Conversation

@kholdrex

@kholdrex kholdrex commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

Harden sampler input validation so invalid numerical parameters are rejected before sampling starts. Metropolis-Hastings, Hamiltonian Monte Carlo, and Gibbs samplers now fail fast for zero-dimensional initial states and non-finite initial values, and MH/HMC parameter setters reject non-finite positive-only inputs.

Changes

  • Add shared validation for non-empty, finite sampler initial states.
  • Require MH proposal standard deviations, HMC step sizes, and HMC mass matrix entries to be positive and finite.
  • Add regression coverage for NaN, infinity, non-positive parameters, zero-dimensional states, and non-finite initial states.

Test Plan

  • Rust formatting check passed.
  • Clippy passed with warnings denied across all targets and features.
  • Full all-features test suite passed.
  • Rust documentation built with warnings denied.
  • Benchmark targets compiled successfully.

@kholdrex kholdrex merged commit 1b9a7a1 into master Jun 2, 2026
7 checks passed
@kholdrex kholdrex deleted the fix/sampler-input-validation branch June 2, 2026 23:43
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