[libcu++] Disable gcc compiler builtins in older NVCC - #11033
Conversation
We have seen at least one codegen bug related to `__remove_cv` where NVCC 12.9 and NVCC 13.0 generated invalid code. Be safe and disable all new ones for anything below 13.3 which has been fully tested in CI
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe builtin configuration now defines ChangesBuiltin conflict handling
Suggested reviewers: Merge Risk: 🔵 Low · up to The change disables compiler builtins for NVCC versions below 13.3, but the boundary behavior should be verified for NVCC 12.9, 13.0, and 13.3. This is a bounded correctness risk that is mergeable with explicit owner follow-up. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d4303432-a63c-489e-b7ac-99f2c9e97642
📒 Files selected for processing (1)
libcudacxx/include/cuda/std/__cccl/builtin.h
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.
| // We have seen at least one codegen bug in cudax::launch related to one of the builtins. Disable for older NVCC | ||
| #elif _CCCL_CUDA_COMPILER(NVCC, <, 13, 3) | ||
| # define _CCCL_BUILTIN_CONFLICTS_WITH_LIBSTDCXX(...) 1 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
printf '%s\n' '--- review file ---'
sed -n '1,130p' libcudacxx/include/cuda/std/__cccl/builtin.h
printf '%s\n' '--- relevant macro definitions and consumers ---'
rg -n -C 4 '_CCCL_(CUDA_COMPILER|DISABLE_CONFLICTING_COMPILER_BUILTINS|BUILTIN_CONFLICTS_WITH_LIBSTDCXX)' libcudacxx/include/cuda/std
printf '%s\n' '--- relevant repository conventions and learnings ---'
find /tmp/coderabbit-repo-knowledge/nvidia-cccl-2f773195 -type f -name '*.md' -print
head -5 /tmp/coderabbit-repo-knowledge/nvidia-cccl-2f773195/*/*.md 2>/dev/null
printf '%s\n' '--- changed paths ---'
git diff --stat -- libcudacxx/include/cuda/std/__cccl/builtin.h
git diff -- libcudacxx/include/cuda/std/__cccl/builtin.hRepository: NVIDIA/cccl
Length of output: 50368
🏁 Script executed:
printf '%s\n' '--- compiler version predicate ---'
rg -n -C 8 '_CCCL_CUDA_COMPILER' libcudacxx/include/cuda/std/__cccl/compiler.h
printf '%s\n' '--- builtin conflict references only ---'
rg -n -C 3 '_CCCL_BUILTIN_CONFLICTS_WITH_LIBSTDCXX|_CCCL_DISABLE_CONFLICTING_COMPILER_BUILTINS' libcudacudacxx libcudacxx 2>/dev/null | head -160
printf '%s\n' '--- focused diff ---'
git diff --unified=20 -- libcudacxx/include/cuda/std/__cccl/builtin.h
printf '%s\n' '--- candidate header tests ---'
rg -n -g '*.{cpp,cc,cxx,h,hpp,cu,cuh,py}' 'builtin\.h|BUILTIN_CONFLICTS|DISABLE_CONFLICTING|NVCC.*13\.3|13\.3' libcudacxx | head -200Repository: NVIDIA/cccl
Length of output: 22119
🏁 Script executed:
printf '%s\n' '--- exact version-comparison contract ---'
rg -n -C 12 '`#define` _CCCL_VERSION_(COMPARE|INVALID)|_CCCL_HOST_STD_LIB' \
libcudacxx/include/cuda/std/__cccl/preprocessor.h \
libcudacxx/include/cuda/std/__cccl/host_std_lib.h \
libcudacxx/include/cuda/std/__cccl/compiler.h
printf '%s\n' '--- libcudacxx test layout and test configuration references ---'
find libcudacxx/test -maxdepth 3 -type f \( -iname '*builtin*' -o -iname '*header*' -o -iname 'CMakeLists.txt' -o -iname '*.py' \) -print | head -120
rg -n -C 3 'header.*test|pytest|NVCC|CUDA.*12\.9|13\.0|13\.3|CMAKE_CUDA_COMPILER_VERSION' \
libcudacxx/test libcudacxx/CMakeLists.txt .github 2>/dev/null | head -240Repository: NVIDIA/cccl
Length of output: 29523
important: Add a regression test for the NVCC version boundary. Check NVCC 12.9, 13.0, and 13.3. The explicit disable macro must force 1 for every NVCC version.
Source: Path instructions
|
closing in favor of #11031 |
🥳 CI Workflow Results🟩 Finished in 4h 51m: Pass: 100%/183 | Total: 5d 18h | Max: 4h 50m | Hits: 43%/1557977See results here. AI failure analysis1. cugraph compilation selects deleted rmm::device_scalar rvalue constructor · 1 jobExplanation: cugraph initializes `device_scalar` objects from temporary values such as `size_t{0}`, causing overload resolution to select RMM 26.10's explicitly deleted `const value_type&&` constructor; the thousands of later diagnostics are repeated template instantiations of this error. The PR's new condition applies only to NVCC versions below 13.3, while this job used NVCC 13.3.73, so the evidence favors an incompatible RMM/cugraph main snapshot rather than the changed CCCL branch. Evidence: Copy this prompt into a coding agentJobs: |
We have seen at least one codegen bug related to __remove_cv where NVCC 12.9 and NVCC 13.0 generated invalid code.
Be safe and disable all new ones for anything below 13.3 which has been fully tested in CI