Skip to content

fix: alignment and padding of sliced CUDA Arrow bitmaps - #9926

Open
0ax1 wants to merge 6 commits into
developfrom
ad/cuda-arrow-bitmap-correctness
Open

0ax1 wants to merge 6 commits into
developfrom
ad/cuda-arrow-bitmap-correctness

Conversation

@0ax1

@0ax1 0ax1 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix CUDA Arrow export of sliced BOOL values and validity bitmaps so their storage is safe for cuDF’s word-based reads.

A valid bitmap slice is not necessarily safe to read as machine words:

  • Alignment: byte slicing can shift an aligned device pointer to an address such as base + 1. cuDF imports bit-packed BOOL values using 32-bit mask-word reads, while Vortex’s validity repack kernel previously required 64-bit-aligned input.
  • Bounds: word reads can extend past the logical bitmap bytes. For example, nine bits occupy two bytes, but a 32-bit load reads four. cuDF consumers can also access a padded mask extent.

Without repair, these slices can cause misaligned or out-of-bounds GPU accesses, despite having correct logical values and offsets. Padding supplied by ordinary uploads can hide the problem.

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
…ation

Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
@0ax1 0ax1 changed the title Ad/cuda arrow bitmap correctness fix: alignment and padding of sliced CUDA Arrow bitmaps Sep 17, 2026
@0ax1 0ax1 added the changelog/fix A bug fix label Sep 17, 2026
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
@0ax1
0ax1 marked this pull request as ready for review September 17, 2026 11:09
@0ax1
0ax1 requested review from joseph-isaacs and myrrc September 17, 2026 11:09
@codspeed

codspeed Bot commented Sep 17, 2026

Copy link
Copy Markdown

Merging this PR will regress 2 benchmarks

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
❌ 2 regressed benchmarks
✅ 2241 untouched benchmarks
⏩ 176 skipped benchmarks1
🗄️ 1 archived benchmark run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime arrow_checked_add_u32_neon[16384] 12.9 µs 20.4 µs -36.75%
Simulation random_i16[0.8] 80.4 µs 98.8 µs -18.64%
Simulation random_i8[0.5] 96.8 µs 73.2 µs +32.23%
Simulation allocate_drop_bytes[0] 635.5 ns 527.2 ns +20.55%
WallTime mul_u32_nonnull_avx512 6.3 µs 5.6 µs +12.54%
WallTime filtered_sink_i64_neon[NineNullsInTen] 19.6 µs 17.6 µs +11.33%

Tip

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


Comparing ad/cuda-arrow-bitmap-correctness (2b76063) with develop (48985d5)

Open in CodSpeed

Footnotes

  1. 176 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.

  2. 1 benchmark was run, but is now archived. If it was deleted in another branch, consider rebasing to remove it from the report. Instead if it was added back, click here to restore it.

@0ax1
0ax1 requested a review from robert3005 September 17, 2026 13:05
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant