Skip to content

Use aggregate results in core statistics helpers - #10257

Closed
connortsui20 wants to merge 1 commit into
ct/stats-source-aggregatesfrom
ct/stats-aggregate-helpers
Closed

connortsui20 wants to merge 1 commit into
ct/stats-source-aggregatesfrom
ct/stats-aggregate-helpers

Conversation

@connortsui20

@connortsui20 connortsui20 commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Superseded by #10265, which groups this change with the related statistics work. The original commits and branch are preserved.

Original PR description

Tracking Issue: #10177

Summary

The array cache now stores aggregate results, but core helpers still access it through the fixed-stat facade. Moving those helpers to aggregate keys preserves their existing shortcuts while removing a major dependency on the legacy API.

Changes

Use option-specific keys for extrema, counts, Sum, sortedness, constantness, and size. Shared Min/Max computation publishes compatible results, and MinMax explicitly opts into recovery of its complete partial state. Final sortedness and constantness flags still cannot recover their missing boundary values.

For review, start with MinMax and the cached helper paths, then read StatFn. Metadata-only stat(...) evaluation remains scan-free and returns a typed null when a result cannot supply the requested partial state. Count-derived properties use the input length even when the expression result is broadcast to a different length.

Stack

Migration stack #10229, in review order: #10226 → #10227 → #10232 → #10235 → #10236 → #10252 → #10253 → #10257 → #10258 → #10259 → #10260 → #10261. Independent fixes: file Sum overflow #10228 and empty Constant aggregate states #10254.

Core helpers and stat expressions should share the aggregate cache without requiring a fixed Stat slot. Preserve metadata-only lookup and recover partials through each aggregate's explicit contract, including fused MinMax results.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@codspeed

codspeed Bot commented Oct 3, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 19.69%

⚠️ 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.

❌ 3 regressed benchmarks
✅ 2100 untouched benchmarks
⏩ 503 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ WallTime mul_u64_nonnull_neon 28.8 µs 39.7 µs -27.56%
❌ WallTime multiply_shapes_neon[(32768, PerRowPerRow)] 32.7 µs 38.7 µs -15.46%
❌ WallTime mul_i64_nonnull_neon 32.6 µs 38.6 µs -15.41%

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-aggregate-helpers (e7c69fb) with ct/stats-source-aggregates (4e9cde3)

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. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant