#3217
Clamp bootstrap confidence interval indices
Summary
- Handle NaN adjusted quantiles when bootstrap jackknife variance is zero.
- Clamp calculated confidence-interval indices before indexing the resample.
Root cause
Zero jackknife variance makes the BCa acceleration calculation undefined. Its NaN quantiles were converted to invalid indices, causing an out-of-bounds read.
Testing
- Regression failed before the fix (upper bound was 0.0 instead of 1.0) and passes after with UBSan and Guard Malloc.
- Full UBSan CTest suite passes: 82/82.
- C++14 warning-enabled build passes with -Wall -Wextra -Wshadow -Werror.
- The ASan run stalled and was stopped; it is not counted as a pass.
- Catch2-configured clang-tidy reported no diagnostics on changed lines; a full-file run reported warnings on existing, unchanged code.
Not included
Validation for explicitly configuring zero bootstrap resamples is a separate edge case.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 91.21%. Comparing base (
0809213) to head (2c8a558).Additional details and impacted files
:rocket: New features to boost your workflow: