Skip to content

Add DOUBLE-to-DECIMAL workload benchmarks - #31305

Merged
mergify[bot] merged 1 commit into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/ad2fe50d8b2352d6c3e567da6a68fc368a35275460ee89a49b545048f54374e5
Oct 26, 2026
Merged

mergify[bot] merged 1 commit into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/ad2fe50d8b2352d6c3e567da6a68fc368a35275460ee89a49b545048f54374e5

Conversation

@iamlinjunhong

@iamlinjunhong iamlinjunhong commented Oct 26, 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:

What this PR does / why we need it:

Adds reusable scalar/vector controls and a bounded SQL workload runner for the performance follow-up to merged #31191 and #31279. The original shortest-decimal rounding correction is preserved; this PR changes tests and measurement tools only.

The runner verifies stored DOUBLE bit patterns, target metadata, runtime CAST plans and complete converted value distributions against an independent Decimal oracle. It covers five fallback classes, ordinary/exact-integer controls, both target sizes and high scales. Regression coverage adds subnormal boundaries, tiny runtime/NULL cases and DOUBLE rounding-overflow warnings.

Original-head validation (d92e7dc09b) passed: both owning Go packages (including 5,679 rational-oracle cases), current-source vector benchmarks, incremental vet/lint, bounded-plan/output counterexamples and two 84-statement real-service BVT comparisons, the second including metadata. Original literals still return 1.01, 1.02 and -1.01.

On the original source, a controlled C–A–A–C experiment compared current code with only #31279's fast path disabled: 16M stored rows per cohort, ten measured samples per side for scans and INSERT SELECT. On Apple M4 / darwin-arm64 / Go 1.27.1, current fallback-scan medians were roughly 0.43–0.71 s. Sample ranges overlapped and the same current binary's ordinary-scan arm medians drifted from 205 to 696 ms, so these measurements do not establish a stable query-throughput gain. Remaining formatting costs and measurement limits are explicit; scalar timings are not treated as query-performance approval.

Reused evidence: CI run 40371620171 passed UT, SCA, coverage, both enabled BVT lanes and CI Required at a718bfdf7f. The independent review verified the scalar/vector controls and Python host probes at that same head. Historical service measurements above were not repeated.

Manual branch refresh (be4d060abb, based on official main 7b80dbdbd3) brings in the workflow updates that Mergify could not apply without workflow-write permission; it does not change Mergify permissions. All six PR files remain byte-identical to a718bfdf7f. Newly passed .agents/skills/mo-dev/scripts/mo-cgo-test -short -p=2 -parallel=2 -v -count=1 -timeout=120s -run='^(TestCast|TestExplicitCastLexicalDecimalDiagnostics|TestExplicitCastLexicalStrictDMLEscalation)$' -bench='^BenchmarkFloatDecimalVectors$' -benchtime=1x ./pkg/sql/plan/function: the three selected tests and all 38 vector branches (correctness smoke only). Diff, patch-equivalence and delivery-artifact checks passed. Types/native source inputs are unchanged across the base update; existing types evidence is reused. The local check retained pre-usearch-2.26.5 native libraries and does not validate HNSW or a fresh native generation. Full CI on the new base remains pending.

Please have the reporter verify #31133 after merge.

@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 →

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Oct 26, 2026
@mergify mergify Bot added the kind/test-ci label Oct 26, 2026
@iamlinjunhong
iamlinjunhong force-pushed the codex/loom/develop/ad2fe50d8b2352d6c3e567da6a68fc368a35275460ee89a49b545048f54374e5 branch from d92e7dc to 75c5d05 Compare October 26, 2026 16:33
@iamlinjunhong
iamlinjunhong force-pushed the codex/loom/develop/ad2fe50d8b2352d6c3e567da6a68fc368a35275460ee89a49b545048f54374e5 branch from 75c5d05 to a718bfd Compare October 26, 2026 17:45
@XuPeng-SH

XuPeng-SH commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: a718bfdf7f978118c93037b9d480c4997a94c295

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: a718bfdf7f978118c93037b9d480c4997a94c295

Assessment: approve

Reviewed all six files and the complete frozen discussion. The benchmarks reuse production conversion owners, verify results independently outside timing, and keep large workloads outside UT/BVT. No production SQL paths change. The author appropriately makes no throughput claim from noisy historical measurements. No blocking findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Focused Go checks passed: 5,679 rational-oracle combinations, allocation controls, TestCast, all 38 vector benchmark branches and 16 scalar branches. Receipt: checks/1793040859355052780-14.json; log: decimal-focused.log. One-iteration benchmarks establish correctness only.

  • Eight Python host probes passed for frozen-plan bounds, oracle agreement, stored-bit/distribution rejection, failed-sample retention, existing-database protection and cleanup. These used a fake connection. Receipt: checks/1793040784923147479-4.json; log: runner-probe.log.

  • Isolation preflight and repository-owned native build/provenance verification passed. Audited 195 native inputs against the current frozen source; source remained unchanged.

  • Frozen exact-head CI reports successful UT, SCA, coverage and both enabled BVT lanes. The changed SQL case belongs to BVT group 1; individual case logs were unavailable.

  • Diff checks, gofmt, Python syntax and receipt/log reconciliation passed. Artifacts are retained under /home/xupeng/.local/state/mo-bot/jobs/a6187b0fa00c0ff8d84c820a/attempt-1: validation-audit.json, review-report.json and discussion-assessment.json. Both nonempty discussion keys are accounted for exactly once.

Limitations:

  • No local real-service workload replay, live MySQL comparison or statistical throughput comparison was performed. Historical author measurements were not independently reproduced.

  • The runner records EXPLAIN and target metadata for human inspection; successful execution alone does not establish a valid performance comparison.

  • The full linked issue and retained author workload artifacts were absent from the frozen evidence. The discussion contained only informational notices, with no substantive disputes.

@mergify mergify Bot added the queued label Oct 26, 2026
@mergify

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-26 19:01 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🚫 Left the queue — 2026-10-26 19:02 UTC · at a718bfdf7f978118c93037b9d480c4997a94c295

This pull request spent 44 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/ci-scope-check.yml without workflows permission
GitHub only lets Mergify write to .github/workflows/ with the workflows permission. An organization owner can accept Mergify's pending permissions at https://dashboard.mergify.com/orgs/matrixorigin/repositories.

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added dequeued and removed queued labels Oct 26, 2026
@iamlinjunhong
iamlinjunhong force-pushed the codex/loom/develop/ad2fe50d8b2352d6c3e567da6a68fc368a35275460ee89a49b545048f54374e5 branch from a718bfd to be4d060 Compare October 26, 2026 19:23
@mergify mergify Bot removed the dequeued label Oct 26, 2026
@mergify mergify Bot added the queued label Oct 26, 2026
@mergify
mergify Bot merged commit 59bad9e into matrixorigin:main Oct 26, 2026
29 of 30 checks passed
@mergify

mergify Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-26 20:23 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-10-26 20:23 UTC · at 59bad9e8aea4314af30fd25ce53267df5140c8fa · squash

This pull request spent 11 seconds in the queue, with no time running CI.

Required conditions to merge

@mergify mergify Bot removed the queued label Oct 26, 2026
XuPeng-SH added a commit that referenced this pull request Oct 27, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

- #31133

## What this PR does / why we need it:

Removes shortest-value text formatting and reparsing from successful
DOUBLE-to-DECIMAL64/128 fallback conversions. A private Go 1.27.1
numerical coefficient/exponent primitive preserves shortest-decimal
rounding, the existing common-value shortcut, exact integral Decimal128
conversion and cast diagnostics. It includes a reproducible, attributed
fixed power table.

This follows merged #31191 (rounding correction), #31279 (common-value
shortcut) and #31305 (coverage and measurement). The returned concern
was remaining conversion work; the original rounding fix remains intact,
including `CAST(1.005e0 AS DECIMAL(10,2)) = 1.01`. Existing error/retry
formatting and Decimal256 conversion are unchanged.

Validation: owning types/function tests, 137,168 shortest-pair checks,
5,719 rational rounding cases, scalar allocation checks, generator
reproduction, incremental vet/lint, and two normal 89-statement
real-service BVT runs, including metadata, strict rollback and prepared
DOUBLE rebinding. Paired five-sample conversion benchmarks on Apple M4 /
Go 1.27.1 reduce fallback scalar medians by 38–79% and vector medians by
35–76%, within control budgets and with zero scalar allocations.

A bounded 16M-row A–B–B–A SQL experiment verified all outputs but showed
substantial host drift; query throughput benefit remains undetermined.
An initially slower integral INSERT control did not repeat in one
bounded follow-up. Remote CI is pending.

Please have the reporter verify #31133 after merge.

CI repair validation (`470a2a0191f9f41ee9455e42a8f59e37e0e7165a`):
preserves the Go-derived BSD headers and adds three exact license-eye
path exclusions. Newly executed `license-eye -c .licenserc.yml header
check` passed (6,983 files, zero invalid), `license-eye -c
.licenserc.yml dep check` passed, and an unlicensed neighboring Go-file
control was correctly rejected. Build and [coverage
UT](https://github.com/matrixorigin/matrixone/actions/runs/40447443739/job/122002065623)
results from `8467a69b316f16529042c211fb87a32f2220e57e` are reused
because all executable sources, tests and build inputs are unchanged.
Full SCA on this repair remains pending.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>

This branch was previously deployed

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

Labels

kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants