Skip to content

[Subtask]: Add explicit dictionary-vector compatibility boundaries #32384

Closed

Description

@aunjgr

Parent Issue

#32379

Detail of Subtask

Classify consumers, introduce explicit runtime normalization for unsupported consumers and cover spill, wire, frontend/native access and reset/cleanup. Default unknown consumers to flat. Do not add hidden allocations in physical accessors or emit a dictionary wire class.

Status: approved staged work; no delivered implementation or performance claim yet. See versioned design #32380. Dependencies follow the seven-PR series; no dependent producer enablement before prerequisites merge.

Describe implementation you've considered

Use immutable snapshots and shared selections, existing allocation/lease machinery and explicit read/materialization contracts. Every live backing has one effective release owner and a physical bound. Unsupported ownership or consumers retain ordinary accounted materialization.

Additional information

Acceptance: Neutral infrastructure: no confirmed regression; no production dictionary producer enabled.

Activity

  1. self-assigned this
    on Nov 8, 2026
  2. added
    severity/s0
    on Nov 8, 2026
  3. aunjgr commented on Nov 9, 2026

    @aunjgr
    ContributorAuthor

    Implementation is now available as stacked draft #32405, based on dictionary core #32394. It adds default-flat per-child capability boundaries, transactional private flat copies, unchanged wire/spill formats and runtime-owned terminal cleanup. Owning-package, focused race and required full static checks pass; detailed validation is in the PR comments.

    Draft development may proceed before prerequisite merge. Performance qualification and production readiness still wait for the prerequisite to merge and use an isolated actual-main comparison. No production dictionary producer or speedup claim is introduced.

  4. added a commit that references this issue on Nov 10, 2026
    00da052
  5. XuPeng-SH commented on Nov 10, 2026

    @XuPeng-SH
    Contributor

    QA 交接:#32405 已于 2026-11-10 10:00 UTC 合入 main,merge SHA 00da05219fb8dce0266de4efa7c4bbfac06491de,最终 PR head 7588aa58aea55d5f96af495152e99105f3c5df3a。本项为字典向量兼容/规范化边界阶段,不启用生产 dictionary producer,也不代表总项 #32379 或后续消费者/生产者阶段完成。

    本轮已读取本 issue 全部评论、PR 全部讨论、最终差异及 review threads。作者在修订 540e7aa80ac39b27f4c7a89b9ef9e3c2e6a80e45 报告 owning-package、生命周期 race、完整静态检查及 SF10/SF100 memory/disk 中性门禁完成;性能比较各 profile 为五对独立进程、完整冷轮排除、Q1–Q22 和 Total、Holm 与独立 Total 检验,无 benchmark-time 数据/结果验证。来源:修订及测试、SF10、SF100。合并队列记录 CI Required 满足;这些是作者报告及远端状态,不是本轮本地实测,也不是对 merge SHA 的独立验收通过。

    旧 338b031f70 的 SF10 disk Total +1.48% 失败仍保留,但之后已将转换状态移至 producer、恢复普通 OperatorBase/vm.Exec,并完成新版本匹配比较;不把旧版本结果直接算作当前反例。当前未发现适用于合并版本的已验证反例或本子任务尚未完成的开发 follow-up。

    建议 QA 覆盖:未知/按 child 声明的 consumer、外部 root/真实 Output 和 projection 后规范化;重排/重复/NULL/常量及 expression metadata;私有 flat copy 不修改借用输入;allocation failure 回滚、账户释放次序;EOF/yield/error/cancel、Reset/Free/reprepare/reuse;flat wire/spill/protobuf 与 legacy 边界。真实生产字典 SQL 路径尚未启用,不能用本阶段测试替代后续 producer 的 SQL、多 CN 与性能验证。SF1000 不在本阶段范围,亦不要求 backport。

    转交 Ariznawlll 安排上述范围验证;本轮未运行 SQL、Go、race、BVT 或基准测试,转测不等于验收通过。

  6. slyunnn commented on Nov 11, 2026

    @slyunnn

    Regression and extended verification for #32384 (2026-11-11)

    Per the QA hand-off (comment, the assigned handover of 2026-11-10), the merged dictionary-boundary stage for #32384 was independently re-verified on the latest origin/main: the delivered compatibility/normalization boundaries behave as specified under the focused semantic matrix, under the race detector, and on a live neutral-infrastructure deployment — with no production dictionary producer enabled. Result: Fixed (this staged scope; not the parent #32379 and not the later producer stages).

    Verification Environment

    • Maintenance branch / remote commit: main at 4df268ea5f — fix(task): preserve SQL task execution ownership (#32331); git merge-base confirms it contains merge 00da05219fb8dce0266de4efa7c4bbfac06491de (PR feat(vm): materialize dictionary batches for unsupported consumers #32405, merged 2026-11-10 10:00 UTC, final head 7588aa58). Single-branch verification: the hand-off declares no backport for this stage; no 4.2-dev result is claimed.
    • Associated delivery: PR feat(vm): materialize dictionary batches for unsupported consumers #32405, feat(vm): materialize dictionary batches for unsupported consumers. Direction: per-child dictionary input capabilities with explicit normalization before unsupported consumers or external roots; producers alone own conversion state (Call retires prior private output; ExecProjection normalizes the final batch before publication); private flat copies never mutate borrowed input or expression-owned headers; allocation stays under the declared allocation account with terminal rollback/release ordering; runtime cleanup detaches conversion output across producer Reset, retires it after work stops, retires before account disposal on Free, and uses framework terminal cleanup for cancellation before Call; ordinary OperatorBase layout, vm.Exec, wire opcodes, and the flat spill/network/protobuf formats are unchanged; no production dictionary producer is enabled.
    • Binary / topology: local build from that exact main tip, go1.27.1 darwin/arm64; -version reports Git commit ID 4df268ea5f, buildtime 1794386251; binary SHA256 9332cb05198e6a68c22a14c579990400d8bcf305b718a2f47828f62ce04554e1. Deployed as a fresh-data single-version 2 CN / 1 TN / 1 LogService + Proxy; Proxy 6001, CN1 16001, CN2 16002 were all connected and returned git_version() = 4df268ea5f (3/3 identity consistent). The live smoke exercised the standard text-protocol SQL path through those endpoints; the semantic boundary matrix itself runs at the Go execution-engine layer, matching where the delivery (and the merged tests) live. Service stopped and all three ports released afterwards.
    • Client / method: the repository CGo test harness on the current tip (normal mode and -race), plus an untracked live smoke (pymysql) against the deployed build.

    What Was Covered

    • OK — consumer and capability boundaries: unknown and per-child declared consumers, external root / true Output publication and failed-pipeline cleanup are locked by TestDictionaryRuntimeCapabilityEdges and TestDictionaryBoundaryRealOutputAndFailedPipelineCleanup (pass).
    • OK — normalization before publication: TestDictionaryRuntimeProjectionNormalizesBeforePublication locks ExecProjection normalizing its final batch before it becomes externally visible (pass).
    • OK — private flat copy semantics: TestFlatCopyPreservesLogicalBatchAndCodecBoundaries and TestFlatCopyConstantNullAndEmpty lock that selected logical rows land in privately owned flat vectors without mutating borrowed input or expression-owned headers, preserving constants, NULL, empty/NULL-only vectors and codec metadata (pass).
    • OK — allocation failure accounting: TestFlatCopyFailureReleasesPartialPublication locks partial-publication release on allocation failure and TestDictionaryProducerCopyFailureAndReuse locks producer copy failure and reuse (pass).
    • OK — lifetime and terminal paths: TestDictionaryRuntimeOutputLifetimeAndTerminalPaths locks Reset/Free/retirement/ordering and the terminal error/cancel/EOF paths (pass).
    • OK — race-mode rerun: the full focused suite (8 top-level tests across pkg/container/batch, pkg/vm, pkg/vm/pipeline) re-run with -race — 8/8 pass, 0 WARNING: DATA RACE (three packages ok: 2.19s / 2.15s / 2.99s).
    • OK — neutral-infrastructure smoke on the deployed build: GROUP BY ... ORDER BY ... LIMIT over a low-cardinality varchar column, an inner join with LIKE + ORDER BY + LIMIT, a filtered view and SELECT 1 all return the expected rows (SMOKE_RESULT=PASS); per-round fixture DB dropped; no confirmed regression on the legacy flat execution path.
    • OK — no production dictionary producer: the merged pkg/sql/compile integration diff contains no dictionary producer activation; the smoke runs the ordinary flat path; consistent with the delivery's declared "no production dictionary producer enabled".
    • Failed — none.
    • Not covered — production dictionary SQL paths, multi-CN and producer-stage performance verification: not enabled in this stage by design; explicitly deferred to the later producer enablement per the hand-off.
    • Not covered — SF10/SF100 memory/disk five-pair matched comparisons and Holm/Total gates: recorded as author-reported remote evidence on the PR (revision 540e7aa80a and the merged final head), not re-run by this round; this round's No confirmed regression judgment rests on the semantic matrix, the race rerun and the live neutral smoke.
    • Not covered — SF1000 qualification (out of this stage's scope) and MatrixOne 4.2-dev (no backport required).

    Findings

    • Focused suite at 4df268ea5f: 8/8 top-level tests pass (normal mode); -race rerun 8/8 pass with no data-race reports.
    • Neutral deployment: 3/3 endpoints identity-consistent at 4df268ea5f; SQL smoke PASS; teardown released all ports with no lingering processes.
    • The previously recorded 338b031f70 SF10 disk Total +1.48% failure is superseded per the hand-off (conversion state moved to producer; ordinary OperatorBase/vm.Exec restored; fresh matched comparisons authored on the new shape); no verified counterexample applies to the merged version.
    • Big-data regression: not required for this round's scope. The stage is boundary/normalization machinery whose outcomes are shape-determined (consumer capability, ownership, cleanup ordering), not volume-determined; the staged performance gates stay with the owner-reported SF10/SF100 evidence until the producer stage's own qualification, and this round adds no CI cost by re-running pipeline-scale work.
    • Engine-parallel: not applicable to the boundary machinery itself; multi-CN exposure exists by deployment (two CNs plus the Proxy route answered the smoke), while dictionary execution is not yet engaged by any production producer.
    • Raw evidence archived locally: focused and race run logs, build/launch/smoke logs and binary identity records under a QA workspace; available on request.

    MOTR / BVT Coverage

    • No new MOTR/BVT case was added for this round. The delivery landed with converged unit-level contracts (flat_copy_test.go, vm/dictionary_test.go, vm/pipeline/dictionary_test.go) that pin the boundary semantics; end-user SQL behaviour is intentionally unchanged in this stage (flat execution preserved), so a .test case would assert pre-existing behaviour. The later producer-enablement stage — where visible SQL semantics appear — is the natural point for durable SQL-level coverage and remains follow-up material.

    Final Conclusion

    Fixed — verified on main at 4df268ea5f (contains merge 00da05219f, PR #32405): the dictionary-vector compatibility-boundary stage behaves as delivered under the full QA semantic matrix (consumers, external roots, projection normalization, private flat copies, allocation failure rollback and release ordering, lifetime/terminal cleanup) with 8/8 focused tests passing in both normal and -race modes on the current tip, the live neutral deployment showing no regression and no enabled production dictionary producer — while production dictionary SQL paths, producer-stage performance and SF1000 qualification remain correctly outside this stage and open on the parent track #32379.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/subtaskseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions