Skip to content

Deprecate AgentMergeSortPolicy and AgentAdjacentDifferencePolicy#9235

Open
bernhardmgruber wants to merge 3 commits into
NVIDIA:mainfrom
bernhardmgruber:depr_agent_policies
Open

Deprecate AgentMergeSortPolicy and AgentAdjacentDifferencePolicy#9235
bernhardmgruber wants to merge 3 commits into
NVIDIA:mainfrom
bernhardmgruber:depr_agent_policies

Conversation

@bernhardmgruber
Copy link
Copy Markdown
Contributor

Left over from #9218 and #8600.

@bernhardmgruber bernhardmgruber requested a review from a team as a code owner June 3, 2026 11:16
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jun 3, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jun 3, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

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: f93b3a34-e384-4f14-b1e6-adbb88cc9dca

📥 Commits

Reviewing files that changed from the base of the PR and between d2286ed and 24aaaa2.

📒 Files selected for processing (2)
  • cub/cub/agent/agent_adjacent_difference.cuh
  • cub/cub/device/dispatch/tuning/tuning_merge_sort.cuh

Note: CodeRabbit is enabled on this repository as a convenience for maintainers
and contributors. Use your best judgment when considering its review comments and
suggestions — a suggested change may be inadequate, unnecessary, or safe to ignore.
Contributors are not expected to address every comment. Human reviews are what
ultimately matter for merging.

Overview

This pull request deprecates AgentMergeSortPolicy and AgentAdjacentDifferencePolicy by moving their implementations into internal detail:: agent policy structs and exposing the original names as deprecated aliases. The change completes cleanup left over from PRs #9218 and #8600 and preserves behavior while steering users toward the tuning API.

Changes

Adjacent Difference Policy

  • cub/cub/agent/agent_adjacent_difference.cuh

    • Added internal detail::agent_adjacent_difference_policy template (encapsulates block/tiling and load/store algorithm constants).
    • Replaced the former struct definition of AgentAdjacentDifferencePolicy with a deprecated using alias to detail::agent_adjacent_difference_policy (keeps CCCL_DEPRECATED_BECAUSE("Use the tuning API for DeviceAdjacentDifference")).
  • cub/cub/device/dispatch/dispatch_adjacent_difference.cuh

    • Device kernel now instantiates the internal agent_adjacent_difference_policy instead of AgentAdjacentDifferencePolicy. No control flow or kernel logic changes.
  • cub/cub/device/dispatch/tuning/tuning_adjacent_difference.cuh

    • Tuning policy_hub::Policy500 now references detail::agent_adjacent_difference_policy (same template arguments preserved).

Merge Sort Policy

  • cub/cub/device/dispatch/tuning/tuning_merge_sort.cuh
    • Introduced detail::agent_merge_sort_policy template and replaced direct implementation use with it.
    • Exposed AgentMergeSortPolicy as a deprecated using alias to detail::agent_merge_sort_policy with CCCL_DEPRECATED_BECAUSE("Use the tuning API for DeviceMergeSort").
    • Updated tuning policy hub specializations (Policy500, Policy520/Policy600) to instantiate the internal agent_merge_sort_policy while preserving existing template arguments and NVHPC conditional behavior.

API / ABI impact

  • Public names AgentAdjacentDifferencePolicy and AgentMergeSortPolicy remain available but now are deprecated aliases to internal detail:: types; no signature changes to exported functions or kernels.
  • Deprecation attributes are preserved on the public aliases to guide users to the tuning API.

Review notes

  • Changes are refactor-only for policy indirection; behavioral and functional code paths are unchanged.
  • Suggested reviewers should pay attention to the deprecated alias attributes and any references elsewhere in the codebase to ensure consistency when fully removing these aliases in the future.

suggestion:

Walkthrough

Refactors adjacent-difference and merge-sort agent policies by introducing internal detail::agent_*_policy structs and replacing the former public policy structs with deprecated using aliases; dispatch and tuning code now instantiate the internal policy types directly.

Changes

Policy Type Abstraction Refactoring

Layer / File(s) Summary
Adjacent-difference policy abstraction
cub/cub/agent/agent_adjacent_difference.cuh, cub/cub/device/dispatch/dispatch_adjacent_difference.cuh, cub/cub/device/dispatch/tuning/tuning_adjacent_difference.cuh
Defines detail::agent_adjacent_difference_policy, replaces public AgentAdjacentDifferencePolicy with a deprecated alias, and updates dispatch and tuning aliases to instantiate the internal policy type.
Merge-sort policy abstraction
cub/cub/device/dispatch/tuning/tuning_merge_sort.cuh
Adds detail::agent_merge_sort_policy, exposes AgentMergeSortPolicy as a deprecated alias to the internal type, and updates Policy500/Policy520/Policy600 tuning aliases to instantiate the internal policy type.

Possibly related PRs

  • NVIDIA/cccl#9218: Related adjacent-difference dispatch/tuning policy changes that interact with the refactored AgentAdjacentDifferencePolicy type.

Suggested reviewers

  • shwina
  • srinivasyadav18
  • NaderAlAwar

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🥳 CI Workflow Results

🟩 Finished in 2h 17m: Pass: 100%/284 | Total: 11d 05h | Max: 2h 17m | Hits: 20%/938455

See results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant