Repository navigation
Fix vector shuffle ownership and sorted metadata - #32020
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? |
…a38169d58d509fce4a784b85c42b8db4d9453de
|
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: e70a3b3a60127002a2da12762bcd624a853e9dde
Assessment: approve
Ownership, failure-atomicity and metadata behavior are covered. The revised buffered path passes functional validation; the earlier performance finding was not consistently reproduced at this head. No confirmed actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2
Validation:
-
Full vector suite passed: 343 top-level tests, no skips. Receipt: checks/1793639496393945207-2.json; vector-tests-final.log.
-
Four alternating benchmark pairs used identical inputs except the frozen base vector.go overlay. All samples retained zero allocations; results and receipts are recorded in benchmark-analysis.json and validation-evidence.json.
-
Six-file review, formatting, clean source and all five discussion keys verified. Receipt: checks/1793640004170836066-2.json; review-audit.log.
-
Frozen-head CI reports 13 successful, 14 skipped and 2 neutral checks.
Limitations:
-
Large-int64 performance remains inconclusive: median +3.30%, with a paired model interval of -2.14% to +17.88%. This proves neither equivalence nor a repeatable material regression.
-
No fresh local race or dependent-package runs; relevant supplied review and CI evidence was reused.
-
No end-to-end SQL performance measurement; author benchmark raw logs were unavailable.
✅ Merged into
|
…a38169d58d509fce4a784b85c42b8db4d9453de
…stream claimed 97 as narrow_scan in matrixorigin#32034); take upstream narrow-scan prefetch, virtual-timestamp reads, temporal integer casts, vector shuffle ownership, JSON concat and logtail append-range changes GitHub reported the PR CONFLICTING (DIRTY): upstream matrixorigin#32034 added `plan.Node.narrow_scan = 97` while this branch's unmerged additive `ScanReadRole scan_read_role` sat on field 97. Semantic resolution, both sides kept: - upstream keeps `narrow_scan = 97` (shipped on main; `plan.pb.go` regenerated from the merged proto with the repository protoc/gogofast pipeline plus both postprocessors; toolchain verified byte-identical against upstream's committed bindings before use); - this branch's additive `scan_read_role` moves 97 -> 98; nothing ever persisted 97 as scan_read_role (unmerged field), provenance comment updated in proto/plan.proto; - `merged_descriptor_test.go` (upstream's merge-collision contract guard) extended to pin Node.narrow_scan=97 / Node.scan_read_role=98 so a future regeneration cannot silently renumber or drop either; - all other overlapping files auto-merged with both sides' hunks intact (upstream: table_scan/narrow-scan scope+operator plumbing, plan binder temporal/int-arg changes, disttae datasource, query_builder/types/ deepcopy/base_binder/apply_indices). Upstream batch: matrixorigin#31268 (virtual timestamp reads), matrixorigin#32001 (temporal integer casts), matrixorigin#32020 (vector shuffle ownership), matrixorigin#32031 (logtail append ranges), matrixorigin#32038 (python JSON-string concatenation; upstream's own change, no PR-side code), matrixorigin#32034 (narrow-scan prefetch).
## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: - #32016 ## What this PR does / why we need it: Follow-up to merged #32020: preserve its Shuffle ownership, failure-atomicity and sorted-metadata fixes while reducing ordering-proof and identity-copy overhead. The issue's QA found an ascending buffered Shuffle component benchmark regression after the original fix; the original lease leak and sorted correctness failures were no longer reproduced in its covered main paths. This change combines the ordering proof with gathering and avoids the identity copy-back only when the actual data and scratch ranges do not overlap. Validation at the final candidate: vector and function owning suites and targeted mergeutil tests passed; identity alias and byte-overlap boundary tests, gofmt, affected-package vet, incremental lint and `git diff --check` passed. Prior race evidence applies to the unchanged owner protocol. Full CI is pending. In a shared-machine component benchmark, the 8192-row fixed buffered ascending fixture improved 30.52% against a restricted pre-fix function overlay (10 paired samples, 90% CI −31.23% to −29.81%; both 0 allocations). This is not an end-to-end or production SQL measurement. The 64-row descending control showed a +0.72% signal against the preceding candidate (5 pairs, 90% CI +0.05% to +1.40%); its cause and production impact are unestablished, and the review accepted it as a non-blocking limitation, not proof of equivalence. General non-identity overlap between scratch and data remains unsupported as a correct in-place gather: this change can alter the erroneous output of an already incorrect overlapping call. Identity overlap retains the two-copy behavior; callers should use independent scratch for general selections. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
Shuffle now retires borrowed data ownership correctly while preserving retained views and shared varlen area ownership. It prepares data and bitmap replacements before committing, so allocation failures leave the original vector intact. It also preserves the sorted flag only when the selected indices prove the order remains nondecreasing, preventing consumers from relying on an invalid sorted flag.
Owned, equal-length
ShuffleWithBufvectors with uniform metadata now skip row-sidecar preparation and cleanup. The same typed payload/bitmap permutation handles both uniform and mixed metadata, retaining sorted and varlen-area property updates.Validation at
e70a3b3a60127002a2da12762bcd624a853e9dde(Go 1.27.1, Darwin/arm64):.agents/skills/mo-dev/scripts/mo-cgo-test: full vector and mergeutil suites,TestBetweenAfterShuffleInvalidatesSortedthrough the real consumer, and the full vector race suite, all passed. Four new controls cover uniform metadata and each per-row sidecar, plus values, NULL/grouping, scalar metadata and pool cleanup.go vet, vector incrementalgolangci-lint, formatting and delivery-artifact checks passed.Performance: compared with a frozen
f0a6ed145e07c84ecc80566ac659212c4a20debdvector.go-only overlay using the same benchmark and other compiler inputs. One warm-up and four alternating paired rounds, 2 seconds per measured case, GOMAXPROCS=1: 8192-row unsorted buffered int64 median 4377.5 → 4311.5 ns/op (-1.51%); varchar 7520.0 → 7453.5 ns/op (-0.88%). Both 64-row controls were faster, and every sample retained 0 B/op and 0 allocs/op. The paired log-ratio model's 95% interval for int64 was [-5.59%, +1.42%]. These are local component measurements on a shared host, not an end-to-end SQL result. Sorted vectors still require the nondecreasing-selection scan; its consumer net benefit remains unmeasured.