Skip to content

Avoid formatting in DOUBLE-to-DECIMAL conversions - #31383

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/be51f8ddea7ebc5a072b82f4ff926b953dcf5de2a1fb4b5aa2c5ef4a706ca74e
Oct 27, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/be51f8ddea7ebc5a072b82f4ff926b953dcf5de2a1fb4b5aa2c5ef4a706ca74e

Conversation

@iamlinjunhong

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

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 results from 8467a69b316f16529042c211fb87a32f2220e57e are reused because all executable sources, tests and build inputs are unchanged. Full SCA on this repair remains pending.

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

@XuPeng-SH

XuPeng-SH commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 470a2a0191f9f41ee9455e42a8f59e37e0e7165a

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: 470a2a0191f9f41ee9455e42a8f59e37e0e7165a

Assessment: approve

Reviewed the complete 11-file delta and frozen discussion. The numeric shortest-value primitive preserves existing rounding, overflow and SQL diagnostic ownership. Measured fallback improvements justify the bounded arithmetic and fixed table. No actionable defects or substantive discussion disputes remain.

Model: gpt-6-astra / xhigh

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

Validation:

  • Full types and SQL function package tests passed using the supplied isolation executor and native artifacts qualified against current inputs.

  • Passed 137,168 shortest-pair fidelity checks, 5,719 value/target cases, 4,143 exponent-class checks and allocation assertions.

  • Regenerated all 696 table entries byte-for-byte; compared the numerical core and generation arithmetic with Go 1.27.1.

  • Sequential base–head–head–base benchmarks showed approximately 29–67% lower scalar fallback time and 26–68% lower vector fallback time, without allocation increases. Control median increases were at most 2.3%.

  • Frozen current-head CI reports successful UT, SCA, shared build, coverage, PROXY BVT and PESSIMISTIC BVT.

  • Saved discussion-assessment.json and reconciled command, source, exit and log evidence in /home/xupeng/.local/state/mo-bot/jobs/6bdbc5da543e842ad9c1c299/attempt-1/validation-manifest.json. Final audit confirmed the source remained unchanged.

Limitations:

  • End-to-end SQL throughput gains remain undetermined; local measurements cover scalar helpers and production vector cast entrypoints.

  • Service BVT was not repeated locally. Frozen CI supplies status metadata, without individual execution logs; author-reported service measurements remain attributed evidence.

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

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-27 05:54 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in-place
  • 🚫 Left the queue — 2026-10-27 06:49 UTC · at 2cd2cec63c3ac97284de141233fba4c3c9f96f3a

This pull request spent 55 minutes 5 seconds in the queue, with no time running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • CI Required

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

This branch had an error being deployed

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

Labels

kind/enhancement size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants