CCCL Review Checks#

Checks that should be performed when reviewing changes to CCCL. Some of them are distilled from past regressions. Each guideline states what a human or AI reviewer should flag in a diff.

Format#

Each guideline is a section of the form:

## <area>.<slug> (<severity>, <scope>)

<!-- provenance (optional):
  #<introducing PR>→#<fixing PR> <short note>;
  review feedback on #<PR> (<link>) <short note>;
  <third-party source> (<link>) <short note>;
  ...
-->

<3–8 lines of imperative guidance: what to flag in a diff, and under which conditions it is acceptable>
  • <area>.<slug> — stable rule id; area is one of build, correctness, perf, api, abi, test, infra, docs. New areas and slugs can be added as needed.

  • <severity> — critical (must be addressed), important (not addressing requires a justification), or suggestion (worth considering, no action required).

  • <scope> — which files/diffs the rule applies to.

  • The provenance comment is optional and lists where the rule comes from: a historical regression (introducing PR → fixing PR), review feedback that prevented a defect from shipping (link to the review comment), or a third-party source the rule was adapted from (name + link). It is metadata for maintainers, not part of the rule. Omit the comment entirely for a rule that was not derived from such a case.

  • Rules are grouped by area, in the order build, correctness, api, abi, perf, test, infra, docs.

build.compiler-matrix (important, all C++ code)#

Flag compiler-specific constructs unless guarded by a feature macro: __int128, GNU inline asm, __attribute__, VLAs, visibility attributes, one-compiler warning suppressions, etc. CCCL must build with GCC, Clang, MSVC, NVHPC/NVC++ (incl. -stdpar), and NVRTC; PR CI does not cover all of these, so green CI is not sufficient. Compiler-detection refactors must stay equivalent for every supported compiler — beware masquerading (Clang and NVHPC define __GNUC__). Benchmarks and tests count too.

build.fp16-implicit-ops (important, C++ code using __half/__nv_bfloat16 or similar extended FP types)#

Flag any use of the vendor-provided conversions or operators on CUDA extended floating-point types (__half, __half2, __nv_bfloat16, __nv_bfloat162): static_cast<__half>(f), static_cast<float>(h), arithmetic/comparison operators (h1 + h2, h1 < h2), and compound assignments. The vendor headers compile these out when a user defines __CUDA_NO_HALF_CONVERSIONS__/__CUDA_NO_HALF_OPERATORS__ (or the HALF2/BFLOAT16/BFLOAT162 equivalents), so such code silently fails to build for those configurations. Use the explicit intrinsics instead (__float2half/__half2float, __hadd/__hgt, …). __nv_bfloat16 arithmetic/comparison intrinsics require SM80 while CCCL supports sm75+: gate them with NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, …) and a float round-trip fallback via the explicit conversion intrinsics (__bfloat162float/__float2bfloat16_rn; for __nv_bfloat162, __bfloat1622float2/__float22bfloat162_rn). Candidate for a pre-commit grep.

build.narrow-arithmetic-then-widen (important, C++/CUDA code computing a size/count/capacity/offset, including test files)#

When a diff computes a size, count, capacity, or offset by adding or multiplying two operands and widening the RESULT afterward — explicitly with a cast or implicitly through a wider destination type, a wider function parameter, or return type — flag it as a code smell: the operation executes in the narrower type and can silently overflow before the result is widened. The author should either widen an operand before the operation or, if the narrow result is intended, narrow the destination type so no widening occurs.

build.unsigned-negative-check (important, templated C++/CUDA code, including tests)#

When a diff compares a value whose type is or depends on a template parameter against zero for negativity (n < 0, n >= 0, !(n < 0)), flag it unless the comparison is unreachable for unsigned types. CI only instantiates some types, but users instantiate with unsigned ones, where GCC (-Wtype-limits), MSVC (C4296), and NVCC (“pointless comparison of unsigned integer with zero”) warn, which breaks -Werror builds. Guard it with if constexpr (::cuda::std::is_signed_v<T>) { ... n < 0 ... }, or, where a statement is needed, ::cuda::std::is_unsigned_v<T> ? false : (n < 0).

correctness.pdl-restrict-aliasing (critical, CUDA kernels that call _CCCL_PDL_GRID_DEPENDENCY_SYNC() / cudaGridDependencySynchronize())#

Flag a kernel parameter marked both const and _CCCL_RESTRICT (or raw __restrict/__restrict__) whose pointee is read after a _CCCL_PDL_GRID_DEPENDENCY_SYNC()/cudaGridDependencySynchronize() call, when that memory is written by the preceding kernel. const + restrict together assert the memory is read-only and uniquely accessed through this pointer, licensing the compiler to reorder the load ahead of the sync. Acceptable only if a comment at the parameter explains why the memory can never be concurrently aliased (e.g. no producer kernel writes it).

correctness.pdl-cc-gate (important, CUB dispatch code in cub/device/dispatch/*.cuh and launcher factories launching kernels with programmatic dependent launch)#

When a kernel is launched with PDL enabled (either directly or via a launcher factory like TripleChevronFactory or CudaDriverLauncherFactory), flag any argument for dependent_launch/use_pdl that does not consider the current device’s compute capability queried via cub::detail::ptx_compute_cap. PDL may only be enabled if cc >= ::cuda::compute_capability{9, 0} (see dispatch_find.cuh).

correctness.pdl-sync (critical, kernels launched with programmatic dependent launch)#

When a diff enables programmatic dependent launch for a kernel by setting dependent_launch to true at the kernel launcher, flag any global-memory access in the kernel’s body that happens before a call to _CCCL_PDL_GRID_DEPENDENCY_SYNC by that thread — the previous kernel’s writes may not be visible yet — unless the access has a comment explaining why a PDL sync can come later.

correctness.divergent-collective (critical, CUDA device code adding, moving, or newly guarding block/warp collectives, barriers, or early exits)#

When a diff places __syncthreads(), __syncwarp(...), or a CUB block/warp collective (any cub::Block*/Warp* member call — these synchronize internally) under thread-dependent control flow, or adds a thread-dependent early exit (if (...) return;, break, continue) upstream of an existing one, flag it: threads that skip a barrier other threads reach deadlock the block or corrupt the collective’s shared state. Tests where all threads take the same path never exercise the divergent case, so this ships silently. Acceptable only if the governing condition is uniform across the operation’s scope: block-uniform for __syncthreads() and cub::Block* collectives (computed identically in every thread from blockIdx/blockDim/kernel arguments), or uniform across the participating lanes for __syncwarp(mask) and cub::Warp* collectives (a warp-dependent but lane-uniform guard like if (warp_id == 0) is fine when every lane named in the mask reaches the call); verify the uniformity from the surrounding code rather than taking a guard’s presence on faith.

api.internal-symbol-exposure (important, new implementation-detail types/functions)#

Flag any entity added to a public namespace which can be recognized as intended to be internal by its spelling (e.g. snake_case in CUB, or prefixed with __ in libcu++/cudax) or usage pattern (e.g. used as utility for other functions, not documented, etc.). The entity should be marked internal as appropriate.

api.no-new-cub-runtime-function (important, new or changed code in CUB, Thrust, tests, benchmarks, and examples)#

When a diff adds a new entry point (a function that did not exist before) annotated with CUB_RUNTIME_FUNCTION, flag it and use _CCCL_API instead. Existing functions keeping the annotation are fine, including when they are moved, renamed, copied, or split without changing their role. Candidate for a pre-commit grep.

abi.missing-hide-from-abi (critical, inline functions in public headers whose behavior depends on the build configuration)#

Flag an inline function in a public header whose result can differ between two copies of CCCL linked into one binary (e.g., built against different CUDA toolkits or CCCL versions) — especially functions returning kernel or function pointers — unless it is marked _CCCL_HIDE_FROM_ABI (or an attribute macro that includes it, like _CCCL_HOST_API). With default visibility the linker keeps ONE definition across all copies, so the losing copy’s callers get the other build’s result (e.g. a wrong kernel pointer) — no build error, just wrong behavior at run time.

correctness.cuda-driver-symbol-version-guard (critical, code calling CUDA Driver API symbols)#

When a diff gates a call to a CUDA Driver API symbol introduced in a specific CUDA version behind a build-time-only check (_CCCL_CTK_AT_LEAST(...)), flag it: libcuda.so/nvcuda.dll comes from the installed display driver, which is independent of — and often older than — the CTK the binary was built against, so the symbol can be absent at run time regardless of any build-time guard. Resolve driver entry points through the versioned cuGetProcAddress bootstrap in cuda/__driver/driver_api.h (which reports availability), or verify cudaDriverGetVersion before the call. PR CI builds and runs with matched driver/CTK, so this only reproduces in the field.

infra.pin-deps (important, CMake/CI/submodules)#

Flag dependencies fetched by branch name (CPMAddPackage("gh:org/repo#main"), GIT_TAG main); pin a commit or tag. Candidate for a pre-commit grep.

correctness.stale-refs-after-rename (important, renames, moves, or splits of files, symbols, or modules anywhere in the repo)#

When a diff renames, moves, or splits a file, macro, symbol, or module, git grep for the old name: each remaining hit must be updated, or be classified as an unrelated entity that merely shares the name. Doc directives (automodule::/toctree::) can go stale without containing the old name and still build cleanly (autodoc renders emptied packages as blank pages) — verify the rendered docs, not just the grep.

correctness.workaround-breaks-constexpr (important, constexpr-marked)#

When a diff introduces any workaround inside a constexpr function, verify the function is still usable during constant evaluation on every supported compiler, not merely that it compiles as a runtime call. The break only surfaces when a caller uses the function during constant evaluation, which the unit tests may not exercise. Adding a test that evaluates the function at compile time is recommended.

perf.partial-pdl (important, kernels launched with programmatic dependent launch)#

When a diff enables programmatic dependent launch for a kernel by setting dependent_launch to true at the kernel launcher, open the full dispatch function (or equivalent) and enumerate EVERY kernel launch it makes. All kernels should be launched using PDL, otherwise the performance gain is marginal. Replacing calls to cudaMemset by kernels launched using PDL should be strongly considered and pointed out as suggestions.

api.type-replacement (critical, public types in thrust/libcudacxx/cub)#

When a diff reimplements, re-derives, or aliases any public type (thrust::pair/tuple/complex, iterators, …), verify every observable property of the old type is preserved: trivial copyability and layout (downstream code memcpys them), size/alignment, implicit conversions and promotions, overload resolution, and numerical behavior.

build.windows-min-max-macro (important, C++ code calling .max()/.min() or naming a new member/trait max/min)#

Flag an unparenthesized call to a function literally named max/min (e.g. std::numeric_limits<T>::max()), and any new member or trait named max/min. On Windows, <windows.h> defines max/min as function-like macros, breaking such code. Headers sandwiched between <cuda/std/__cccl/prologue.h>/epilogue.h (libcudacxx, cudax) are safe; everywhere else (CUB, Thrust, tests, examples), require the macro-safe spelling (std::numeric_limits<T>::max)() and prefer other member names. Candidate for a pre-commit grep.

perf.benchmark-exec-tag-sync-without-sync-call (important, nvbench benchmark harness state.exec(...) calls)#

When a diff makes an nvbench state.exec(...) call use nvbench::exec_tag::sync (which tells nvbench that the benchmark region will perform CUDA synchronization itself), or changes the lambda body of a call already using such a tag, verify the lambda actually performs any explicit CUDA synchronization (like launch.get_stream().sync(), cudaStreamSynchronize). Parallel algorithms in Thrust and cuda::std:: synchronize internally, except under thrust::cuda::par_nosync. Without a sync, the measured time silently excludes some or all of the kernel’s execution. If the lambda does not sync, exec_tag::no_batch or exec_tag::timer is likely what was intended.

api.narrowed-constraints-on-reimplementation (important, refactors/reimplementations of existing public APIs)#

When a diff reimplements or reroutes an existing public API (port to a different backend, dispatch-layer swap, internal rewrite), flag newly added static_assert/enable_if/concept/trait constraints that reject inputs the previous implementation accepted (e.g. requiring identical value_type across two input ranges where differing types previously worked). Rejecting previously accepted code is a breaking change for downstream users; narrowing is only acceptable as a bug or conformance fix (the previously accepted inputs produced wrong results or violated the documented contract), and must be called out in the PR description.

correctness.raii-move-no-disarm (critical, RAII/resource-owning/scope-guard types with move construction)#

When a diff adds or defaults a move constructor for a type whose destructor conditionally runs an action or releases a resource (an “active”/”engaged”/”owns” flag, a handle nulled on release), verify the move disarms the moved-from source — resets its flag or nulls its handle, not merely copies it. = default is a red flag: it member-wise copies the flag, so both objects fire the cleanup on destruction. Require a test that moves the object and confirms the action fires exactly once and that the moved-from object has been disarmed.

correctness.verification-removed-without-replacement (important, any diff deleting a check or test)#

When a diff deletes a check verifying a property, but does not delete the checked entity, like a static_assert cross-checking a new computation against an old one (tells: “sanity check” comments, old_* names), a negative or compile-fail test (*_fail*, *_static_assert*, UNSUPPORTED/XFAIL markers), a runtime assertion, then do not accept the deletion of the check, unless the diff shows the property now holds by construction or adds a replacement check verifying the same property.

correctness.temp-storage-raw-alignment (critical, CUB/Thrust device-dispatch code allocating or indexing into d_temp_storage)#

Flag any manual handling of the caller-supplied d_temp_storage in a dispatch: pointer arithmetic, hand-computed offsets or alignment, or passing the raw pointer into a kernel argument. Only two forms are allowed: (1) algorithms needing no temporary storage set temp_storage_bytes to 1 and never touch the pointer; (2) algorithms needing one or more allocations must carve them out via detail::alias_temporaries or detail::temporary_storage::layout, which alone are allowed to round the base pointer up and report the required size.

correctness.noexcept (critical, new or changed async/fallible public member functions)#

No exception may escape a noexcept function on any code path — an escaping exception calls std::terminate, turning a recoverable error into a process crash, and it compiles cleanly with no warning. Pay attention to throwing reached through helpers: _CCCL_TRY_CUDA_API, _CCCL_THROW, or callees documented @throws.

correctness.header-kernel-weak-linkage (critical, __global__ kernels defined in headers)#

Flag a __global__ function with an unused template parameter (template <int = 0>), or marked inline — typically done to dodge a “multiple definition” linker error for a kernel defined in a header. The linker collapses the weak host stubs to one, but each translation unit registers its own fatbin, so a launch can resolve to a stub whose kernel was registered by a different TU and fail at runtime. Hidden visibility (_CCCL_KERNEL_ATTRIBUTES) does not prevent this. Give the kernel internal linkage instead: static or an unnamed namespace.

build.no-long (important, C++/CUDA code, including tests)#

Flag any use of long/unsigned long as a chosen type. long is 64-bit on LP64 Linux/macOS but 32-bit on LLP64 Windows (MSVC, clang-cl), so code assuming either width builds and passes on one platform and silently truncates or fails on the other. Use a type that says what is meant: int32_t/uint32_t or int64_t/uint64_t for exact widths, size_t for object sizes, ptrdiff_t for pointer differences. Acceptable: long as a supported type for traits, overload sets, type-list tests enumerating fundamental types, and external API signatures that use it. Candidate for a pre-commit grep.

correctness.ptx-asm-operand-index (critical, hand-written/generated inline PTX asm volatile blocks)#

When a diff adds or edits an inline asm volatile("..." : outputs : inputs : clobbers) block referencing operands by number (%0, %1, …), manually verify each %N against its declared position (outputs first, then inputs, in constraint-list order) — the compiler only checks that %N is in range, not that it refers to the intended operand. Watch for reads of output-only ("=") operands and off-by-one indices after a reorder. Tests should read back the written values, not just a status.

api.alias-template-ctad-gap (important, public type aliases wrapping a class template that supports CTAD)#

When a diff introduces a type as an alias template, users cannot construct it via CTAD in C++17. This is usually fine, unless the alias replaced a public entity that previously supported CTAD, in which case the change breaks CTAD. Flag the alias template and require a test for CTAD to be added.

correctness.offset-type-narrowing (important, CUB/Thrust device-algorithm dispatches and kernels templated on an offset type)#

When a dispatch or kernel is templated on an offset type instead of using a fixed-width integral type, the entire implementation behind it must support both 32-bit and 64-bit offsets. Flag any unguarded conversion of an offset to a narrower type: static_cast<int>(num_items), int-typed loop counters, or grid-size arithmetic fed from OffsetT. Such code compiles and passes small tests but silently misbehaves beyond 2^31 elements. A public API accepting a templated offset type must normalize it via cub::detail::choose_offset_t immediately and pass the adjusted type to the dispatch and kernels, and a unit test with a problem size larger than 2^32 is required. Not affected: implementations that accept a generic offset type at the device-layer API but dispatch with a fixed 64-bit offset (e.g. lookahead scan, transform).

api.generic-param-replaces-concrete-type (important, public CUB/Thrust API overloads accepting a stream/config parameter)#

When a diff replaces a concrete parameter type (e.g. cudaStream_t stream) with a generic templated parameter (e.g. Env env), consider all possible call-site conventions the old parameter supported: arguments could have been only implicitly convertible to the old type (e.g., a user stream wrapper with operator cudaStream_t()), or non-copyable. A by-value template parameter binds to the argument’s own deduced type, not a potentially converted type from the old argument, so a non-copyable stream-like lvalue that used to convert-then-copy now fails to compile. Either require an explicit non-template overload taking the old type and constraining the generic overload, or turn the template parameter into a const reference (e.g. const Env& env).

correctness.element-index-to-byte-offset (important, CUDA kernels and dispatch code computing byte offsets from element indices)#

When an in-bounds element index or count stored in a 32-bit type is converted into a byte offset — multiplied by sizeof(T), used for pointer alignment, or applied to a char*/std::byte* cast of a typed pointer — flag arithmetic performed in the 32-bit type: the element index may fit 32 bits while the byte offset does not, so the multiplication must be widened to 64 bits first (e.g. offset * size_t{sizeof(T)}).

perf.jit-cache-key-vs-codegen-inputs (important, cuda.compute build-result caching)#

When a diff constructs or changes the cache key of a memoized build result (factories decorated with @cache_with_registered_key_functions, the shared cache_build_results cache), require the key to consist of exactly the inputs that affect the generated code: dtypes, iterator kinds, operator identity, compile-regime flags. Flag runtime kernel arguments in the key — scalar bounds, exact element counts — since every distinct runtime value then triggers a full recompile, silently destroying cache hit rates; canonicalize them into their compile-relevant form first (dtype, 32/64-bit-offset flag). Scalars captured by a JIT-compiled operator are deliberately keyed by value. Conversely, flag a key that omits a compile-affecting input, which causes wrong-kernel reuse.

test.sibling-config-drift (important, CMake test configuration)#

CCCL configures near-identical test targets from sibling CMake files, both within a project (the libcudacxx header-test trio libcudacxx/cmake/Libcudacxx*HeaderTesting.cmake) and across projects (ThrustHeaderTesting.cmake, CubHeaderTesting.cmake, cudaxHeaderTesting.cmake). When a diff adds a compile definition, flag, or gating macro to one such file, check every sibling defining a structurally similar target for the same addition — adding it to only one silently skips the check for the others. Siblings are recognizable by near-identical file names and structure.

test.nvrtc-coverage (important, new public device-side interfaces in cub/cub/{block,warp,thread,iterator}/)#

When a diff adds a public CUB device-side interface — a header under cub/cub/{block,warp,thread,iterator}/, a new block/warp/thread primitive in an existing header, a new public member of an existing primitive, or a new algorithm/backend of one (e.g. a BlockReduceAlgorithm enumerator, even if implemented under specializations/) — flag it unless cub/test/catch2_test_nvrtc.cu is updated to include the header and instantiate and call the new interface in the test kernel (templates are only checked when instantiated). CUB’s header and unit tests are never compiled with NVRTC, so constructs NVRTC rejects pass CI and break NVRTC users. Internal headers reachable only via internal code (agent/, device/dispatch/) are exempt.

perf.intrinsic-wrapper-codegen-parity (important, new generic wrappers over device intrinsics in libcudacxx/cub)#

When a diff introduces a generic (any-type) wrapper over a hardware intrinsic (warp shuffle/vote/match, atomics), its generated code must be observable somewhere: either a codegen test comparing it against the raw intrinsic for common types (e.g. a FileCheck test asserting the expected instruction and no local-memory traffic, like the existing atomics/simd codegen tests), or the wrapper is used in kernels covered by the benchmark SASS-diff CI job. Inefficiencies like memcpy through uninitialized locals or recomputing outputs the instruction already produces have no functional symptom, so without one of the two, unfavorable codegen in the new public API ships unseen.

api.trait-specialization-member-shape (important, new specializations of standard-library customization-point traits)#

When a diff specializes a primary template, where generic code names its members directly (traits like pointer_traits, allocator_traits, iterator_traits), every member the specialization provides must have the same shape as in the primary template: an alias template stays an alias template, nested structs stay nested structs, constants stay constants with the exact same data type. A wrong shape may still compile but carry a different meaning, staying invisible during compilation while breaking generic consumers, often in third-party code.

api.duplicated-derived-type-not-updated (important, CUB/Thrust algorithms with multiple public overload families layered over one dispatch)#

When a diff adds support for a new argument or case by extending a shared type-computation helper (e.g. select_accum_t), check every other public overload family of the same algorithm for an independently written computation of the same derived type — especially the device_*.cuh facade over the touched dispatch_*.cuh, which is often not part of the diff; check it against the diff’s base revision. A copy that recomputes the type inline silently misses the new case. Prefer replacing the inline computation with the shared helper.

perf.tuning-refactor-verification (important, CUB tuning-policy selectors in cub/device/dispatch/tuning/*.cuh and perf-critical type/arch dispatch)#

A policy selector is a constexpr function from a compute capability and type information to a tuning policy value. When a diff refactors one (or anything it calls, or the *Policy structs it returns) without claiming a perf change, the function must return the same policy values for every input as before — check equivalence per (architecture, type, size, operation) combination, not per code branch. Typical silent breaks: a combination that used to hit tuned values now falls through to a fallback or empty optional (no compile error, just an untuned policy); a field added/removed/reordered in a policy struct shifting every positional brace-init (ScanLookaheadPolicy{6, 104 - 1, 8, 2, 2}); a dispatch wrapper no longer forwarding its policy selector to an inner dispatch call. A claim of “no SASS changes” verified on one test type is not sufficient; demand a SASS diff or benchmark sweep over non-default/non-primitive value types and every affected architecture.

perf.arch-gate-coverage (important, tuning-policy selectors conditioned on compute capability in cub/cub/device/dispatch/tuning/**)#

When a diff touches a policy selector — changing a compute-capability condition, or changing, adding, or removing policy values — work out for every existing architecture (see _CCCL_KNOWN_CUDA_ARCH_LIST in libcudacxx/include/cuda/std/__cccl/execution_space.h) whether the policy or values it receives change, including architectures that previously fell through to an older branch. The architectures affected by the diff must be exactly those that were benchmarked. A condition cc >= X with existing architectures above X is a deliberate choice to serve multiple architectures from the same branch and fine as-is — the hazard is a diff changing what those architectures receive: inserting a higher-cc branch in front of it, with an even higher-cc architecture existing, re-routes that architecture too (new cc 10.7 tunings capturing cc 12.0, which inherited the cc 10.0 tunings on purpose), and editing the branch’s values changes them all. Flag each affected, unbenchmarked architecture; the author must bound the condition or provide benchmarks for what it captures.

perf.shared-primitive-consumers (important, shared thread/warp/block-scope primitives in cub/thrust/libcudacxx)#

When a diff changes the implementation of a widely-reused low-level primitive (e.g. ThreadReduce, warp/block scan/reduce helpers) in a way that can affect the generated SASS (a new fast path, a refactor, a swapped helper function), flag it. Require a clean SASS diff for the entire PR, or benchmarks across the primitive’s consumers (not just its own microbenchmark). Cover non-standard binary operators, large value types, and every architecture the change affects: a change that helps one workload can silently regress a different algorithm layered on top of the primitive.

perf.vector-init-before-overwrite (suggestion, thrust::host_vector/thrust::device_vector and c2h’s host_vector/device_vector construction anywhere in the diff)#

Flag a sized thrust/c2h host_vector/device_vector construction (vector(n), vector(n, value)) or resize(n) that doesn’t use the thrust::no_init sentinel when the vector’s content is never read before being fully overwritten — as an algorithm’s output, a kernel/copy destination, or an explicit full assignment right after. The default overload value-initializes every element first, work the overwrite immediately discards. Temporary-storage allocations are almost always a no_init candidate, since callers assume that memory starts uninitialized. Does not apply when the vector is read before being overwritten, or when the initial values are semantically required (e.g. an accumulator seed, or a vector only partially written). When the element type is not trivially default-constructible, or generic (e.g., in a template context), use thrust::default_init instead.

correctness.shared-memory-overalignment (critical, extern __shared__ storage or alignment of types placed in dynamic shared memory)#

Flag any extern __shared__ storage (dynamic shared memory) with alignment greater than 16, including indirectly via alignas on a type or data member placed in such storage. Before nvcc 13.1, compiler bugs failed to retain alignment higher than 16 bytes in some cases, producing misaligned accesses. Independently, a dynamic shared memory declaration with alignment > 16 increases the static shared-memory padding for the entire translation unit, which can reduce occupancy of unrelated kernels, including in downstream user code. CCCL code must not introduce any extern __shared__ storage with alignment above 16. A different design is required instead, e.g., manual alignment of a byte buffer. Static shared memory with alignment > 16 is fine.

infra.new-cuda-arch-rollout (important, diffs adding support for a CUDA architecture/SM number)#

When a diff adds support for a new CUDA architecture (SM number) not previously known to CCCL, go through this checklist and verify every applicable entry was updated in the same diff (or a linked follow-up PR):

  • libcudacxx/include/nv/detail/__target_macros and libcudacxx/include/nv/target — the NV_PROVIDES_SM_XXX/NV_IS_EXACTLY_SM_XXX macro pair itself.

  • libcudacxx/include/cuda/std/__cccl/execution_space.h — the new SM added to _CCCL_KNOWN_CUDA_ARCH_LIST (and to _CCCL_KNOWN_CUDA_ARCH_SPECIFIC_LIST if it needs a family-specific arch_id/arch_traits entry distinct from its base SM).

  • libcudacxx/include/cuda/__device/arch_traits.h — new arch_traits<arch_id::sm_XXX>() specialization with its own limits, not copied from an older SM.

  • libcudacxx/test/libcudacxx/cuda/ccclrt/device/{all_arch_ids,arch_id,arch_id_fmt,arch_traits.c2h,is_specific_arch} — exhaustive per-arch test tables.

  • cub/test/catch2_test_util_device.cu — new GEN_POLICY entry in the policy_hub_all self-test.

  • cmake/CCCLCheckCudaArchitectures.cmake — all-major-cccl/all-cccl resolution, if the new SM belongs in default multi-arch builds.

  • Recommended: ci/matrix.yaml — new SM number added to at least one sm:/codegen_target job.

infra.ci-flag-removal (important, ci/*.sh, ci/matrix.yaml, and other shared automation/config)#

When a diff changes CI infrastructure — ci/matrix.yaml, CI shell scripts, build/test scripts, workflow files — and removes or restricts CI coverage in any way (a version dropped from a job row’s value list, a CLI flag or ${VAR:=default} override deleted, a job or filter removed), cross-check the PR title and description: the removal must be intended and clearly pointed out. If it looks accidental — e.g. the PR’s stated purpose is unrelated — flag it and have the author confirm the removal is intended. A coverage drop produces no CI failure and can go undetected for months.