DiadkoShmek opened a new pull request, #55395:
URL: https://github.com/apache/arrow/pull/55395

   ### Rationale for this change
   
   Fixes GH-55394.
   
   `negate_checked` registers duration kernels using unchecked `Negate`, so a 
valid `INT64_MIN` duration silently wraps to the same negative value. Its 
mathematical negation is outside signed64 storage, and the documented checked 
behavior requires an overflow error.
   
   ### What changes are included in this PR?
   
   Register duration kernels with the existing `NegateChecked` implementation. 
Add regression coverage for all four duration units, scalar/array overflow, 
representable extrema and nulls, while keeping unchecked negation's wrap 
behavior.
   
   ### Are these changes tested?
   
   The exact base and candidate production translation units were compiled 
separately and run in fresh private registries against the same pinned official 
PyArrow26.0.1 support libraries. An independent arbitrary precision integer 
oracle checks 90 input shapes/types and 5,265 outputs per build. The base fails 
36 checked-duration overflow checks; the candidate passes all checks.
   
   Coverage includes actual bitmap-valid duration minima, masked minimum 
payloads, four units, int64 controls, 
scalar/array/chunked/sliced/empty/all-null inputs, neighboring extrema and 
ordinary values. Checked absolute value and unchecked negation serve as 
controls.
   
   A separate review oracle also checked 320 input representations and 26,925 
native rows per build: the base has 456 mismatches, all checked-duration 
overflow, and the candidate has none.
   
   The actual submitted native test translation unit passes syntax-only 
compilation. The added C++ test range also has zero replacements with the 
repository-pinned clang-format 18.1.8. These focused checks are not a full 
current-main build or an execution of the upstream gtest suite; full 
integration tests remain for CI.
   
   ### Are there any user-facing changes?
   
   `negate_checked` now returns the promised overflow error for a valid minimum 
duration. Representable values, nulls, output duration units and unchecked 
negation remain unchanged.
   
   ### Was AI used for this PR?
   
   AI prepared the implementation, regression, independent oracle and this 
description; AI reviewed the changes.
   
   **PR code and description written by:**
   
   - [ ] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [ ] Human
   - [x] AI
   - [ ] Not reviewed
   


-- 
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]

Reply via email to