Skip to content

Refactor libcudacxx-style skill by moving CCCL wide style guidelines to a specific file - #9405

Merged
NaderAlAwar merged 8 commits into
NVIDIA:mainfrom
NaderAlAwar:coderabbit-fix-bad-comments
Jun 15, 2026
Merged

NaderAlAwar merged 8 commits into
NVIDIA:mainfrom
NaderAlAwar:coderabbit-fix-bad-comments

Conversation

@NaderAlAwar

Copy link
Copy Markdown
Contributor

This PR refactors the libcudacxx-style SKILL.md by moving global CCCL style guidelines to a common file and libcudacxx specific style guidelines to its own file. The goal is to prevent comments from LLM reviewers such as this one #9347 (comment), where it suggested changes in CUB that did not apply

@NaderAlAwar
NaderAlAwar requested a review from a team as a code owner June 11, 2026 13:44
@NaderAlAwar
NaderAlAwar requested a review from jrhemstad June 11, 2026 13:44
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jun 11, 2026
@NaderAlAwar
NaderAlAwar requested a review from fbusato June 11, 2026 13:44
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

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: 2656b203-6dc2-41ab-b7d8-09c50e83903f

📥 Commits

Reviewing files that changed from the base of the PR and between f4f0f74 and 2ad49f7.

📒 Files selected for processing (1)
  • .agent/skills/cccl-style/references/common.md
✅ Files skipped from review due to trivial changes (1)
  • .agent/skills/cccl-style/references/common.md

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 PR refactors the libcudacxx-style agent skill by extracting CCCL-wide style guidance into shared common documentation and moving libcudacxx-specific style guidance into a separate referenced document. The reorganization ensures LLM reviewers apply rules only within the intended CCCL subproject scope.

Changes

New Agent Skills Structure

  • .agent/skills/cccl-style/SKILL.md: Consolidated “cccl-style” workflow directing agents to read shared CCCL style guidance from references/common.md and (when applicable) libcudacxx-specific guidance from references/libcudacxx.md, with explicit scoping rules to prevent cross-subproject guideline misapplication.
  • .agent/skills/cccl-style/references/common.md: Adds shared CCCL-wide style guidance (naming/casing, qualifiers, header hygiene, API/annotation conventions, comment rules, and compiler-compatibility constraints).
  • .agent/skills/cccl-style/references/libcudacxx.md: Adds libcudacxx-specific style guidance for libcudacxx/include/**/* and cudax/include/**/* (identifier naming, header prologue/epilogue conventions, required Doxygen documentation structure, and additional compiler/device constraints).

New Test Skill Structure

  • .agent/skills/cccl-test/SKILL.md: New “cccl-test” skill workflow for authoring/reviewing tests, using shared guidance plus path-scoped references.
  • .agent/skills/cccl-test/references/common.md: Adds shared CCCL test guidance (local test consistency patterns, coverage expectations, required test structure, and recommended validation practices).
  • .agent/skills/cccl-test/references/libcudacxx.md: Removes YAML-style metadata frontmatter from the existing libcudacxx test reference.

Configuration Updates

  • .coderabbit.yaml: Updates review guidance and guideline file patterns so libcudacxx/**/* uses cccl-style/SKILL.md (instead of the old libcudacxx-style skill) and adds cccl-test/SKILL.md for test context; also tightens cudax guidance to avoid style comments unless explicitly mentioned in cccl-style/SKILL.md.
  • AGENTS.md: Adds agent-facing sections pointing to the new “Style Guidance” (.agent/skills/cccl-style/...) and “Test Guidance” (.agent/skills/cccl-test/...) references.

Metadata Updates

  • .claude/skills/cccl-style/SKILL.md and .claude/skills/cccl-test/SKILL.md: Added metadata files pointing to the actual skill content in .agent/.
  • .claude/skills/libcudacxx-style/SKILL.md and .claude/skills/libcudacxx-test/SKILL.md: Removed deprecated metadata (to avoid exposing obsolete skill entries).

Deprecated

  • .agent/skills/libcudacxx-style/SKILL.md: Removed (its content was consolidated into the new cccl-style structure via references/common.md + references/libcudacxx.md).

Impact

By separating CCCL-wide guidelines from libcudacxx-specific rules, agents/LLMs should stop generating incorrect style suggestions for other CCCL components (e.g., preventing guidance meant for one subproject from being applied to another).

Walkthrough

Replace single libcudacxx-style skill with hierarchical cccl-style skill (shared common rules plus libcudacxx-specific reference), add cccl-test skill and references, update CodeRabbit configuration and review instructions, and update agent metadata and AGENTS.md to reference new skills.

Changes

CCCL Style Guidance Reorganization

Layer / File(s) Summary
cccl-style skill and style references
.agent/skills/cccl-style/SKILL.md, .agent/skills/cccl-style/references/common.md, .agent/skills/cccl-style/references/libcudacxx.md, .claude/skills/cccl-style/SKILL.md
Adds cccl-style skill with workflow directing agents to shared common.md rules and libcudacxx.md for path-scoped guidance; includes Claude metadata for the new skill.
cccl-test skill and test references
.agent/skills/cccl-test/SKILL.md, .agent/skills/cccl-test/references/common.md, .agent/skills/cccl-test/references/libcudacxx.md, .claude/skills/cccl-test/SKILL.md
Adds cccl-test skill with workflow and common test guidance; removes top YAML metadata from libcudacxx test reference; includes Claude metadata for the new skill.
CodeRabbit configuration wiring
.coderabbit.yaml
Updates path-based review instructions for libcudacxx and cudax to reference cccl-style and cccl-test skills instead of libcudacxx-style; replaces libcudacxx-style pattern in knowledge_base filePatterns with cccl-style-related patterns.
Agent documentation
AGENTS.md
Adds Style Guidance and Test Guidance subsections directing agents to consult .agent/skills/cccl-style/SKILL.md and .agent/skills/cccl-test/SKILL.md for style and test references applicable to files being edited/reviewed.

Possibly related issues


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5a04d42b-2b09-4367-97c6-5b93ba0e793e

📥 Commits

Reviewing files that changed from the base of the PR and between 4242a79 and 4069b94.

📒 Files selected for processing (6)
  • .agent/skills/cccl-style/SKILL.md
  • .agent/skills/cccl-style/references/common.md
  • .agent/skills/cccl-style/references/libcudacxx.md
  • .agent/skills/libcudacxx-style/SKILL.md
  • .coderabbit.yaml
  • AGENTS.md
💤 Files with no reviewable changes (1)
  • .agent/skills/libcudacxx-style/SKILL.md

@fbusato fbusato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the idea to unify and organize SKILL styles. A couple of comments:

@github-project-automation github-project-automation Bot moved this from In Review to In Progress in CCCL Jun 11, 2026
@NaderAlAwar
NaderAlAwar requested a review from fbusato June 11, 2026 20:56
@copy-pr-bot

copy-pr-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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.

@fbusato fbusato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a few suggestions (if makes sense) to move common rules into common.md

@NaderAlAwar

Copy link
Copy Markdown
Contributor Author

precommit.ci autofix

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: aad766ae-1356-4dc1-9821-e94151ba6358

📥 Commits

Reviewing files that changed from the base of the PR and between 889d954 and e1e3986.

📒 Files selected for processing (2)
  • .agent/skills/cccl-style/references/common.md
  • .agent/skills/cccl-style/references/libcudacxx.md
💤 Files with no reviewable changes (1)
  • .agent/skills/cccl-style/references/libcudacxx.md

@NaderAlAwar

Copy link
Copy Markdown
Contributor Author

pre-commit.ci autofix

@NaderAlAwar
NaderAlAwar requested review from fbusato and miscco June 12, 2026 13:58
@NaderAlAwar

Copy link
Copy Markdown
Contributor Author

/ok to test 64ffdc7

@NaderAlAwar
NaderAlAwar enabled auto-merge (squash) June 12, 2026 18:00

## Function Calls And Types

- In headers, free function calls must be fully qualified from the global namespace, e.g. `::cuda::ceil_div(...)`. This includes calls to functions defined in the same namespace, e.g. inside `cuda::`, call `::cuda::ceil_div(...)`, not `ceil_div(...)`. This does not apply to (static) member functions of classes. The only exceptions to this rule are functions that are supposed to be found through argument-dependent lookup (ADL), such as `::cuda::std::swap` and `::cuda::std::get`. Those functions can be called unqualified with a preceding `using ::cuda::std::get;`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important: This does not apply to Thrust, which relies on ADL in many places. It also only partially applies to CUB, where full qualification is only required for symbols in the ::cuda::* namespace.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ADL is covered by this rule. Also, what do you mean for "partially applies"? function/variable/both?


- In headers, free function calls must be fully qualified from the global namespace, e.g. `::cuda::ceil_div(...)`. This includes calls to functions defined in the same namespace, e.g. inside `cuda::`, call `::cuda::ceil_div(...)`, not `ceil_div(...)`. This does not apply to (static) member functions of classes. The only exceptions to this rule are functions that are supposed to be found through argument-dependent lookup (ADL), such as `::cuda::std::swap` and `::cuda::std::get`. Those functions can be called unqualified with a preceding `using ::cuda::std::get;`.
- This global-qualification rule does not apply to source files such as tests and benchmarks.
- Type names must be fully qualified except when they are already declared in the current namespace or an enclosing one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as above regarding Thrust and CUB.

@NaderAlAwar
NaderAlAwar disabled auto-merge June 12, 2026 21:02
- libcudacxx and cudax require free function calls to be fully qualified from the global namespace, e.g. `::cuda::ceil_div(...)`.
- CUB applies this rule only to calls to symbols under the `::cuda` namespace hierarchy; otherwise follow existing CUB qualification style.
- Thrust uses leading `::` for many symbols under the `::cuda` namespace hierarchy, but relies on ADL in many places and the blanket free-function qualification rule does not apply to those calls.
- For covered calls, this includes calls to functions defined in the same namespace, e.g. inside `cuda::`, call `::cuda::ceil_div(...)`, not `ceil_div(...)`. This does not apply to (static) member functions of classes. The only exceptions for covered calls are functions that are supposed to be found through argument-dependent lookup (ADL), such as `::cuda::std::swap` and `::cuda::std::get`. Those functions can be called unqualified with a preceding `using ::cuda::std::get;`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's actually more complex than this, because Thrust uses ADL also for backend system selection, but this should definitely go to a Thrust skill eventually.

The details are provided here: https://nvidia.github.io/cccl/unstable/thrust/developer/systems.html#algorithm-dispatch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created #9466 to look into the interaction between developer documentation and internal code writing + reviewing skills

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.agent/skills/cccl-style/references/common.md (1)

17-17: 💤 Low value

suggestion: "builtin" should be "built-in" (hyphenated) per modern English style.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2ed2857a-3aa8-4f5f-b02e-1e881f844bac

📥 Commits

Reviewing files that changed from the base of the PR and between e1e3986 and f4f0f74.

📒 Files selected for processing (1)
  • .agent/skills/cccl-style/references/common.md

@NaderAlAwar

Copy link
Copy Markdown
Contributor Author

/ok to test 2ad49f7

@NaderAlAwar
NaderAlAwar merged commit 52baef3 into NVIDIA:main Jun 15, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants