Repository navigation
Add test: randBinomial probability-domain guard p < 0.0 || p > 1.0 is untested - #112006
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [68c7669] Summary: ✅ AI ReviewSummaryThis PR adds a focused stateless test for Final VerdictStatus: ✅ Approve |
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #111909.
That PR The PR hardens
randChiSquared,randStudentT,randFisherFandrandBinomialagainst unkillable hangs with extreme parameters. It adds unconditional hard bounds (max_degrees_of_freedom = FLT_MAX/12andmax_number_of_trials = 10^9) that apply even when the tunable settings `max_rand_distribu1.
randBinomialprobability-domain guardp < 0.0 || p > 1.0is untestedsrc/Functions/randDistribution.cpp:244Risk:
BinomialDistribution::generateatrandDistribution.cpp:243 checksif (p < 0.0 || p > 1.0)and throws at line 244 (LLVM-confirmed uncovered). This guard prevents an invalid probability from reachingstd::binomial_distribution<UInt64>(t, p), whose behavior for p outside [0, 1] is undefined. Risk if broken: an invalidpreaches the standard-library sampler, producing undefined behavior in the same class of unbounded/garbage sampling this PR set out to eliminate.What's unique vs PR tests: The PR's 04628 test only exercises the trials-too-large guard (line 245-246) and in-domain values for
randBinomial; it never passes a probability outside [0, 1], so the line-243/244 probability guard is left uncovered.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes
Version info
26.8.1.339(included in26.8and later)