bench: Fix panic in power benchmark - #26028
Merged
Merged
Conversation
apache#22651 removed the `power(decimal, int)` code path: `power` now coerces both arguments to Float64, and `invoke_with_args` returns an internal error for any other input types. The benchmark still passed Decimal128 x Int64 arguments, so it panicked on its first case. Because `power` comes before `random`, `round`, `round_dense`, `signum`, `trunc` and `trunc_precision` in `criterion_main!`, an unfiltered run of the `math_expressions` bench never reached those groups either. Benchmark Float64 inputs instead, with 10% nulls: one case with a different exponent for each row and two with a constant exponent (2.0 and 0.5). The base and exponent arrays come from the same RNG, so they differ.
Contributor
Author
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26028 +/- ##
========================================
Coverage 82.65% 82.66%
========================================
Files 1147 1147
Lines 446087 446357 +270
Branches 446087 446357 +270
========================================
+ Hits 368710 368971 +261
- Misses 54990 54997 +7
- Partials 22387 22389 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
theirix
approved these changes
Oct 4, 2026
theirix
left a comment
Contributor
There was a problem hiding this comment.
Makes sense.
I am wondering if we should run a weekly GitHub CI action to run all benchmarks so their panics are discoverable
Jefffrey
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
#22651 removed the
power(decimal, int)code path, but left the benchmarks still passedDecimal128xInt64arguments, resulting in a panic if the benchmarks were actually run.Rewrite the benchmark to use Float64 inputs instead, with 10% nulls.
What changes are included in this PR?
See above.
What is the testing strategy for this PR?
Benchmark code only.
Are there any user-facing changes?
No.