Skip to content

bench: Fix panic in power benchmark - #26028

Merged
neilconway merged 1 commit into
apache:mainfrom
neilconway:neilc/bench-fix-power
Oct 5, 2026
Merged

neilconway merged 1 commit into
apache:mainfrom
neilconway:neilc/bench-fix-power

Conversation

@neilconway

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • N/A

Rationale for this change

#22651 removed the power(decimal, int) code path, but left the benchmarks still passed Decimal128 x Int64 arguments, 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.

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.
@github-actions github-actions Bot added the functions Changes to functions implementation label Oct 4, 2026
@neilconway

Copy link
Copy Markdown
Contributor Author

cc @Jefffrey @theirix

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.66%. Comparing base (76f9fde) to head (1dbd39b).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@theirix theirix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

I am wondering if we should run a weekly GitHub CI action to run all benchmarks so their panics are discoverable

@neilconway
neilconway added this pull request to the merge queue Oct 5, 2026
Merged via the queue into apache:main with commit 5c7d33a Oct 5, 2026
42 checks passed
@neilconway
neilconway deleted the neilc/bench-fix-power branch October 5, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation v56.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants