Skip to content

cccl-hide-from-abi - #12381

Merged
Jacobfaib merged 5 commits into
NVIDIA:mainfrom
Jacobfaib:jacobf/2026-11-02/cccl-hide-from-abi
Nov 13, 2026
Merged

Jacobfaib merged 5 commits into
NVIDIA:mainfrom
Jacobfaib:jacobf/2026-11-02/cccl-hide-from-abi

Conversation

@Jacobfaib

Copy link
Copy Markdown
Contributor

Description

closes #12340

Checklist

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

@Jacobfaib Jacobfaib self-assigned this Nov 2, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Nov 2, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Nov 2, 2026
@Jacobfaib
Jacobfaib force-pushed the jacobf/2026-11-02/cccl-hide-from-abi branch from 01e5545 to 0f4775b Compare November 2, 2026 19:39
@Jacobfaib

Copy link
Copy Markdown
Contributor Author

/ok to test

@Jacobfaib Jacobfaib changed the title Jacobf/2026 11 02/cccl hide from abi cccl-hide-from-abi Nov 2, 2026
@github-actions

This comment has been minimized.

@Jacobfaib
Jacobfaib force-pushed the jacobf/2026-11-02/cccl-hide-from-abi branch from fb7b245 to 93ecab6 Compare November 3, 2026 14:41
@Jacobfaib

Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.

@Jacobfaib

Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.

@Jacobfaib

Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.

@Jacobfaib

Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.

Comment thread c2h/include/c2h/detail/catch2_seed.h Resolved

@miscco miscco 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.

The libcu++ part and the general direction looks fine to me.

We should IMHO not annotate test functions, because those should be able to discover issues out users have

@github-project-automation github-project-automation Bot moved this from In Progress to In Review in CCCL Nov 5, 2026
@Jacobfaib
Jacobfaib force-pushed the jacobf/2026-11-02/cccl-hide-from-abi branch from 998d24d to 04c91af Compare November 6, 2026 14:12
@Jacobfaib

Copy link
Copy Markdown
Contributor Author

/ok to test

1 similar comment
@Jacobfaib

Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

This comment has been minimized.

@Jacobfaib

Copy link
Copy Markdown
Contributor Author

/ok to test

1 similar comment
@Jacobfaib

This comment was marked as outdated.

@Jacobfaib
Jacobfaib force-pushed the jacobf/2026-11-02/cccl-hide-from-abi branch from 25804d3 to 16fcce3 Compare November 9, 2026 13:17
@github-actions

This comment has been minimized.

@Jacobfaib
Jacobfaib marked this pull request as ready for review November 13, 2026 02:26
@Jacobfaib
Jacobfaib requested review from a team as code owners November 13, 2026 02:26
@Jacobfaib
Jacobfaib force-pushed the jacobf/2026-11-02/cccl-hide-from-abi branch from 3ab64a5 to 6ebfbc5 Compare November 13, 2026 13:04
@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

https://github.com/NVIDIA/cccl/blob/6ebfbc58/thrust/thrust/system/detail/error_category.inl#L274-L284 adds _CCCL_HOST_API to both generic_category() and system_category(). Hidden visibility gives each shared library its own singleton, but category equality compares addresses. These should use _CCCL_PUBLIC_HOST_API. The cuda_category() also needs to be checked.

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

The fix-it here https://github.com/NVIDIA/cccl/blob/6ebfbc58/cmake/clang_tidy_plugins/hide_from_abi/hide_from_abi.cpp#L162 unconditionally inserts _CCCL_HIDE_FROM_ABI which includes inline.

When it processes inline X::X() = default; it becomes _CCCL_HIDE_FROM_ABI inline X::X() = default; and clang errors with -Werror=duplicate-decl-specifier

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

Changes to nvbench_helper/ and cub/benchmarks are fine, but they are not necessary.

Question: Is there reason to include benchmark implementation and nvbench_helper/ in library ABI hygiene checks? Is it just for uniformity of style policy?

@Jacobfaib

Jacobfaib commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

When it processes inline X::X() = default; it becomes _CCCL_HIDE_FROM_ABI inline X::X() = default; and clang errors with -Werror=duplicate-decl-specifier

Yes, this is an unfortunate side effect from Clang explicitly not including storage duration or qualifier (like const or volatile) nodes in the AST. You can match a symbol that is inline (implicitly or explicitly) but you cannot match the literal "inline" word itself. The way to retrieve it is to lexically parse backwards (using clang::Lexer::parseToken()) from the symbol decl to the clang::Token representing it but that is... also not trivial, because you need to know when to stop in order to bound the search.

FWIW we do this lexical search for the other macros, but only if we have a template or requires clause because then we know that the macros/specifiers must be between the end of the template/requires clause and the beginning of the function decl. But for constructors we aren't guaranteed any kind of reasonable stopping point; you cannot, for example assume that the enclosing class decl is your stopping point:

class Foo { <-- class decl
  inline Foo() = default;
         ^
         backward lexical search starts here
};

Because I can define the function out-of-line:

class Foo {
  inline Foo(); // declaration has inline...
};

// potentially hundreds of lines in between

Foo::Foo() = default; // ...which makes this implicitly inline
     ^
     backward lexical search starts here

So... all this is to say, I allowed this particual incorrect substitution because it will already be diagnosed by the regular compiler later on.

@github-actions

This comment has been minimized.

@Jacobfaib

Copy link
Copy Markdown
Contributor Author

Question: Is there reason to include benchmark implementation and nvbench_helper/ in library ABI hygiene checks? Is it just for uniformity of style policy?

Mostly for uniformity, but it can also reduce binary size since it allows the linker to discard unused internal symbols that the compiler might not otherwise be able to remove.

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 4h 14m: Pass: 100%/502 | Total: 20d 02h | Max: 4h 13m | Hits: 27%/3541281

See results here.

@Jacobfaib
Jacobfaib merged commit 89b4901 into NVIDIA:main Nov 13, 2026
526 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Nov 13, 2026
@Jacobfaib
Jacobfaib deleted the jacobf/2026-11-02/cccl-hide-from-abi branch November 13, 2026 22:58
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.

[clang-tidy] Detect ABI visible symbols

5 participants