Skip to content

Unify Cython test builds across Linux and Windows - #3536

Open
rwgk wants to merge 3 commits into
mainfrom
rwgk/cross-platform-cython-test-builders
Open

rwgk wants to merge 3 commits into
mainfrom
rwgk/cross-platform-cython-test-builders

Conversation

@rwgk

@rwgk rwgk commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

— 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_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.

Platform CUDA 12.9 CUDA 13.5
Linux x86-64 CUDA 12 run CUDA 13 run
Linux AArch64 CUDA 12 run CUDA 13 run
Windows x64 CUDA 12 run CUDA 13 run
  • 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

Checklist

  • I have read the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added CI/CD CI/CD infrastructure cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module labels Nov 23, 2026
@rwgk rwgk added the test Improvements or additions to tests label Nov 23, 2026
@rwgk rwgk self-assigned this Nov 23, 2026
@rwgk rwgk added this to the CI milestone Nov 23, 2026
@rwgk

rwgk commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 6a95cfa

@github-actions

Copy link
Copy Markdown
Contributor

@rwgk

rwgk commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 27b76fa

@rwgk
rwgk marked this pull request as ready for review November 23, 2026 08:30
@rwgk
rwgk requested a review from juenglin November 23, 2026 08:30
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Explain Change →

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.
Build task and environment wiring
cuda_bindings_12/pixi.toml, cuda_bindings_12/pyproject.toml, cuda_bindings_13/pixi.toml, cuda_bindings_13/pyproject.toml, cuda_core/pixi.toml, cuda_core/pyproject.toml, .github/workflows/build-wheel.yml, cuda_bindings_12/README.md, cuda_bindings_12/AGENTS.md, cuda_bindings_13/README.md, cuda_bindings_13/AGENTS.md, cuda_core/README.md, cuda_core/AGENTS.md
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
Recent review info

Run configuration

Commits

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant