Skip to content

feat(numeric): bind MO exact-decimal plans and scalar expressions - #26

Merged
aunjgr merged 1 commit into
matrixorigin:upstream-dev-mergefrom
aunjgr:feature/28968-mo-decimal-import
Oct 8, 2026
Merged

aunjgr merged 1 commit into
matrixorigin:upstream-dev-mergefrom
aunjgr:feature/28968-mo-decimal-import

Conversation

@aunjgr

@aunjgr aunjgr commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Embedded MO plans need coefficient width, precision, scale and nullability to survive Substrait import and DuckDB binding independently. This PR carries that descriptor through literals, immutable scalar binding, Sirius AST cloning/reconstruction and GPU evaluation for all 14 exact-decimal scalar operations.

This is Native A in the approved series for matrixorigin/matrixone#28968 and matrixorigin/matrixone#28966, after merged Sirius #25 and importer #4. The semantic contract is the approved MO #29449 document, blob 42a89f09a1d168d02b9583cb3ea7b4de6dbb5634; the delivery sequence is recorded in merged MO #29690. Target: upstream-dev-merge.

The scoped importer validates extension/type identities and declared outputs. Private DuckDB carriers preserve all coefficient limbs and typed nullable results without ordinary decimal inference. The SDK exports and fingerprints the canonical literal protobuf. GPU CASE/COALESCE propagate active rows, preserve Decimal256 parent-only validity, and prove stream quiescence before retiring branch owners. Internal numeric errors retain arithmetic/cast classification.

Production embedded admission still rejects the extension and exact-decimal capability mask 16u remains clear. The C ABI is unchanged. Native B owns aggregates, keys, complete preparation validation, public statuses 12/13 and capability advertisement. MO lowering and public SQL acceptance follow that merged increment.

The descriptor, binding and scalar execution changes form one end-to-end contract: splitting those paths would leave width/nullability or conditional-error behavior unverified. The larger aggregate/key work is already split into Native B. The change/evidence map documents ownership, exposure and commands.

Validation on the frozen mo environment, CUDA 13.3.73 / cuDF-RMM 26.08 / GCC 14.4.0, RTX 3070 / driver 615.71.09:

Check Result
Binding/type/function controls 727 assertions / 75 cases passed
CPU arithmetic foundation 52,330 / 5 passed
Native ownership/protocol controls 594 / 77 passed
Imported scalar/conditional and existing native GPU/result groups 31,459 / 18 passed
Compute Sanitizer memcheck, new imported expression group 1,664 / 7 passed; zero errors
SDK exporter tests 8 passed
Native targets, independent C ABI consumer, literal schema fingerprint Passed
Pinned pre-commit hooks and complete-delta self-review Passed

The conditional regression was reproduced before the fix: cuDF STRUCT selection added child masks, violating the canonical Decimal256 carrier. The fix retains the strict shape assertion and verifies a following exact operation, inactive overflow/cast suppression, active typed errors and evaluator recovery. No assertions were weakened or tests skipped.

Raw benchmark repetitions retain the primitive controls and add identical-value ordinary/exact expression controls. Primitive checked medians changed by -0.05% to +3.83% against the recorded #25 local run. These measurements and memcheck do not establish the later SQL, resource or concurrency acceptance gates.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant