Repository navigation
Use aggregate results in core statistics helpers - #10257
connortsui20 wants to merge 1 commit into
Conversation
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>
Merging this PR will degrade performance by 19.69%
|
| 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)
Footnotes
-
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. ↩
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-onlystat(...)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.