Repository navigation
perf(group): fuse decimal aggregate argument roots - #31987
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Fixed the Ubuntu race-test failure at Focused |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 8b02d0ba9c2e2895855267b8efb0f515b2ce85c6
Assessment: approve
The aggregate-only fusion preserves arithmetic, metadata, fallback, and ownership contracts. The Decimal256 test issue is resolved; no actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2
Validation:
-
Frozen-head CI records successful Ubuntu UT, arm64 SCA, shared build, and proxy/pessimistic multi-CN BVT.
-
Reviewed the complete delta, consumers, regression oracles, and all discussion entries; saved review-plan.md and discussion-assessment.json.
-
Reused author-reported package/SQL validation after confirming relevant production inputs are unchanged.
-
Local audit passed: independently recomputed 1,648 benchmark samples and verified source/discussion coverage. Receipt: checks/1793564891256898620-3.json; log: validation-audit-v2.log.
Limitations:
-
No fresh local Go/SQL execution; original test logs and benchmark resource traces were unavailable locally.
-
Performance evidence covers local SF10. Control estimates remain inconclusive; broader SF100/mixed-I/O acceptance remains open.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to #30860
Performance evidence: #30860 (comment)
Approved design: https://github.com/aunjgr/matrixone/blob/6e8c6dfb2ccc5f2799fe97076322083b218c26e2/docs/design/aggregate-decimal-fusion.md
What this PR does / why we need it:
Specialize complete aggregate arguments of the form x*(literal-y), including commuted multiplication, when Decimal64 leaves widen losslessly to Decimal128 and the bound product needs no scale adjustment. Evaluate the admitted arithmetic in one pass without cast/subtraction intermediates, preserving the bound decimal precision and scale.
Admit only aggregate argument roots after normal executor construction. Keep generic constructors, column evaluation, row alignment and writable-result ownership unchanged. Delegate ineligible inputs, unexpected masks and ownership-transferring evaluation to the generic tree; preserve existing reset/free and allocation-account ownership.
Validation
Owning colexec, group and function packages pass; scoped vet/lint report zero issues.
The 18-statement SQL case passes twice with normal expected-result comparison and verified teardown, including prepared aggregate reuse and DECIMAL(37,4) metadata. Kernel coefficients have an independent big.Int boundary oracle; allocation failure/reuse, NULL/constant/borrowed validity and generic fallbacks are covered.
Independent local SF10 Q1-Q22 comparison: four balanced process pairs, five measured warm calls/query/arm, first/cold calls excluded. Matching normal release binaries use eight physical CPUs, effective 16 GiB CN cache and a 32 GiB whole-application cap. Every arm passes the memory/CPU gates with zero physical I/O, spill, swap and OOM.
Q1 medians: main 934.30 ms, candidate 913.75 ms. Median paired change is -2.62% (small-sample paired interval -3.63% to -1.84%). Q14/Q15 remain inconclusive.
Full-screen slower signals in Q2/Q7/Q11 were not independently confirmed in four new balanced pairs with 16 warm calls/query. Q11 (+1.52%), Q18 (+2.14%) and Q21 (+0.82%) have positive but inconclusive estimates; these results do not prove equivalence. All raw warm calls and intervals are in the linked issue evidence. Broader SF100/mixed-I/O acceptance stays open.
Actual nil-mask component modes improve. A synthetic zero-row non-nil-mask wrapper call has +2.88% dispatch overhead; the only producer installs the wrapper at Group aggregate roots, whose caller always supplies nil. Generic masked constructors/parents remain unchanged and never receive this wrapper. This synthetic result is disclosed rather than labeled a passing masked performance test.
Fresh authoritative-main merge and full
mo-pr-guard --pre-pushgate pass, including package graph, molint, license headers and repository-wide lint (zero reported issues).CI race-mode correction: the Group SUM consumer test now explicitly reads the existing Decimal256 aggregate result and checks its scale, while retaining the Decimal128 fused-argument assertion. Focused
-racevalidation and the fresh-main/full pre-push gate pass. Production code and benchmark evidence are unchanged by this test correction.