Skip to content

[Subtask]: Define TaeRead Substrait extension and sidecar plan execution #26155

Closed

Description

@aunjgr

Parent issue

Parent issue: #26154

Goal

Own the Sirius-side plan contract: strict TaeRead validation and resolution, Substrait import, direct Sirius GPU planning, bounded result production, and the exact capability surface needed by all canonical MatrixOne TPC-H plans.

Delivered foundations

TPC-H implementation under review

  1. feat: import Substrait anti joins duckdb-substrait#2 adds left/right anti-join import with NULL and duplicate counterexamples.
  2. feat: validate MatrixOne TPC-H Substrait plans sirius#4 aligns authenticated database_id and admits the exact TPC-H surface: inner, left outer, right outer, left/right semi, left/right anti, decimal/date/string expressions, CASE, IN, and required aggregates.
  3. feat: extend Flight offload to TPC-H plans mo-sirius-sidecar#6 pins the importer/Sirius stack, publishes the exact canonical capability hash, and makes cancellation acknowledgement mean the worker is quiescent before resolver/lease release.

The validator accepts bounded backward top-level references. MatrixOne's canonical TPC-H Q15 plan is already inlined, so this stack does not change or depend on MatrixOne CTE planning.

Only explicitly classified unsupported capabilities are fallback eligible. Malformed plans, authentication/resolution failures, execution failures, and post-visibility cancellation remain terminal.

Acceptance status

  • Exact positive/negative relation, type, expression, identity, and reference contract coverage is present in the PR stack.
  • The Sirius contract suite passes 60 assertions in 7 cases; the sidecar contract suite passes 29 assertions in 6 cases.
  • Direct Sirius planning remains the only accepted execution path; ordinary DuckDB CPU fallback is not introduced.
  • Hardware proof that Q1-Q22 actually execute on Sirius GPU remains in [Subtask]: Add compatibility and end-to-end coverage for Substrait offload #26159 and runs after the dependency stack merges.

Merge order: matrixorigin/duckdb-substrait#2 -> matrixorigin/sirius#4 -> matrixorigin/mo-sirius-sidecar#6.

Activity

  1. self-assigned this
    on Jul 24, 2026
  2. aunjgr commented on Jul 24, 2026

    @aunjgr
    ContributorAuthor

    Detailed design decisions

    Version negotiation. The request must carry three independent compatibility values: pinned Substrait protobuf version, TaeRead.protocol_version, and a sidecar capability-set hash. The sidecar compares all three before parsing/binding. This prevents a producer upgrade from being silently interpreted with a different extension or function implementation.

    Plan validation order. Perform work in this order: bounded protobuf decode -> exactly one read-only root relation -> extension/type/function capability validation -> lease and manifest authentication -> schema/digest validation -> DuckDB relation construction -> Sirius physical-plan construction -> GPU admission -> execution. Nothing before validation may fetch an object or reserve GPU memory.

    Scan contract. ReadRel.base_schema is the producer's expected field order, names, types, and nullability. The importer must compare it to the leased manifest/tae_scan bind result exactly; it must not use DuckDB coercions to repair a mismatch. Field references in the rest of the plan are positional, so a schema-order mismatch is a correctness error.

    Execution refactor. Extract a common prepare_sirius(logical_plan, result_schema) helper from the existing SQL gpu_execution path. SQL uses parser -> logical plan -> helper; Substrait uses importer -> logical relation/plan -> helper. The Substrait entry point never calls the parser, from_substrait() table function, or a normal DuckDB Relation::Execute() path.

    Terminal ownership. The sidecar execution object owns the GPU reservation, DuckDB connection/context, manifest lease handle, and result producer. One Finish(reason) path releases them exactly once for success, validation failure, execution error, client cancellation, deadline, and connection loss.

    No hybrid execution in this task. A submitted plan is a complete read-only query. There is no MO->Sirius->MO fragment exchange in v1; that would need an explicit Arrow exchange relation and distributed scheduling contract.

  3. aunjgr commented on Aug 21, 2026

    @aunjgr
    ContributorAuthor
    Completion status: delivered and ready to close. matrixorigin/duckdb-substrait#2, matrixorigin/sirius#4, and matrixorigin/mo-sirius-sidecar#6 are merged. They provide the bounded TaeRead importer/execution capability contract. The remaining hardware and all-22 end-to-end proof is explicitly tracked by #26159.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions