feat(cccl): integrate missing CCCL directories — python/, ci/, .agent/, docs/, test/
Sparse-checkout from NVIDIA/cccl main branch to complete cccl_upstream: Added: - python/cuda_cccl/ (226 files) — Python bindings for device-level algorithms Critical for muh toolchain: cuda.compute.reduce_into, scan, radix_sort, etc. Includes 204 .py files with full test coverage for all 27 algorithms - ci/ (163 files) — Build/test infrastructure build_cub.sh, test_cub.sh, build_and_test_targets.sh, matrix.yaml Directly maps to our [INFRA-CI] and [INFRA-BUILD] items - .agent/skills/ (7 files) — NVIDIA's own agent skills for CCCL cccl-style/SKILL.md, cccl-test/SKILL.md, sass-diff/SKILL.md - docs/ (491 files) — Official CCCL documentation CI references, CMake guides, Python compute docs, libcudacxx PTX docs - test/ (12 files) — Top-level integration tests (cuda_smoke, stdpar) - Root configs: .clang-format, .clang-tidy, CONTRIBUTING.md, pyproject.toml - CLAUDE.md symlink → AGENTS.md (NVIDIA's standard) cccl_upstream now mirrors full NVIDIA/cccl structure: Before: 42M (cub + thrust + libcudacxx + cudax + c + examples + benchmarks) After: 53M (+python +ci +docs +.agent +test +configs) This completes the CCCL base needed for: - [muh-bench] items: ci/util/build_and_test_targets.sh for targeted builds - [CCCL-verify] items: python/cuda_cccl/tests/ as reference implementations - [CCCL-test] items: ci/test_cub.sh, ci/test_thrust.sh - Agent workflow: .agent/skills/ for consistent style and test patterns
This commit is contained in:
13
cccl_upstream/.agent/skills/cccl-test/SKILL.md
Normal file
13
cccl_upstream/.agent/skills/cccl-test/SKILL.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: cccl-test
|
||||
description: Use when writing, updating, reviewing, or validating CCCL tests; read common CCCL test guidance and the path-specific references named by this skill.
|
||||
---
|
||||
|
||||
# CCCL Test
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Read `references/common.md` for guidance that applies across CCCL tests.
|
||||
2. For `libcudacxx/test/**/*`, also read `references/libcudacxx.md`.
|
||||
3. If no path-specific reference exists, follow nearby tests and repository docs. Do not import test rules from another subproject.
|
||||
4. Apply each reference only to its stated scope. Rules for one CCCL subproject do not automatically apply to another.
|
||||
31
cccl_upstream/.agent/skills/cccl-test/references/common.md
Normal file
31
cccl_upstream/.agent/skills/cccl-test/references/common.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Common CCCL Test Guidance
|
||||
|
||||
Apply this guidance across CCCL tests unless a path-specific test reference says otherwise.
|
||||
|
||||
## Local Consistency
|
||||
|
||||
- Read nearby tests first and mirror their directory layout, file names, helper types, includes, assertion style, and local gating or skip mechanisms.
|
||||
|
||||
## Coverage
|
||||
|
||||
- Cover relevant edge cases.
|
||||
- Cover relevant input and output types.
|
||||
- Cover error behavior when applicable.
|
||||
- Cover runtime and compile-time behavior when applicable.
|
||||
- Cover device and host behavior when applicable.
|
||||
|
||||
## Test Structure
|
||||
|
||||
- All tests must have the correct license banner.
|
||||
- Use the local test harness assertions and helpers.
|
||||
- Use compile-time checks for compile-time guarantees and constexpr coverage when relevant.
|
||||
- Negative tests should check the intended diagnostic or failure mode when the local harness supports it.
|
||||
|
||||
## Portability
|
||||
|
||||
- Prefer project test macros and helpers for compiler, dialect, exception, host/device, and platform probes instead of spelling ad hoc checks directly.
|
||||
- If a test is unsupported, expected to fail, disabled, or skipped on a platform, motivate it with a comment.
|
||||
|
||||
## Validation
|
||||
|
||||
- Use targeted test runs for the project and files being changed.
|
||||
@@ -0,0 +1,83 @@
|
||||
# libcudacxx Test
|
||||
|
||||
## Organization
|
||||
|
||||
- Put CUDA Standard Library tests under `libcudacxx/test/libcudacxx/std/...`.
|
||||
- Put CUDA-specific API tests under `libcudacxx/test/libcudacxx/cuda/...`, unless an adjacent `std/...` directory is clearly the established home for the functionality.
|
||||
- Read nearby tests first and mirror their directory layout, file names, helper types, includes, and lit gates.
|
||||
|
||||
## Purpose
|
||||
|
||||
- Validate libcudacxx functionality. It is fundamental to verify:
|
||||
|
||||
- Edge cases.
|
||||
- Input and output types.
|
||||
- Exception behavior.
|
||||
- Runtime and constant-evaluation behavior.
|
||||
- Device and host behavior.
|
||||
|
||||
## Test kinds
|
||||
|
||||
- `.pass.cpp`: compiles, links, runs, and returns 0.
|
||||
- `.compile.pass.cpp`: compiles correctly.
|
||||
- `.fail.cpp`: must fail compilation. Prefer precise `expected-error`, `expected-warning`, `expected-note`, or `expected-no-diagnostics` annotations when clang verify is supported.
|
||||
- `.runfail.cpp`: compiles and runs but must return non-zero.
|
||||
|
||||
## Test structure
|
||||
|
||||
- All tests must have the correct license banner.
|
||||
- Always include top level headers, never internal ones with `__` prefix.
|
||||
- Include support headers `"test_macros.h"`, `"test_iterators.h"`, `"test_comparisons.h"`, when needed.
|
||||
- Use `static_assert(...)` for compile-time guarantees and constexpr coverage.
|
||||
- Use `<cuda/std/cassert>` and `assert(...)` for runtime checks.
|
||||
- The `main` function must be present, dispatch runtime and static-evaluation tests, and return 0.
|
||||
|
||||
## Style
|
||||
|
||||
- Use `cuda::std` names, not `std::` names, unless the test is intentionally checking interoperability with host standard library types.
|
||||
- Do not fully qualify names in header includes unless the test is intentionally checking interoperability with host standard library types.
|
||||
- Mark helper functions that may run on host and device with `TEST_FUNC`; use `TEST_DEVICE_FUNC` for device-only helpers.
|
||||
use `TEST_TILE_FUNC` for tile only helpers and `TEST_TILE_DEVICE_FUNC` for functions that can run on tile and device
|
||||
- `const`-qualification is discouraged.
|
||||
- Don't use `noexcept` for helper functions unless strictly necessary.
|
||||
- Do not use lambda expressions in host/device test code unless nearby tests already prove the pattern is supported.
|
||||
|
||||
## Portability
|
||||
|
||||
- Guard host-only or device-only behavior with `NV_IF_TARGET(NV_IS_HOST, (...))` and `NV_IF_TARGET(NV_IS_DEVICE, (...))` respectively.
|
||||
- Use `TEST_STD_VER`, `TEST_COMPILER`, `TEST_CUDA_COMPILER`, `TEST_HAS_EXCEPTIONS`, and `TEST_THROW` from `"test_macros.h"` instead of spelling compiler or dialect probes directly.
|
||||
- Unsupported platforms can be disabled with `UNSUPPORTED: <feature-name>` or `XFAIL: <feature-name>` lit directives. Some common feature names are `nvrtc`, `enable-tile`, `pre-sm-70`, `c++17`, `c++20`, `msvc`, `gcc-<version>`, or `clang-<version>`.
|
||||
|
||||
- Always motivate unsupported features with a comment.
|
||||
|
||||
## Lit directives
|
||||
|
||||
- Put lit directives near the top of the file before includes.
|
||||
- Common directives: `UNSUPPORTED:`, `XFAIL:`, `REQUIRES:`, `ADDITIONAL_COMPILE_DEFINITIONS:`, `ADDITIONAL_COMPILE_OPTIONS_HOST:`, `ADDITIONAL_COMPILE_OPTIONS_CUDA:`, `MODULES_DEFINES:`, and `CONSTEXPR_STEPS:`.
|
||||
- For diagnostics in `.fail.cpp`, annotate the exact line that should fail when possible:
|
||||
|
||||
```cpp
|
||||
bad_expression(); // expected-error {{message fragment}}
|
||||
```
|
||||
|
||||
- Prefer checking the intended diagnostic over accepting any compile failure.
|
||||
|
||||
## Validation
|
||||
|
||||
Use targeted libcudacxx lit runs. Paths passed to `--lit-precompile-tests` and `--lit-tests` are relative to `libcudacxx/test/libcudacxx/`.
|
||||
|
||||
```bash
|
||||
ci/util/build_and_test_targets.sh \
|
||||
--preset libcudacxx \
|
||||
--lit-precompile-tests "std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp" \
|
||||
--lit-tests "std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp"
|
||||
```
|
||||
|
||||
If running lit directly, use the configured site file:
|
||||
|
||||
```bash
|
||||
LIBCUDACXX_SITE_CONFIG=<path-to-cccl>/build/<preset>/libcudacxx/test/libcudacxx/lit.site.cfg \
|
||||
lit -v libcudacxx/test/libcudacxx/<relative-test-path>
|
||||
```
|
||||
|
||||
- Use `-Dexecutor=NoopExecutor()` for precompile-only validation when runtime execution is unavailable or GPU coverage is not required.
|
||||
Reference in New Issue
Block a user