Skip to content

Optimize Shuffle ordering proof and identity copy - #32168

Merged
XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/5f29b1f5e09cba7e0888ce43a684fcea4676a59873dac027b38a3e7363263674
Nov 4, 2026
Merged

XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/5f29b1f5e09cba7e0888ce43a684fcea4676a59873dac027b38a3e7363263674

Conversation

@iamlinjunhong

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

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.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: fec2852ee7b4e5a2d765210548819d91c897fe86

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mo-bot review · mo-bot-local · review

Commit: fec2852ee7b4e5a2d765210548819d91c897fe86

Assessment: approve

The shared gather/ordering helper removes a separate proof pass and unnecessary disjoint identity copy-back while preserving ownership, failure rollback, metadata and sorted-consumer behavior. The added branch is justified by the scoped component optimization; no actionable defect remains.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed the complete four-file delta, owners, sorted consumers and linked issue discussion. Frozen exact-head CI passed shared build, UT, SCA, coverage, PROXY and pessimistic multi-CN BVT.

  • Isolated internal helper probe passed 328,828 gather/ordering/identity cases and 83,521 byte-range cases; no skips. Receipt: checks/1793802189699240402-2.json; retained probe-tests.jsonl and probe-inputs.json.

  • Source, patch, gofmt, discussion coverage and execution-evidence audit passed. Receipt: checks/1793802300375977724-2.json; audit-report.json. Source remained unchanged.

Limitations:

  • The local probe uses extracted function bodies with a reduced type constraint; it is not a linked repository-package test. Package/public-path validation is reused from frozen CI; no fresh race run is claimed.

  • The reported 30.52% component gain and small descending-control signal were not independently benchmarked here and establish no end-to-end SQL performance claim. General non-identity scratch/data overlap remains unsupported as disclosed.

@mergify mergify Bot added the queued label Nov 4, 2026
@mergify

mergify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue · pull request dequeued

2 h 27 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 4 Nov, 14:26 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 16:54 · 2187126

Reason

Pull request #32168 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.

The author needs to enable "Allow edits from maintainers" on this pull request.

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, tick the box below to queue it again as it is.

Merge conditions not met when it left the queue

  • any of · required by GitHub branch protection:
    • check-neutral = CI Required
    • check-skipped = CI Required
    • check-success = CI Required

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request
2 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection

Times in UTC · dashboard · how the merge queue works

This branch was successfully deployed

No deployments
ci — 2187126b Deployed Nov 4, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dequeued kind/bug Something isn't working kind/enhancement size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants