Skip to content

Conversation

pmattione-nvidia
Copy link
Contributor

@pmattione-nvidia pmattione-nvidia commented Oct 9, 2025

This fixes a bug in the row number checking that determines whether or not a page needs to be processed. Before, if there are 20k rows per page and we skip 20k rows, page_start_row == max_row and we would still process the page despite there being nothing to do. Ditto with the minimum row check. Although this is a bug, it is effectively just a minor missed optimization opportunity so it didn't cause any tests to fail previously. I've renamed the "max" variables to "end" to make the bug and the code clearer.

Checklist

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

@pmattione-nvidia pmattione-nvidia requested a review from a team as a code owner October 9, 2025 00:56
@pmattione-nvidia pmattione-nvidia self-assigned this Oct 9, 2025
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Oct 9, 2025
@pmattione-nvidia pmattione-nvidia added Performance Performance related issue non-breaking Non-breaking change labels Oct 9, 2025
@pmattione-nvidia pmattione-nvidia added the improvement Improvement / enhancement to an existing function label Oct 9, 2025
Copy link
Member

@mhaseeb123 mhaseeb123 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. LGTM

// if we are totally outside the range of the input, do nothing
if ((page_start_row > max_row) || (page_start_row + s->page.num_rows < min_row)) {
auto const page_end_row = page_start_row + s->page.num_rows;
if ((page_start_row >= end_row) || (page_end_row <= min_row)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only real change: adding = on the comparisons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Performance Performance related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants