#3217

Clamp bootstrap confidence interval indices

Openharshkumawat5wants to merge intofrom

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.

Activity

2
codecov[bot]20d ago

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
@@            Coverage Diff             @@
##            devel    #3217      +/-   ##
==========================================
+ Coverage   91.18%   91.21%   +0.04%     
==========================================
  Files         205      205              
  Lines        9101     9104       +3     
==========================================
+ Hits         8298     8304       +6     
+ Misses        803      800       -3     
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.