Skip to content

Fix memcheck error in json checked-token-level utility - #22571

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:release/26.06from
davidwendt:json-check-token-level
May 19, 2026
Merged

Fix memcheck error in json checked-token-level utility#22571
rapids-bot[bot] merged 1 commit into
NVIDIA:release/26.06from
davidwendt:json-check-token-level

Conversation

@davidwendt

Copy link
Copy Markdown
Contributor

Description

Fixes a memcheck error introduced by #22452 where an atomic operation on a bool variable is reported by compute-sanitizer as an out-of-bounds access. Changing the variable to an int32_t resolves the error.

Closes #22570

Checklist

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

@davidwendt davidwendt self-assigned this May 19, 2026
@davidwendt
davidwendt requested a review from a team as a code owner May 19, 2026 10:45
@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team labels May 19, 2026
@davidwendt davidwendt added libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels May 19, 2026
@coderabbitai

coderabbitai Bot commented May 19, 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: 456f9e28-a9bd-41fa-9b58-8519a04733a2

📥 Commits

Reviewing files that changed from the base of the PR and between 65f8363 and a4bce2e.

📒 Files selected for processing (1)
  • cpp/src/io/json/json_tree.cu

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Optimized out-of-range depth detection mechanism in JSON token tree construction for improved performance and stability when processing nested JSON structures.

Walkthrough

The PR fixes a memcheck error in the JSON tree construction kernel by changing the out-of-range depth detection flag from bool to int32_t. The kernel functor parameter and its corresponding device scalar allocation are updated to use the larger type, satisfying atomic operation alignment requirements.

Changes

Out-of-range depth flag type alignment

Layer / File(s) Summary
Atomic operation type alignment in depth out-of-range detection
cpp/src/io/json/json_tree.cu
The checked_token_level_output functor parameter type for depth_out_of_range changed from bool* to int32_t* (lines 133–140), and the corresponding device_scalar allocation in get_tree_representation changed from device_scalar<bool> to device_scalar<int32_t> (line 305) to satisfy atomic operation alignment requirements in the kernel.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • rapidsai/cudf#22452: Both PRs modify the JSON tree nesting-depth out-of-range detection path; this PR fixes a memcheck error in the atomic flag logic introduced by that earlier change.

Suggested labels

tests

Suggested reviewers

  • devavret
  • vyasr
  • pmattione-nvidia
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix memcheck error in json checked-token-level utility' directly describes the main change: fixing a memcheck error in the JSON utility.
Description check ✅ Passed The description clearly explains the memcheck error, its cause (atomic operation on bool), and the solution (changing to int32_t), directly relating to the changeset.
Linked Issues check ✅ Passed The PR successfully addresses issue #22570 by replacing the bool device flag with int32_t in checked_token_level_output, resolving the atomic operation memcheck error as required.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the memcheck error by modifying type declarations in json_tree.cu from bool to int32_t, with no unrelated or out-of-scope modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@davidwendt
davidwendt requested a review from karthikeyann May 19, 2026 10:49
@davidwendt

Copy link
Copy Markdown
Contributor Author

I like Coderabbit's description better than mine.

@davidwendt

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 2dba3ec into NVIDIA:release/26.06 May 19, 2026
119 checks passed
@davidwendt
davidwendt deleted the json-check-token-level branch May 19, 2026 14:46
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 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