Repository navigation
Reduce cloning during legacy float catalog proof - #31592
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? |
f7e8b52 to
bd5e946
Compare
bd5e946 to
0468ff5
Compare
|
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: 0468ff501c8913d53c5de91e3a8f46e3584850fa
Assessment: approve
Reviewed the complete delta, discussion and affected consumers. Comparison semantics, scratch ownership/reset, budget accounting and catalog isolation are preserved. No actionable findings.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Reused frozen current-head successes for UT, SCA, shared build and proxy/multi-CN BVT.
-
Assessed author-reported focused, race and performance checks against the changed paths.
-
Local static audit passed: 18 files and 21 hunks match frozen sources; source remains clean; discussion coverage is complete. Receipt: checks/1793207221008285200-3.json; retained logs: static-audit.stdout.log and static-audit.stderr.log.
Limitations:
-
No local product tests were rerun; historical race, BVT and benchmark raw logs were not supplied.
-
Reported cold-call timings establish no universal latency bound; scratch storage measurements are not RSS limits.
🚫 Left the queue5 min in the queue, with no time running CI. So far
Reason Pull request #31592 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
Hint You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Merge conditions: 2 of 3 metThis pull request
The batch, tested in place
Tick the box to put this pull request back in the merge queue (same as
Times in UTC · dashboard · how the merge queue works |
…dcd22ec7ac03f2ad6921c5c1b26e2729f678fd5
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
This is a performance follow-up to the merged #30316. That change already covers the original 16 functional groups for MySQL-compatible floating-point text and historical catalog defaults. The returned issue identified a static risk from repeating historical DEFAULT proofs during table resolution; it did not reproduce a remaining formatter failure. This PR measures that cost through the actual frontend
ResolveByIdand compileResolvepaths and reduces repeated expression copying while preserving those functional contracts.The proof compares bound expressions through read-only projections instead of cloning complete trees for each comparison. Each applicable probe owns a private working tree initialized with the existing DeepCopy semantics, consumes its result, then resets the tree for the next candidate. Unsupported shapes retain the original copy path. Source catalog trees and returned caller trees stay isolated; scratch references are cleared before full binding and at termination. There is no cross-call result cache.
The complete proof, candidate order, precision/session/time-zone search, budget accounting and limits, memo admission, and frozen DEFAULT values are retained. Bind, fold, and time-zone search still have a cost; this change reduces copying rather than removing all repeated proof work.
Validation
At the original task revisions, the owning
pkg/sql/plansuite passed normally and with the race detector. Focused frontend/compile resolver tests, comparison differential tests, adaptive reader race repetitions, and QA cases for cancellation, interrupted reuse, memo rejection, and full-bind rejection/rebuild passed.Six old/new complete migration observations were equal: generous, exact, and one-short cumulative budgets across two DEFAULTs, including the full resulting trees, errors, charges, memo observations, and session trace.
The owning
pkg/common/utilandpkg/container/bytejsonsuites passed, retaining formatter, JSON, tokenizer, and non-finite-number coverage.Public SQL BVT: the target fixture passed twice at 55/55; 17 related function, DDL, and DUMP/LOAD files passed 1,916/1,916, with zero ignored or failed cases. New scalar/aggregate and JSON checks use independent expected bytes. Existing MySQL 8.0.45 observations and official serializer/converter evidence were reused where inputs were unchanged; no new MySQL SQL run is claimed.
At
7f7892be3ae5b7f635fe79e82c931cd5dcd42075,TestLegacyFloatScratchStorageBoundpassed normal and race runs once each, then 100 race repetitions for both subtests. Four live owners, 32 candidates each, retained a stable conservative reachable-storage count of 6,836 bytes and cleared their terminal state. This measures scratch storage, not whole-resolver peak RSS.Earlier owning/race, QA, BVT, MySQL, budget, and performance evidence is reused at its original revisions and scope for unchanged semantic inputs. The storage-test synchronization correction is retained unchanged; its normal/race/100-repetition evidence remains valid. The entire package race suite, service-binary BVT, and performance matrix were not rerun on the current HEAD.
Before this CI refresh, HEAD
f7e8b521a99be22b67ec12093a61a140fe586845included a merge frommain; the original 18 task files and complete task patch are unchanged. On this HEAD, the owning plan suite passed normally, both real resolver focused suites passed normally, and the ALTER session suite passed with the race detector. All 37 ALTER cases retain independent DEFAULT results, source/session isolation, and idempotence; 10 representative cases run the complete DUMP/raw-budget proof after upstream test deduplication. Final overall review by gpt-6-astra at medium reasoning passed on that SHA.At earlier validation head
bd5e946d73f725b435efca0924006798be588aa0, the CI refresh rebased the seven task commits onto official main325c93530e852faee03c2ab61168ba059cedf4b4. All seven replayed patches and the complete task patch are equivalent to the previous head. Upstream decimal-precision compatibility modes remain intact. Newly executed throughmo-cgo-test: the fullpkg/sql/plansuite (-p 2 -count=1 -timeout=240s) passed, including decimal/float composition, persisted DUMP bindings, candidate budgets and scratch lifecycle;TestLegacyFloatResolverRepeatedCatalog(-p 2 -count=1 -timeout=120s) passed in both frontend and compile with all four fixtures. Formatting, diff and delivery-artifact checks passed. Historical race, BVT and benchmark results retain their original revision and scope; those matrices were not rerun solely for this rebase.Current HEAD
0468ff501c8913d53c5de91e3a8f46e3584850farebases onto official main1d5c9ef4515f4d641fba84411e371cb2b41e9495and makes the cumulative-budget test independent of the host's Local/named time-zone inventory. The existing per-proof iterator provides a rejected UTC candidate and the real creation-zone witness; complete-tree, exact/one-short budget, successful-prefix, source/session isolation and real memo/hint checks remain. The original assertion failure reproduced locally withTZ=UTCbefore the fix. Newmo-cgo-testvalidation passed: focused UTC normal test; completepkg/sql/plansuite underTZ=UTC -short -tags matrixone_test -covermode=set -count=1 -timeout=240s; focused budget test underTZ=Asia/Shanghai -short -tags matrixone_test -race -count=1 -timeout=120s.go vet, incremental configured lint, formatting and diff checks passed. No production algorithm, candidate order or budget limit changed.Performance and limits
The measurements below are the original task-revision evidence, not new measurements on the current HEAD. Measurements used Go 1.27.1 on darwin/arm64 (Apple M4), identical catalog fixtures/native inputs, and the real resolvers reading the original catalog repeatedly. Serial measurements used five samples per side at 300 ms or longer; the registered frontend precision-8 confirmation used five interleaved pairs at 1 s.
The frontend precision-8 initial block improved latency by 9.58%; its single registered longer confirmation reached 13.52%, with limited margin. Four-worker throughput improved for both shared and distinct catalog sources across all eight combinations. Ordinary warm paths retained the same allocation counts.
Ordinary fresh-context single-shot timings were noisy, including apparent slowdowns above 10%. Bounded follow-up did not establish a stable product regression, but does not prove a cold-latency bound of 10%. The unchanged ordinary early-return path does not enter the optimized proof owners. The final review accepted this measurement limitation. Scratch storage remains local and linear in active expression trees; existing memo limits do not constitute a whole-process memory bound.
CI run 40698346996 failed the cumulative-budget test in both regular UT and coverage; Coverage and CI Required then failed transitively. The host-dependent fixture is corrected above. This push triggers fresh CI, which has not been awaited; local validation is not a claim that PR CI passed. Please return the issue to its reporter for verification after merge.