Repository navigation
Keep same-scale decimal widening casts lazy - #11006
Draft
connortsui20 wants to merge 1 commit into
Draft
connortsui20 wants to merge 1 commit into
connortsui20 wants to merge 1 commit into
Conversation
A same-scale cast that grows the canonical width copied every value into the wider type, even when the caller never reads them all. Return a decimal Widen over the source instead, whose dtype is a true label for its values, so the copy waits for execution. The child also keeps the statistics of the source, such as exact extrema, because it holds the same values. A cast of a decimal Widen passes to its child. This is the first production code that builds a decimal Widen. Widen execution already copies decimal values instead of yielding a cast, which now also keeps it from yielding a cast that returns a Widen again. A test checks that the default file writer round-trips a decimal Widen. 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
Top of the decimal
Widenstack, on #11005. No release gate.Summary
A same-scale decimal cast that grows the canonical width copied every value into the wider type, even when the caller never reads them all. It now returns a decimal
Widenover the source, so the copy waits for execution, and compute after the cast runs on the narrow values. This is the first production code that builds a decimalWiden, so it lands after the serializer lowering (#11002) and the kernels (#11003, #11004).Changes
The child keeps the statistics of the source, such as exact extrema, because it holds the same values. A cast of a decimal
Widenpasses to its child.Widenexecution copies decimal values instead of yielding a cast, which also keeps it from yielding a cast that returns aWidenagain. A test checks that the default file writer round-trips a decimalWiden.Known cost:
filterat precision 38 is slower on aWidenthan on the canonical array (see #10946), and a cast result now takes that path.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.cast_widenAPI Changes
Casting a
DecimalArrayto a higher precision at the same scale returns aWidenwhen the canonical width grows.