Skip to content

fix(group): keep exact totals for parted keyless affine I64 AVG - #1476

Merged
singaraiona merged 3 commits into
devfrom
morrow/t788-keyless-affine-avg
Nov 23, 2026
Merged

singaraiona merged 3 commits into
devfrom
morrow/t788-keyless-affine-avg

Conversation

@MorrowTeneral

@MorrowTeneral MorrowTeneral commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1440. For a single unfiltered keyless AVG over a parted I64 column plus or minus an I64 constant, reduce each partition's evaluated expression to an exact total and non-null count. Merge those across batches and divide once, rather than merging wrapped I64 SUM results. Preserve the output name and type. Grouped and other unfixed AVG cases remain open under #1440.

  • On 98fdf2c0 plus this patch, focused Clang ASan/UBSan grouping passed 93/93 with no skips, including the new route-checked plus/minus regression and its equivalence run. The regression crosses the eight-partition batch boundary. No full suite run locally.
  • On 8c18b24a plus the identical patch, checks at 1 and 8 cores verified exact flat parity, typed F64 null, aliases and the unaliased graph result name. F64, filtered, direct-column and multi-aggregate controls kept their baseline results and routes.
  • Matched release timings on 8c18b24a, five alternating trials on one nine-partition fixture (~400k rows per partition): common 49.60→13.09 ms (1 core), 19.44→7.27 ms (8); wide 51.27→13.44 ms (1), 19.03→7.03 ms (8). Both builds served the partitioned path. The wide baseline was incorrect; the candidate matched flat.

Coverage after round 1 (from review). These are exact against an exact oracle on parted tables:

  • keyless single avg of a parted I64 column: plain avg x;
  • x ± c and c ± x;
  • I16/I32 constants.

They are 5–14× faster than dev. Still open under #1440:

  • grouped by: AVG;
  • keyless AVG beside a second aggregate (e.g. avg x with count x), since the route needs n_aggs == 1.

@singaraiona singaraiona left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified at a9a0088.

  • Exact: keyless single avg over a parted I64 column (plain, x ± c, c ± x, narrow constants) is exact against the oracle across 450 cases, where dev gets 49–50 of each 50 wrong.
  • No regressions: every other route is byte-identical to dev.
  • Speed: 5–14× faster.
  • Tests: the pins fail on dev.

I added the coverage note to the body. Grouped and multi-aggregate AVG stay open in #1440. Approved.

@singaraiona
singaraiona merged commit b3b041d into dev Nov 23, 2026
11 checks passed
@singaraiona
singaraiona deleted the morrow/t788-keyless-affine-avg branch November 23, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants