Skip to content

Fix the potential ADL issue in cugraph::detail::gather/scatter - #5634

Merged
rapids-bot[bot] merged 2 commits into
rapidsai:mainfrom
seunghwak:bug_thrust_adl
Aug 19, 2026
Merged

Fix the potential ADL issue in cugraph::detail::gather/scatter#5634
rapids-bot[bot] merged 2 commits into
rapidsai:mainfrom
seunghwak:bug_thrust_adl

Conversation

@seunghwak

Copy link
Copy Markdown
Contributor

Calling thrust::scatter (or thrust::gather) can recurse until the host stack overflows when argument types pull in cugraph::detail (e.g. transform iterators with the cugraph::detail::shift_left_t functor).

Thrust dispatches via an unqualified scatter/gather call (ADL). That found cugraph::detail::scatter/gather, whose fallback called thrust::scatter/gather again → infinite recursion. The public cugraph::scatter/gather functors already avoided this; the detail scatter (gather) functions reintroduced it.

Rename the detail scatter (gather) functions to scatter_dispatch (gather_dispatch) (and scater|gather_shift_left_dispatch for consistency) so they are no longer ADL targets for Thrust.

@seunghwak
seunghwak requested a review from a team as a code owner August 19, 2026 02:27
@copy-pr-bot

copy-pr-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@seunghwak seunghwak added bug Something isn't working non-breaking Non-breaking change labels Aug 19, 2026
@seunghwak seunghwak self-assigned this Aug 19, 2026
@seunghwak

Copy link
Copy Markdown
Contributor Author

/ok to test f02d761

@seunghwak

Copy link
Copy Markdown
Contributor Author

/ok to test da54138

@ChuckHastings

Copy link
Copy Markdown
Collaborator

/merge

@rapids-bot
rapids-bot Bot merged commit a0d3c3b into rapidsai:main Aug 19, 2026
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants