Skip to content

GH-50778: [C++] Fix chunked level histogram accumulation - #50780

Open
wecharyu wants to merge 1 commit into
apache:mainfrom
wecharyu:fix_update_level_hist
Open

GH-50778: [C++] Fix chunked level histogram accumulation#50780
wecharyu wants to merge 1 commit into
apache:mainfrom
wecharyu:fix_update_level_hist

Conversation

@wecharyu

@wecharyu wecharyu commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

UpdateLevelHistogram incorrectly accumulated from the beginning of the input on every iteration of its max_level == 1 fast path. Inputs spanning multiple chunks therefore counted the first chunk repeatedly.

Fix #50778.

What changes are included in this PR?

  • Accumulate the current chunk using it rather than levels.begin().
  • Add a UT

Are these changes tested?

Yes, passing the new UT and existing UT.

Are there any user-facing changes?

No.

@wecharyu
wecharyu requested review from pitrou and wgtmac as code owners August 3, 2026 10:26
@github-actions github-actions Bot added the awaiting review Awaiting review label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #50778 has been automatically assigned in GitHub to PR creator.

@wgtmac wgtmac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch! Thanks @wecharyu!

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting committer review Awaiting committer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] UpdateLevelHistogram produces incorrect histograms in fast path

2 participants