Skip to content

Fix uninitialized page info for column chunks without a dictionary page - #23579

Merged
rapids-bot[bot] merged 3 commits into
NVIDIA:mainfrom
mhaseeb123:fix/pq-dict-filter-pruning
Aug 10, 2026
Merged

Fix uninitialized page info for column chunks without a dictionary page#23579
rapids-bot[bot] merged 3 commits into
NVIDIA:mainfrom
mhaseeb123:fix/pq-dict-filter-pruning

Conversation

@mhaseeb123

@mhaseeb123 mhaseeb123 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

This PR zero-initializes page info buffers in dictionary page row group filtering to ensure empty buffers (no pages) are reliably discarded by the decoder instead of reading uninitialized data.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Aug 7, 2026
@mhaseeb123
mhaseeb123 marked this pull request as ready for review August 7, 2026 17:05
@mhaseeb123
mhaseeb123 requested a review from a team as a code owner August 7, 2026 17:05
@mhaseeb123 mhaseeb123 added bug Something isn't working 3 - Ready for Review Ready for review by team cuIO cuIO issue non-breaking Non-breaking change labels Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5c1e04a8-ff41-41f5-8786-091290f2483f

📥 Commits

Reviewing files that changed from the base of the PR and between 72a9031 and acd3772.

📒 Files selected for processing (1)
  • cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved dictionary-based row-group filtering for files mixing dictionary-encoded and plain-encoded data.
    • Corrected handling of empty dictionary-page ranges.
    • Improved equality and inequality filtering across uncompressed and ZSTD-compressed files.
    • Improved page ordering and dictionary-page decoding reliability.
  • Documentation

    • Clarified how dictionary-page data corresponds to byte ranges and row groups.

Walkthrough

The PR documents dictionary page span ordering, decodes dictionary page headers from supplied data, updates preprocessing allocation and page sorting, and adds filtering tests for mixed dictionary and plain encoding.

Changes

Dictionary page decoding and filtering

Layer / File(s) Summary
Dictionary span contract and decoding
cpp/include/cudf/io/experimental/hybrid_scan*.hpp, cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu
The documentation defines dictionary span ordering and empty spans. Dictionary page headers are decoded from device-resident page data.
Preprocessing allocation and wiring
cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu, cpp/src/io/parquet/reader_impl_preprocess_utils.cu
Dictionary page metadata uses zero-initialized asynchronous allocation. The preprocessing path passes dictionary spans to the decoder. Page sorting uses thrust::gather.
Dictionary filtering validation
cpp/tests/io/experimental/hybrid_scan_filters_test.cpp
Parameterized tests cover empty dictionary ranges and equality and inequality filters across plain and dictionary encoding with NONE and ZSTD compression.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: pointkernel, pmattione-nvidia, shrshi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary fix for uninitialized page information in column chunks without dictionary pages.
Description check ✅ Passed The description accurately explains the zero-initialization change and references related tests and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
cpp/tests/io/experimental/hybrid_scan_filters_test.cpp (1)

1812-1813: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Use a non-default CUDA stream.

Create a test-owned stream and pass its view to the dictionary filtering path. Default-stream ordering can hide missing stream dependencies.

As per coding guidelines, “Avoid unnecessary host-device synchronization, default-stream use, and cudaDeviceSynchronize().”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/tests/io/experimental/hybrid_scan_filters_test.cpp` around lines 1812 -
1813, Update the test around the dictionary filtering path to create an owned
non-default CUDA stream, then pass that stream’s view through the relevant
filtering calls instead of using cudf::get_default_stream(). Keep the existing
device resource selection unchanged and ensure all operations under test use the
test-owned stream.

Source: Coding guidelines

cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu (1)

83-92: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Declare the device-lambda return type.

Add -> void to the lambda at Line 87. The lambda is passed to a Thrust device algorithm and must have an explicit return type.

Proposed update
-    [chunks = chunks.device_begin(), pages = pages.device_begin()] __device__(auto chunk_idx) {
+    [chunks = chunks.device_begin(), pages = pages.device_begin()] __device__(auto chunk_idx) -> void {

As per coding guidelines, “Declare explicit return types for extended device lambdas passed to device algorithms.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu` around lines 83 -
92, Update the device lambda passed to thrust::for_each in the hybrid scan
preprocessing code to explicitly declare a void return type. Preserve the
existing page flag check and dictionary-page assignment.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/include/cudf/io/experimental/hybrid_scan.hpp`:
- Around line 409-410: Update the documentation for secondary filter byte ranges
near secondary_filters_byte_ranges() to identify dictionary_page_data as
matching the second element of the returned vector, after bloom-filter ranges.
Clarify that spans must be aligned with dictionary-page ranges rather than the
bloom-filter ranges.

In `@cpp/tests/io/experimental/hybrid_scan_filters_test.cpp`:
- Around line 1776-1895: Expand DictionaryFilterGapTest to cover empty input,
nullable strings, sliced columns, and non-ASCII UTF-8 values while retaining the
existing multi-block dictionary/plain row-group scenario. Add these cases
through the test’s input construction and assertions so dictionary filtering
behavior remains validated for each required string edge case.

---

Nitpick comments:
In `@cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu`:
- Around line 83-92: Update the device lambda passed to thrust::for_each in the
hybrid scan preprocessing code to explicitly declare a void return type.
Preserve the existing page flag check and dictionary-page assignment.

In `@cpp/tests/io/experimental/hybrid_scan_filters_test.cpp`:
- Around line 1812-1813: Update the test around the dictionary filtering path to
create an owned non-default CUDA stream, then pass that stream’s view through
the relevant filtering calls instead of using cudf::get_default_stream(). Keep
the existing device resource selection unchanged and ensure all operations under
test use the test-owned stream.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0b166863-c2f4-4693-bc42-ea2e3d16ab6a

📥 Commits

Reviewing files that changed from the base of the PR and between 8bf8473 and 72a9031.

📒 Files selected for processing (5)
  • cpp/include/cudf/io/experimental/hybrid_scan.hpp
  • cpp/include/cudf/io/experimental/hybrid_scan_multifile.hpp
  • cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu
  • cpp/src/io/parquet/reader_impl_preprocess_utils.cu
  • cpp/tests/io/experimental/hybrid_scan_filters_test.cpp

Comment thread cpp/include/cudf/io/experimental/hybrid_scan.hpp
Comment thread cpp/tests/io/experimental/hybrid_scan_filters_test.cpp
@pmattione-nvidia

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit f961c78 into NVIDIA:main Aug 10, 2026
140 checks passed
@mhaseeb123
mhaseeb123 deleted the fix/pq-dict-filter-pruning branch August 18, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team bug Something isn't working cuIO cuIO issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants