Repository navigation
Push decimal comparisons, between and fills through Widen - #11003
Draft
connortsui20 wants to merge 1 commit into
Draft
connortsui20 wants to merge 1 commit into
connortsui20 wants to merge 1 commit into
Conversation
Without kernels, a compare, between or fill null on a decimal Widen first copies every value into the logical width. Run them on the narrower child instead. A constant within the child precision is cast to the child dtype, a constant outside it answers a compare without reading values, and two decimal Widens compare at the larger child precision. A fill value outside the child precision declines, because only the values can pick a wider child. These kernels decide from the child dtype alone, so document that the child precision must hold every valid value. Signed-off-by: Connor Tsui <[email protected]>
This was referenced Oct 29, 2026
Merging this PR will regress 1 benchmark2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking Issue: #10701
Stacked on #10946. #11004 builds on it. No release gate.
Summary
Without kernels, a compare, between or fill null on a decimal
Widenfirst copies every value into the canonical width. These now run on the narrow child.Changes
A constant within the child precision is cast to the child dtype. A constant outside the child precision answers the compare without reading the values, because a decimal precision range is symmetric about zero. Two decimal
Widens compare at the larger child precision.betweenalready rewrites into two compares, so it uses the same kernel. A fill value outside the child precision declines, because only the values can pick a wider child.These kernels decide from the child dtype alone, so a child precision that misses a valid value gives wrong answers. The
Widendocs now state that rule.Local benchmark results
cargo bench -p vortex-array --bench widen_decimal, Apple M4, medians. The numbers were measured at the top of this stack before the split, so they cover the whole stack, not this layer alone. The baseline is the canonical input, and the candidate is the same values as aWiden(child precision 5 under precision 10, 9 under 18, and 18 under 38). CodSpeed on this PR measures the layer itself.compare_constantcompare_constant_out_of_rangeAPI Changes
None.