You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unify Cython test builds across Linux and Windows - #3536
Supersedes #3513 and implements the broader approach from its review. Put compiler header setup in the Python Cython test builders for Core and the CUDA 12 and 13 Bindings packages. Use system-header search paths on Linux and MSVC include directories on Windows. Retain Core's C++17 compiler setting.
Run the Python builders directly in wheel CI and Pixi and remove the shell and batch wrappers. Pixi sets both CUDA_PATH and CUDA_HOME to its selected toolkit so an inherited CUDA_PATH cannot redirect the build.
Validation
All 105 jobs in the wheel and GPU CI workflow passed at 27b76fa. This includes 28 wheel build jobs across Linux x86-64 and AArch64 and Windows x64 and ARM64. Windows x64 built both toolkit variants and Windows ARM64 built the current CUDA variant. Full CI · Aggregate check
The following representative GPU jobs each passed 9 Bindings Cython tests and 4 Core Cython tests using the compiled artifacts from the wheel jobs.
The Linux Pixi source smoke check ran the Python task for both Bindings roots and Core and verified that the compiled extensions landed beside their sources. Pixi source smoke
Clean local Linux builds using matching CUDA 13.3 wheels and headers reproduced a missing cuda.h error with the old direct Python entry point. With the compiler include environment cleared, the new direct entry point built all three Bindings and both Core Cython extensions in place.
All-file pre-commit passed locally. Hosted pre-commit passed on Linux and Windows, and the security checks passed. Pre-commit · Security Suite
The RTX 4090 and V100 Windows jobs passed on the second attempt at the same commit. Their initial failures were runtime crashes in the ordinary Core and Bindings suites before the Cython tests. RTX 4090 retry · V100 retry
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Documentation
Updated Cython test build instructions to use a single Python command across CUDA packages.
Build and Test Improvements
Unified Cython test builds across supported platforms and improved CUDA header path configuration.
Added a test dependency to help locate CUDA installations.
Cython test builds for cuda.bindings and cuda.core now use Python build drivers. The changes add shared include-path configuration, update Pixi and CI commands, add a test dependency, and revise build instructions.
Changes: Cython test build migration
Layer / File(s)
Summary
Include paths and Python build drivers cuda_bindings_13/_build_shared.py, cuda_bindings_12/tests/cython/build_tests.py, cuda_bindings_13/tests/cython/build_tests.py, cuda_core/tests/cython/build_tests.py, cuda_bindings_12/tests/cython/build_tests.*, cuda_bindings_13/tests/cython/build_tests.*, cuda_core/tests/cython/build_tests.sh
The build drivers configure Cython test extension include paths through the shared helper. The platform-specific shell and batch wrappers are removed.
Pixi tasks, CI steps, and documented commands run the Python build drivers. Pixi environments add CUDA_PATH, and each test dependency group adds cuda-pathfinder>=1.5. The CUDA 12 README states that CUDA_PATH takes precedence over CUDA_HOME.
Possibly related PRs
NVIDIA/cuda-python#3315: This PR also changes Pixi configuration for cuda_bindings_12 and cuda_core, so its task definitions may need to align with the updated tasks here.
Suggested reviewers:leofang, mdboom
Change: Refactor
Merge Risk: Minimal · up to 27b76
This change moves Cython test builds onto Python drivers with shared include-path setup, replacing the shell and batch wrappers. Reported CI passed across the supported platforms, and no concrete merge-blocking risk remains.
Security architecture risk: Low · up to 27b76
Wheel CI and Pixi set both CUDA variables to the same toolkit, so their normal builds are not affected by the precedence difference. Outside those environments, a CUDA 12 source build and its tests can use different headers if both variables are set to different locations. A passing test run would then give less assurance that it exercised the toolkit used to build the package.
Retained concerns
Low · reliability · inferred: With conflicting nonempty CUDA_PATH and CUDA_HOME values, the CUDA 12 test driver now selects CUDA_PATH while the unchanged source-build hook selects CUDA_HOME. Outside the managed environments, this can cause a build failure or produce test extensions that validate against headers other than those used to build the package. Pathfinder warns about the conflict but still selects CUDA_PATH.
Security review details
Security Blast Radius
inferred — The new precedence affects native test compilation wherever these drivers run with conflicting CUDA variables. The inspected calls are local developer tasks and existing CI jobs; they do not add a remotely callable interface or a new runner privilege.
Trust Boundaries and Controls
observed — The compiler consumes headers from the toolkit root selected through the build environment. The wheel CI toolkit fetch action exports the same root under both variable names, and Pixi sets both to its platform-specific toolkit root rather than relying on an inherited CUDA_PATH.
Hardening Proposals
proposed — For CUDA 12 source-build validation, require one toolkit root across package and test compilation, or fail early when the two selectors would choose different roots. Preserve the source hook's existing multi-root behavior unless that contract is changed deliberately.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between edf1b31 and 27b76fa.
Files selected for processing: 22
.github/workflows/build-wheel.yml
cuda_bindings_12/AGENTS.md
cuda_bindings_12/README.md
cuda_bindings_12/pixi.toml
cuda_bindings_12/pyproject.toml
cuda_bindings_12/tests/cython/build_tests.bat
cuda_bindings_12/tests/cython/build_tests.py
cuda_bindings_12/tests/cython/build_tests.sh
cuda_bindings_13/AGENTS.md
cuda_bindings_13/README.md
cuda_bindings_13/_build_shared.py
cuda_bindings_13/pixi.toml
cuda_bindings_13/pyproject.toml
cuda_bindings_13/tests/cython/build_tests.bat
cuda_bindings_13/tests/cython/build_tests.py
cuda_bindings_13/tests/cython/build_tests.sh
cuda_core/AGENTS.md
cuda_core/README.md
cuda_core/pixi.toml
cuda_core/pyproject.toml
cuda_core/tests/cython/build_tests.py
cuda_core/tests/cython/build_tests.sh
Files with no reviewable changes: 5
cuda_bindings_12/tests/cython/build_tests.bat
cuda_bindings_12/tests/cython/build_tests.sh
cuda_bindings_13/tests/cython/build_tests.bat
cuda_bindings_13/tests/cython/build_tests.sh
cuda_core/tests/cython/build_tests.sh
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CI/CDCI/CD infrastructurecuda.bindingsEverything related to the cuda.bindings modulecuda.coreEverything related to the cuda.core moduletestImprovements or additions to tests
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
— codex on behalf of Ralf —
Description
Supersedes #3513 and implements the broader approach from its review. Put compiler header setup in the Python Cython test builders for Core and the CUDA 12 and 13 Bindings packages. Use system-header search paths on Linux and MSVC include directories on Windows. Retain Core's C++17 compiler setting.
Run the Python builders directly in wheel CI and Pixi and remove the shell and batch wrappers. Pixi sets both
CUDA_PATHandCUDA_HOMEto its selected toolkit so an inheritedCUDA_PATHcannot redirect the build.Validation
All 105 jobs in the wheel and GPU CI workflow passed at 27b76fa. This includes 28 wheel build jobs across Linux x86-64 and AArch64 and Windows x64 and ARM64. Windows x64 built both toolkit variants and Windows ARM64 built the current CUDA variant. Full CI · Aggregate check
The following representative GPU jobs each passed 9 Bindings Cython tests and 4 Core Cython tests using the compiled artifacts from the wheel jobs.
cuda.herror with the old direct Python entry point. With the compiler include environment cleared, the new direct entry point built all three Bindings and both Core Cython extensions in place.Checklist