Skip to content

Require canonical storage width for decimal arrays - #11571

Merged
connortsui20 merged 1 commit into
developfrom
ct/decimal-canonical-width
Nov 18, 2026
Merged

connortsui20 merged 1 commit into
developfrom
ct/decimal-canonical-width

Conversation

@connortsui20

@connortsui20 connortsui20 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

A decimal dtype can currently have six canonical representations because a caller can choose the width of its values buffer. The precision now determines that width. Typed constructors report a mismatch, and builders and iterator constructors convert their input at construction. A narrow physical representation uses a Widen over a narrower decimal child.

DecimalBuilder constructors lose their width parameter. The decimal reader still accepts older storage widths, including narrow nodes emitted by the current writer.

@connortsui20 connortsui20 added the changelog/break A breaking API change label Nov 17, 2026
Base automatically changed from ct/dbp-gpu-canonical-width to develop November 17, 2026 20:59
@connortsui20
connortsui20 force-pushed the ct/decimal-canonical-width branch 2 times, most recently from b9342a4 to a0a4cb3 Compare November 17, 2026 21:06
@connortsui20
connortsui20 changed the base branch from develop to ct/unsafe-array-data-mut November 17, 2026 21:07
@connortsui20
connortsui20 force-pushed the ct/decimal-canonical-width branch from a0a4cb3 to 9363839 Compare November 17, 2026 21:07
@connortsui20
connortsui20 marked this pull request as ready for review November 17, 2026 21:22

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change means that this will no longer build 2 versions of each of the decimal fixtures.

@connortsui20
connortsui20 force-pushed the ct/decimal-canonical-width branch from 9363839 to 65d506c Compare November 17, 2026 21:38
@codspeed

codspeed Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚡ 2 improved benchmarks
❌ 1 regressed benchmark
✅ 1972 untouched benchmarks
⏩ 53 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Walltime threshold_avx512[80] 2.1 µs 2.4 µs -11.76%
⚡ CPU Simulation ArrowExportVTable_execute_arrow 202.2 µs 160.1 µs +26.32%
⚡ CPU Simulation decode_u16[(1, 0.0)] 589.6 µs 535.9 µs +10.01%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ct/decimal-canonical-width (a5fe0e8) with develop (3d6c8c2)

Open in CodSpeed

Footnotes

  1. 53 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Base automatically changed from ct/unsafe-array-data-mut to develop November 17, 2026 21:55
@connortsui20
connortsui20 force-pushed the ct/decimal-canonical-width branch from 65d506c to 6101c3f Compare November 17, 2026 21:55
@connortsui20
connortsui20 force-pushed the ct/decimal-canonical-width branch from ac9430c to 87b5498 Compare November 17, 2026 22:38
Comment on lines 38 to 44
let fill = fill
.cast::<T>()
.vortex_expect("fill scalar fits the array's decimal precision");
let mut buffer = array.buffer::<T>().into_mut();
for index in is_invalid.set_indices() {
buffer[index] = fill;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you pull this into a func

@connortsui20
connortsui20 force-pushed the ct/decimal-canonical-width branch 2 times, most recently from 2809bf3 to 6a04391 Compare November 18, 2026 14:51
@connortsui20
connortsui20 enabled stacked auto-merge (squash) November 18, 2026 15:01
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 force-pushed the ct/decimal-canonical-width branch from 6a04391 to a5fe0e8 Compare November 18, 2026 15:02
@connortsui20
connortsui20 merged commit 7ebd1d3 into develop Nov 18, 2026
99 of 103 checks passed
@connortsui20
connortsui20 deleted the ct/decimal-canonical-width branch November 18, 2026 15:48
connortsui20 added a commit that referenced this pull request Nov 18, 2026
The primitive, VarBinView, and decimal `fill_null` kernels each write
one fill value at the set positions of a validity bitmap with their own
loop, and a review on #11571 asked for the decimal loop to move into a
function. The loop does not depend on the element type, so
`BufferMut::fill_where` provides it for any `Copy` element, and the
primitive and VarBinView kernels use it here. The decimal kernel
switches to it after #11571 lands.

`fill_where` fills each run of set bits with one `slice::fill`, which is
the loop the VarBinView kernel already used and `varbinview_fill_null`
measures. The primitive kernel used to write one index at a time, and no
benchmark calls it directly.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/break A breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants