skyon0522-ai opened a new pull request, #11708: URL: https://github.com/apache/arrow-rs/pull/11708
# Which issue does this PR close? - Closes #11605 # Rationale for this change Fixed-point Decimal128 multiplication can return nonzero values for zero products when reducing the scale by 77. Larger reductions, or sufficiently negative input-scale sums, can also overflow the intermediate scale arithmetic in debug builds. # What changes are included in this PR? Compute scales in `i16` and explicitly return rounded zeros when the scale reduction exceeds 76. Every product of two `i128` coefficients has magnitude at most 2^254, less than half of 10^77, so all such products round to zero. The existing checked and unchecked arity helpers preserve nulls, length errors, and output metadata. Smaller reductions keep the existing rounding path. # Are these changes tested? New regressions exercise reductions of 77 and 128 through the checked, unchecked, and dynamic entry points, including nullable, non-null, empty, and unequal-length inputs. A boundary test retains the nonzero results at reduction 76. Negative-scale tests cover product-scale sums below -128 and direct multiplication at -128; existing rounding tests remain unchanged. # Are there any significant user-facing changes? No public API change. AI assistance was used for source analysis, the implementation, regression tests, and this PR draft. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
