Repository navigation
Accept decimal children in Widen - #10946
connortsui20 wants to merge 7 commits into
Conversation
Merging this PR will degrade performance by 27.52%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
98dea22 to
bd15c87
Compare
9b2b581 to
31f7451
Compare
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Move decimal execution into its own function, with a note on why it copies instead of yielding a cast. The leaf cast compares canonical widths directly and says which casts reduce without execution. `smallest_decimal_dtype` takes a `RangeInclusive`, like `smallest_integer_ptype`. The two-`Widen` compare test now covers children with different canonical widths. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
31f7451 to
9577faf
Compare
7d99ff3 to
c0eb004
Compare
Summary
A decimal dtype's canonical width can be much wider than its values need. Decimal
Widenstores them in a lower-precision child, so compatible operations can avoid decoding the parent-width buffer.Changes
Choose the child precision from valid values and scale. Push comparisons, bounds, fitting fills and ordered aggregates to the child where they preserve the canonical result. Decimal sums keep the parent accumulator precision. Execution copies decimal values directly, so a widening cast that returns another
Widencannot create an execution loop.Widenstays in memory and outsideArraySession. The default writer already executes it through its pipeline, so CD4 adds no serialization lowering. Round-trip tests cover that path, alongside kernel, fallback and conformance tests. Benchmarks compare canonical and Widen inputs across three precision pairs.API Changes
Casting a
DecimalArrayto a higher precision at the same scale returnsWidenwhen the canonical width grows. AddWidenArray::encode_decimaland the sharedsmallest_decimal_dtypehelper.