Repository navigation
fix(plan): preserve decimal pruning for integer-backed DOUBLE parameters - #30817
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? |
LeftHandCold
left a comment
There was a problem hiding this comment.
Code-review verdict: no blocking findings; approval recommendation for d96a07b against main/merge-base 6495ce9. The authenticated account is the PR author, so this is a COMMENT review, not a formal self-approval.
Reviewed all 12 changed files and the related #29661 discussion, including the rejected prototype's repeated-wide-binding performance regression. There are currently no inline review threads to reconcile.
Design/correctness:
- This is a focused fix at the existing prepared-consumer binding and single-slot cache owners, not another execution/cache subsystem. Native DECIMAL admission requires the existing executor-aligned uniqueness proof; successful conversion alone does not authorize narrowing. The executable DOUBLE conversion and ParamRef remain present.
- Checked the integer transport decoding against numericToNumeric, injective integer-cast-chain restrictions, both comparison orientations, ordering predicates, signed/unsigned boundaries, NULL/type changes, and DECIMAL64/128 floating collisions. Fixed-scale DOUBLE, non-injective/intervening expressions, DML and DECIMAL256 do not enter the new admission.
- Both native and fallback plans retain their expected proof class. Every relevant proof must match the current typed binding before cache reuse; same-class different values do not force replanning. Existing field-type and diagnostic guards remain in place.
Lifecycle/performance closure:
| Check | Result |
|---|---|
| Q1 ownership | Proof metadata is published with the plan only after successful compilation; failure discards the candidate without replacing the previous plan/proof. Existing retirement, invalidation, AP logical-only caching and Close ownership remain intact. |
| Q2 waits | The new admission/reuse check is synchronous bounded computation; it introduces no lock, I/O, goroutine or retry/wait edge. |
| Q3 growth | Metadata is bounded by comparisons in the current plan, contains no parameter-vector references, and replaces the same cache slot rather than accumulating generations. |
Evidence checked and reused, not rerun as duplicate heavy work:
- Read the original Shanghai50 logs under /tmp/mo-29661-int-double-20261022.og3hXsF4/evidence and matched SHA256 for all 12 delivered files. Planner/frontend normal tests with vet pass; frontend owning-package race passes; focused cache/proof tests have terminal passing results.
- Unfixed baseline fails exactly the four new BVT access-path assertions (295/299); candidate passes 299/299 twice, with independently checked zero leftover fixture databases. The unchanged pinned MOTR pruning contract fails on baseline and passes on candidate.
- Inspected the independent 21-row boundary harness with frozen expected IDs: 100 result checks pass, including floating-collision rows, high scales, integer extrema and rebindings. Existing broader protocol/access-path checks report no capability failures.
- The same-class plan/compile identity assertions directly cover the previous replanning regression. Shared-host timings do not show its former ~2x slowdown; SQL repeated-wide median is 289 -> 298 us, so this is not a zero-overhead or universal no-regression claim.
- These execution results belong to the pre-merge ada0bde-based candidate, not a newly executed full suite at the merge head. Inspected the intervening main changes (mixed text/binary set operations, functional JSON indexes, index-join view authorization, result/export handling); they do not change the reviewed decimal-admission/proof/cache closure. Final-head full CI remains separate. Local diff --check passes and the review worktree is clean.
The observed Connector/J Pool Reset E2E failure is Maven bootstrap download failure (wget: Failed to fetch .../apache-maven-3.9.9-bin.zip, make jstfu), before the E2E tests execute: https://github.com/matrixorigin/matrixone/actions/runs/39745963939/job/119714361432. It is not evidence of a regression in this patch. Other checks were still running when inspected; this review does not claim all CI green. Keep #29661 open until the planned merged-nightly confirmation.
|
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: d96a07b6800957d978b348aa53c79062dfc2dd27
Assessment: approve
Reviewed the complete 12-file delta and affected callers. No actionable defects found. The design coherently extends the existing binder and single-slot cache: uniqueness proofs preserve DOUBLE semantics, permit same-class reuse, and remain paired with their plans through compilation failure, invalidation and cleanup.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Isolation preflight passed. Native prerequisites were built through the repository owner; 194 source inputs and seven native artifact hashes were reconciled.
-
Focused planner and frontend tests passed with -vet=all and -count=1 through test-exec, covering admission, fallback, cache transitions, failed publication, NULL/type changes, AP reuse and Close.
-
An independent diagnostic overlay passed 272 parsed-SQL-to-expression-execution cases covering all comparison operators, both orientations, high scales, floating collisions and integer extrema.
-
The frozen CI snapshot reports successful unit tests, static analysis, build, both BVT groups and Connector/J E2E.
-
Command/source/exit receipts matched retained logs; source remained clean and diff --check passed. Evidence and review details are retained under /home/xupeng/.local/state/mo-bot/jobs/c753b66daf9d4f5077c52fcf/attempt-1/ in validation-manifest.json and review-report.txt.
Limitations:
-
Full suites, distributed BVT and race checks were not rerun locally; raw CI logs and the author's remote validation artifacts were unavailable.
-
No local latency benchmark was performed. Proof checking adds per-comparison admission work, with no new per-row work, I/O or goroutines; author timing claims were not independently reproduced.
-
Issue #29661 remains open for the explicitly planned merged-nightly confirmation; this assessment covers the assigned residual path.
Merge Queue Status
This pull request spent 1 hour 54 minutes 57 seconds in the queue, with no time running CI. ReasonPull request #30817 has been merged manually at ecdeffc HintYou were too fast! Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Addresses the remaining explicit DOUBLE / integer-source path of #29661. Keep the issue open pending merged-nightly confirmation.
What this PR does / why we need it:
Summary
Addresses the remaining integer-backed explicit DOUBLE comparison in #29661. Earlier fixes cover direct integer/TEXT DECIMAL comparisons, but
d = CAST(? AS DOUBLE)with an integer source still scans every persisted block and loses native secondary-index access.On frozen main
ada0bde326adec3c3906d2f417c266d0ada5b054, both binary Prepared and SQL EXECUTE return the correct row for16001, but read 4 blocks / 32,768 rows rather than the literal control's 1 block / 8,192 rows. The unchanged Daily MOTR pruning contract fails on precisely this residual.Design
2^53can compare equal in DOUBLE.Regression coverage
Existing planner tests now check selective typed plans and negative controls. Focused frontend tests require plan/compile identity from an independent expected-class oracle, including both initial binding orders, same-class different values, failed compilation, NULL/type changes, AP logical-only reuse and Close.
The existing
issue_29514_decimal_expression_filterBVT reuses its table and secondary index for safe/wide/safe execution. Four new physical-work assertions accompany independent count/min results; existing floating-collision and diagnostic checks remain.Local validation on server 50
df62a1b639c2c2af319438a09a3d4486beede371, pruning mode: PASS.-vet=all:pkg/sql/plan(27.361 s) andpkg/frontend(15.661 s) PASS.-race, PASS. Frontend owning package under-race: PASS (36.186 s).Quiet baseline/candidate timing used the same 12 shapes/protocols, 5 alternating batches of 200 result-checked operations each (12,000 operations per version), without concurrent task compilation:
This is a bounded shared-host comparison, not a general performance guarantee. The wide/control normalized ratios are 0.915 and 1.081; SQL wide fallback is about 9 microseconds slower in this sample. There is no recurrence of the rejected prototype's roughly 2x repeated-wide replanning cost; cache-identity assertions independently prove reuse. Native pruning and indexed access are the primary deterministic improvement oracles.
No claim of full remote CI or multi-CN nightly acceptance is made by these local checks. All test-owned containers exited normally, and fixture database counts are zero after cleanup. Base is frozen at
ada0bde3; the subsequently fetched Main6495ce99changes unrelated closures and does not contain this residual fix.Risk and scope
The principal risks are unsound float narrowing and stale prepared-plan reuse. Actual collision results, source-type transitions, failed-publication checks and repeated-wide latency controls cover these directly. The proof retains only bounded per-expression metadata, no parameter vectors or previous cache generations. The change does not modify unrelated execution domains. Keep #29661 open for final merged-nightly confirmation rather than interpreting every prepared wrapper as covered.