Skip to content

Ignore empty constant chunks in aggregate states - #10254

Merged
joseph-isaacs merged 1 commit into
developfrom
ct/stats-empty-constant-aggregates
Oct 5, 2026
Merged

joseph-isaacs merged 1 commit into
developfrom
ct/stats-empty-constant-aggregates

Conversation

@connortsui20

Copy link
Copy Markdown
Member

Tracking Issue: #10177

Summary

A zero-length constant array still carries a scalar, but that scalar contributes no values to an aggregate. The Constant arms for MinMax, constantness, and sortedness currently observe it anyway, creating extrema or stream boundaries that can change results for later chunks.

Changes

Skip those Constant arms when the input is empty, preserving the empty partial as the merge identity. An empty input has null extrema, is not constant, and is sorted. Empty chunks also leave the first and last values of a nonempty stream unchanged.

This fixes existing accumulator behavior and can be reviewed independently of the statistics migration stack.

@codspeed

codspeed Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 9 benchmarks

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 15 improved benchmarks
❌ 9 regressed benchmarks
✅ 2081 untouched benchmarks
⏩ 503 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation filter_powerlaw_by_random[250000] 131.8 µs 169.4 µs -22.2%
❌ Simulation take_filter_primitive_nullable_slice_mask_random_indices[4096, 1000] 96.8 µs 122.9 µs -21.22%
❌ Simulation take_filter_primitive_nullable_slice_mask_random_indices[16384, 1000] 115.4 µs 145 µs -20.43%
❌ Simulation take_filter_list_slice_mask_sequential_indices[768, 50] 128.5 µs 150.5 µs -14.64%
❌ Simulation take_filter_list_slice_mask_sequential_indices[256, 50] 129.9 µs 150.8 µs -13.83%
❌ Simulation filter_powerlaw_by_random[10000] 30.2 µs 34.1 µs -11.54%
❌ Simulation filter_powerlaw_by_mostly_false[10000] 29.3 µs 33.1 µs -11.35%
❌ Simulation filter_random_by_mostly_false[10000] 29.4 µs 33 µs -11.04%
❌ Simulation filter_random_by_random[10000] 30.3 µs 34 µs -10.91%
⚡ Simulation density_sweep_single_slice[0.9999] 85 µs 24.1 µs ×3.5
⚡ Simulation density_sweep_single_slice[0.999] 84.7 µs 24.1 µs ×3.5
⚡ Simulation density_sweep_single_slice[0.95] 82.8 µs 24.1 µs ×3.4
⚡ Simulation density_sweep_single_slice[0.99] 82.6 µs 24.1 µs ×3.4
⚡ Simulation density_sweep_single_slice[0.5] 64.6 µs 24.2 µs ×2.7
⚡ Simulation density_sweep_single_slice[0.9] 49.4 µs 24.2 µs ×2
⚡ Simulation density_sweep_single_slice[0.1] 48.5 µs 24.2 µs ×2
⚡ Simulation density_sweep_single_slice[0.05] 46.7 µs 24.2 µs +93.04%
⚡ Simulation density_sweep_single_slice[0.01] 41.5 µs 24.2 µs +71.63%
⚡ Simulation density_sweep_random[0.02] 89.3 µs 64.6 µs +38.22%
⚡ Simulation patterns_i128[Contiguous] 30 µs 21.9 µs +37.02%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ct/stats-empty-constant-aggregates (e5061a4) with develop (8ff4b4a)2

Open in CodSpeed

Footnotes

  1. 503 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on develop (23a59e3) during the generation of this report, so 8ff4b4a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 force-pushed the ct/stats-empty-constant-aggregates branch from bfdbb5a to e5061a4 Compare October 5, 2026 11:11
@connortsui20
connortsui20 marked this pull request as ready for review October 5, 2026 11:13
@joseph-isaacs
joseph-isaacs merged commit aa02d94 into develop Oct 5, 2026
130 of 133 checks passed
@joseph-isaacs
joseph-isaacs deleted the ct/stats-empty-constant-aggregates branch October 5, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants