Skip to content

feat(vm): materialize dictionary batches for unsupported consumers - #32405

Merged
mergify[bot] merged 23 commits into
matrixorigin:mainfrom
aunjgr:feat/dictionary-vector-boundaries
Nov 10, 2026
Merged

mergify[bot] merged 23 commits into
matrixorigin:mainfrom
aunjgr:feat/dictionary-vector-boundaries

Conversation

@aunjgr

@aunjgr aunjgr commented Nov 9, 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:

Closes #32384. Part of #32379.

What this PR does / why we need it:

Adds per-child dictionary input capabilities and explicit normalization before unsupported consumers or external roots. Only dictionary producers own conversion state: Call retires prior private output, and ExecProjection normalizes its final batch before publication. Ordinary OperatorBase layout and vm.Exec remain identical to main. Capability configuration is folded into preparation; executable operator identity and wire opcodes are preserved.

Copies selected logical rows into privately owned flat vectors without mutating borrowed input or expression-owned headers. Preserves constants, NULL/grouping, string/prepared metadata, batch markers and auxiliary payload under the declared allocation account. Protobuf encoding uses a constant's physical value count with its logical broadcast length.

Runtime cleanup detaches conversion output across producer Reset, including reset that clears producer state, then retires it after work stops. Free retires output before account disposal. Cancellation before Call uses framework terminal cleanup. Existing flat spill/network/protobuf formats and explicit serialization materialization remain in place. No production dictionary producer is enabled.

Dependencies and design

Builds on merged #32394. The diff against main contains only the compatibility-boundary stage. The requester-approved producer-owned revision is documented in docs/design/dictionary-vector-boundaries.md and implemented in 540e7aa80a.

Implements the compatibility stage of the approved design. Runtime ownership and the default consumer matrix are documented in docs/design/dictionary-vector-boundaries.md. Draft development may stack; qualification and production readiness remain isolated after prerequisites merge.

Validation

Focused tests cover logical row order/repetition, mixed string/constant batches, NULL/grouping and expression metadata, independent storage, explicit accounts, partial allocation failures, current/legacy/spill/protobuf boundaries, and constant NULL/empty inputs. Runtime tests cover unknown and per-child capable consumers, root output, projection, flat pass-through and terminal cleanup. A real frontend Output callback checks normalization and early-failure pipeline cleanup.

Vector, batch, VM, pipeline, dependent and compiler owning-package tests pass. Full pre-push static checks and focused lifecycle race checks are recorded in the appended validation comment.

Performance acceptance is pending. This stays draft until fresh CI and the neutral SF10/SF100 memory/disk gate pass, with all Q1–Q22 plus Total, five matched process pairs, cold suites excluded, Holm query checks and separate Total checks, and no SF100 spill. No speedup is claimed by this foundation.

aunjgr commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Validation at 9684f537bfea24f96938cce259594362424a5d80 (main e2459cc55f, prerequisite #32394 at 8cdf72eb00):

  • Controlled CGo owning-package tests: vector, batch, VM, pipeline, dependent and compiler pass. Compiler package execution: 14.393 s.
  • Final FlatCopy controls pass, including constant NULL/empty, legacy/current/spill/protobuf boundaries and deterministic partial-allocation failures.
  • Focused VM/pipeline race tests pass, including actual Output early failure, asynchronous owner reset ordering and sender/receiver cleanup.
  • Required full pre-push static gate passes with 0 issues in the standard CI configuration: package graph, molint, license and golangci checks. Runtime tests use Go 1.27.1 with SIMD enabled.

The optional SIMD-mode full molint scan rejects unsafe imports in unchanged vectorindex metric files; a clean main 70952cb466 control reproduces both findings. That separate policy gap is not suppressed or modified here.

No production dictionary producer is enabled. Performance acceptance has not run for this stage; it remains a draft behind #32394 and the isolated neutral SF10/SF100 gate.

Source-only incremental implementation: aunjgr@9684f53

@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label Nov 9, 2026
@aunjgr aunjgr changed the title Add explicit dictionary vector compatibility boundaries feat(vm): materialize dictionary batches for unsupported consumers Nov 9, 2026

aunjgr commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged #32394's CI correction in ea307db951 (core fix cd15bdb20f). This preserves the checked physical accessor's backed-empty slice contract; the boundary implementation itself is unchanged. The merge diff against the prior boundary head contains exactly the core accessor fix and its small API regression test.

Batch, VM and pipeline owning-package tests pass after the merge. The core vector/multi-update owning packages also pass with coverage instrumentation, including the exact CI failure. Full required pre-push static checks pass with 0 issues. Prior unchanged lifecycle race evidence remains applicable.

The previous #32405 UT/coverage and Compose jobs stopped during HTTP504 dependency/CMake setup, before their tests ran. Fresh-head CI is being triggered; no coverage threshold or test assertion was relaxed. This PR remains draft pending its prerequisite and performance acceptance.

@aunjgr
aunjgr requested a review from fengttt as a code owner November 10, 2026 06:09
@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 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 540e7aa80ac39b27f4c7a89b9ef9e3c2e6a80e45

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: 540e7aa80ac39b27f4c7a89b9ef9e3c2e6a80e45

Assessment: approve

Producer-owned normalization coherently reuses existing vector materialization, allocation accounting and batch cleanup, with one private output per execution lane. It preserves ordinary OperatorBase/Exec, operator identity and flat formats. The earlier failed performance candidate remains superseded by the approved structural revision and fresh neutral SF10/SF100 reports; the withdrawn Q12 scope does not add a speedup requirement. No actionable defect remains in the 14-file boundary-stage scope.

Model: gpt-6.1-sol / max

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

Validation:

  • Reviewed the complete delta, versioned approved design and producer-owned amendment, all 15 discussion entries, linked issue bodies/comments and affected copy/codec/prepare/cleanup/native/compiler consumers. Ownership, scope and prior concerns are recorded in review-plan.md and discussion-assessment.json.

  • Source/selection/table audit passed: checks/1794295478124698994-3.json with dictionary-review-audit.log/json. Verified baseline-identical OperatorBase/Exec, disabled production producers, normalization/publication and cleanup ordering, codec guards, selected-row/NULL/grouping/constant oracles, and four source-pinned performance reports covering Q1-Q22/Total with matching summed means. This is source/model/report validation, not product or benchmark execution.

  • Whitespace and gofmt checks passed with empty logs: checks/1794295472858584514-3.json (diff-check.log) and checks/1794295472866641753-3.json (gofmt-check.log). validation-ledger.json reconciles actual commands, clean head, exits and retained logs.

  • Reused completed successful exact-head build, x86 UT, arm64 SCA, coverage, PROXY/pessimistic multi-CN BVT and CI Required contexts. Additional in-progress contexts and skipped/neutral contexts are not passes.

  • Reused reported current-head owning-package/full-static/focused VM-pipeline race evidence and isolated five-pair SF10/SF100 memory/disk qualification under the unchanged Holm/query, separate Total and no-spill/swap/OOM gates. Earlier core evidence applies to unchanged core semantics; older boundary heads are not treated as current execution.

Limitations:

  • No fresh local Go, kernel/SQL, race or benchmark execution. Raw CI/author race logs and raw performance pairs/work/instruction/memory records were not supplied; statistical execution and lifecycle runs are reused as reported evidence.

  • The four current performance reports support neutral acceptance, not equivalence or a speedup. The old coverage assertion cause remains unestablished; later exact-mode/package reports and completed current-head CI are passing evidence rather than an independent diagnosis.

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Queue requested — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

queue

🛑 Pull request from fork cannot be queued

Details

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.

2 similar comments
@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

queue

🛑 Pull request from fork cannot be queued

Details

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.

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

queue

🛑 Pull request from fork cannot be queued

Details

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.

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

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as 00da052 at 10:00 UTC

1 h 58 min in the queue, 1 h 17 min of it CI.

So far

  • ✅ Entered the queue Tue 10 Nov, 08:02 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Passed · in place
  • ✅ Merged 10:00 · 00da052 · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
ci — 7588aa58 Deployed Nov 10, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/api-change kind/enhancement kind/feature size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask]: Add explicit dictionary-vector compatibility boundaries

3 participants