Skip to content

fix: stabilize Top typed-NULL layout on 4.2-dev - #32238

Merged
XuPeng-SH merged 3 commits into
matrixorigin:4.2-devfrom
ck89119:issue-top-panic-4.2-dev
Nov 6, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:4.2-devfrom
ck89119:issue-top-panic-4.2-dev

Conversation

@ck89119

@ck89119 ck89119 commented Nov 5, 2026

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:

Fixes matrixorigin/matrixflow#20795

What this PR does / why we need it:

Backport the stable Top ordering layout from #30714 to 4.2-dev. A column expression may return an executor-owned typed-NULL vector, so pointer identity cannot identify its logical column. Use the planned column slot and append only computed sort expressions, keeping the layout stable across batches.

Preserve this branch's cancellation checks and ordering comparators; do not import unrelated main memory-management changes.

Validation (Go 1.26.4, branch-local native libraries):

  • Reproduced the original index-out-of-range panic before the fix.
  • Top package tests passed, including both typed-NULL batch orders, computed keys, heap replacement, reset/reuse, partial evaluation failure and spill cleanup.
  • Changed production statements have 100% coverage; Top package coverage is 76.0%.
  • Incremental formatting/static checks, vet and service build passed.
  • SQL BVT passed twice on the same owned instance: 36/36 each, with order-sensitive comparison and database/service cleanup checks.

The complete production SQL was truncated, so validation uses minimal reproductions rather than a replay of the full production statement. No production deployment was performed.

@mergify
mergify Bot requested a review from XuPeng-SH November 5, 2026 08:09
@mergify mergify Bot added the kind/bug Something isn't working label Nov 5, 2026
@ck89119
ck89119 marked this pull request as ready for review November 5, 2026 08:30
@ck89119
ck89119 requested a review from aunjgr as a code owner November 5, 2026 08:30
@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 →

@aunjgr aunjgr 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.

Reviewed the complete change at 7020063, including the typed-NULL/computed-key layout, both input orders, heap replacement, reset/error handling and spill ownership. Planned column slots now determine the layout while the existing private build-batch view preserves the child's vectors; computed keys remain appended independently. No blocking findings.

Reused the exact-head successful CI and assessed the focused UT/SQL regression oracles. No additional local test run was needed.

@XuPeng-SH

XuPeng-SH commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 7020063ea7900bc75086fd912065c68dd4da7125

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: 7020063ea7900bc75086fd912065c68dd4da7125

Assessment: approve

No actionable findings. Planned column slots fix typed-NULL layout drift while reusing Top's private batch view, preserving child ownership without adding state or abstractions.

Model: gpt-6.1-sol / max

Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0

Validation:

  • Reviewed the complete four-file delta, linked issue and all three discussion entries; traced expression evaluation, heap/spill consumers, output and cleanup.

  • Reused successful frozen-head UT, build, SCA, coverage and complementary BVT CI; assessed regression oracles and test selection.

  • Local source/evidence check passed: clean frozen head, matching delta, whitespace and discussion coverage. Receipt: checks/1793904144581809285-2.json; log: source-and-evidence-check.log.

Limitations:

  • No new Go or SQL execution. Supplied CI conclusions lack per-test logs; author-reported coverage percentages and repeated SQL counts were not independently verified.

  • Exact customer workload was not replayed because schema/data, deployed version and complete server logs were unavailable. SQL comparison sorting is supplemented by exact-order unit assertions.

@XuPeng-SH

XuPeng-SH commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 2056191d28ec9adaa854fc0bee541100dded7146

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: 2056191d28ec9adaa854fc0bee541100dded7146

Assessment: approve

Planned column slots fix typed-NULL layout drift while reusing Top’s private batch view and existing heap/spill ownership. Computed keys remain independent, with no new state or abstraction. No actionable findings.

Model: gpt-6.1-sol / max

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

Validation:

  • Reviewed the complete four-file delta, all five discussion entries and linked issue context; traced evaluation, heap/spill consumers, output, errors and cleanup.

  • Reused frozen-head successful UT, build, SCA, coverage and complementary BVT CI; assessed focused regression oracles and qualified unchanged prior source.

  • Local source/evidence audit passed. Receipt: checks/1793940118971345597-2.json; retained log: source-and-evidence-check.log.

Limitations:

  • No new Go or SQL execution. Per-test CI logs are unavailable; author-reported coverage percentages and repeated SQL counts were not independently verified.

  • Exact customer workload was not replayed because schema/data, deployed version and complete logs were unavailable. SQL result sorting is supplemented by exact-order unit assertions.

@XuPeng-SH
XuPeng-SH merged commit 595edf4 into matrixorigin:4.2-dev Nov 6, 2026
@ck89119
ck89119 deleted the issue-top-panic-4.2-dev branch November 7, 2026 05:33

This branch was previously deployed

1 inactive deployment
ci — 2056191d Deployed Nov 6, 2026 by ck89119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants