Repository navigation
Closed
Labels
Description
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
- feat: add Substrait offload execution sirius#3 added the versioned
TaeReadexecution boundary, authenticated read resolution, direct Sirius logical-to-physical planning, bounded callbacks, cancellation, and CPU-only contract tests. - feat: add authenticated Substrait Flight runtime mo-sirius-sidecar#5 added the mTLS Arrow Flight runtime, canonical negotiation, opaque tickets, resolver integration, bounded one-batch streaming, shutdown, and execution-evidence tests.
TPC-H implementation under review
- feat: import Substrait anti joins duckdb-substrait#2 adds left/right anti-join import with NULL and duplicate counterexamples.
- feat: validate MatrixOne TPC-H Substrait plans sirius#4 aligns authenticated
database_idand 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. - 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
aunjgr commentedon Jul 24, 2026
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_schemais the producer's expected field order, names, types, and nullability. The importer must compare it to the leased manifest/tae_scanbind 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 SQLgpu_executionpath. 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 DuckDBRelation::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.
aunjgr commentedon Aug 21, 2026