Skip to content

Bounding memory usage in C2H mismatch diagnostics - #12259

Merged
bernhardmgruber merged 1 commit into
NVIDIA:mainfrom
oleksandr-pavlyk:c2h-bounded-mismatch-diagnostics
Oct 27, 2026
Merged

bernhardmgruber merged 1 commit into
NVIDIA:mainfrom
oleksandr-pavlyk:c2h-bounded-mismatch-diagnostics

Conversation

@oleksandr-pavlyk

@oleksandr-pavlyk oleksandr-pavlyk commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Optimization to c2h::detail::compare_host_ranges to reduce memory usage for large mismatches

When comparing two host ranges we used to retain all mismatches only to display first and last 5. We now only keep those mismatches we want to display.

A test added.

Description

This change is a focused change split off from #11374

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

…mismatches

When comparing two host ranges we used to retain all mismatches only
to display first and last 5. We now only keep those mismatches we
want to display.

A test added.
@oleksandr-pavlyk
oleksandr-pavlyk requested review from a team as code owners October 26, 2026 16:07
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Oct 26, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Oct 26, 2026
@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor Author

See @bernhardmgruber question regarding this change: #11374 (comment) and my response: #11374 (comment)

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/cccl
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 46c1018
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 2fb2c110-4ca4-49c7-9cd1-c06b1092a6f9
Commits

Reviewing files that changed from the base of the PR and between 46c1018 and 3a16899.

Files selected for processing: 2
  • c2h/include/c2h/catch2_test_helper.h
  • cub/test/catch2_test_c2h_buffers.cu

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Improvements
    • Range comparison results now include the total number of mismatches and representative mismatches from the beginning and end of the range, alongside up to three matching values immediately before the first mismatch.
  • Tests
    • Added coverage for mismatch counts from zero through sixteen and for mismatches occurring at different positions.

The change updates compare_host_ranges to count mismatches while retaining bounded details, and adds tests for mismatch counts, ordering, and preceding matching values.

Changes: Mismatch summary collection

Layer / File(s) Summary
Collect and validate mismatch details
c2h/include/c2h/catch2_test_helper.h, cub/test/catch2_test_c2h_buffers.cu
compare_host_ranges counts mismatches during comparison, retains the first five and a rolling set of the last five, and orders the retained tail. The test checks mismatch counts from 0 to 16, retained details, and up to three matching values before the first mismatch.

Possibly related PRs

  • NVIDIA/cccl#11374: It changes compare_host_ranges to retain and order the first and last mismatches, and also updates the same test file.

Priority: Low

Change: Refactor

Merge Risk: Minimal · up to 3a168

No actionable merge-blocking issue is identified; the change is mergeable after normal checks.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 7h 38m: Pass: 100%/187 | Total: 7d 22h | Max: 2h 50m | Hits: 39%/636732

See results here.

@bernhardmgruber
bernhardmgruber merged commit a7d665e into NVIDIA:main Oct 27, 2026
423 of 427 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants