@@ -52,34 +52,38 @@ elif [[ "${1}" == "test" ]]; then
5252 BUILD_CUDA_MAJOR=" $( cut -d ' .' -f 1 <<< ${BUILD_CUDA_VER} ) "
5353 TEST_CUDA_MAJOR=" $( cut -d ' .' -f 1 <<< ${CUDA_VER} ) "
5454 CUDA_BINDINGS_ARTIFACT_BASENAME=" cuda-bindings-python${PYTHON_VERSION_FORMATTED} -cuda${BUILD_CUDA_VER} -${HOST_PLATFORM} "
55- # USE_BACKPORT_BINDINGS flags the CTK-major-mismatch case where the
56- # current-run bindings wheel was built for a different CTK major than the
57- # one under test, so we must pull the bindings wheel from the backport
58- # branch instead. This is independent of whether bindings tests run.
59- # SKIP_CUDA_BINDINGS_TEST is the test-time gate: it is set when the CTK
60- # majors differ OR when the caller tells us to skip for path-filter
61- # reasons via SKIP_BINDINGS_TEST_OVERRIDE.
55+
56+ # BINDINGS_SOURCE controls which cuda-bindings to install at test time:
57+ # main — use the just-built bindings wheel from this CI run
58+ # backport — fetch bindings from the prior (N-1) branch
59+ # published — install from PyPI (cuda-bindings==${TEST_CUDA_MAJOR}.${TEST_CUDA_MINOR}.*)
60+ #
61+ # SKIP_CUDA_BINDINGS_TEST / SKIP_CYTHON_TEST control which *tests* to run
62+ # (they do NOT affect installation — that's BINDINGS_SOURCE's job).
63+
64+ BUILD_CUDA_MINOR=" $( cut -d ' .' -f 2 <<< ${BUILD_CUDA_VER} ) "
65+ TEST_CUDA_MINOR=" $( cut -d ' .' -f 2 <<< ${CUDA_VER} ) "
66+
6267 if [[ ${BUILD_CUDA_MAJOR} != ${TEST_CUDA_MAJOR} ]]; then
63- USE_BACKPORT_BINDINGS=1
68+ # Major mismatch (e.g. build=13.x, test=12.x): use the backport branch.
69+ BINDINGS_SOURCE=backport
70+ SKIP_CUDA_BINDINGS_TEST=1
71+ SKIP_CYTHON_TEST=1
72+ elif [[ ${BUILD_CUDA_MINOR} != ${TEST_CUDA_MINOR} ]]; then
73+ # Same major, minor mismatch (e.g. build=13.2, test=13.0): use published
74+ # bindings from PyPI to test the real-world backward-compat scenario.
75+ BINDINGS_SOURCE=published
6476 SKIP_CUDA_BINDINGS_TEST=1
6577 SKIP_CYTHON_TEST=1
6678 else
67- USE_BACKPORT_BINDINGS=0
68- # Path-filter override only skips bindings tests, NOT cython tests
69- # for other modules (e.g. cuda.core). Cython skip is driven solely
70- # by the build/test CTK minor-version mismatch.
79+ # Exact match: use the just-built bindings wheel.
80+ BINDINGS_SOURCE=main
7181 if [[ " ${SKIP_BINDINGS_TEST_OVERRIDE:- 0} " == " 1" ]]; then
7282 SKIP_CUDA_BINDINGS_TEST=1
7383 else
7484 SKIP_CUDA_BINDINGS_TEST=0
7585 fi
76- BUILD_CUDA_MINOR=" $( cut -d ' .' -f 2 <<< ${BUILD_CUDA_VER} ) "
77- TEST_CUDA_MINOR=" $( cut -d ' .' -f 2 <<< ${CUDA_VER} ) "
78- if [[ ${BUILD_CUDA_MINOR} != ${TEST_CUDA_MINOR} ]]; then
79- SKIP_CYTHON_TEST=1
80- else
81- SKIP_CYTHON_TEST=0
82- fi
86+ SKIP_CYTHON_TEST=0
8387 fi
8488 # We don't test compute-sanitizer on CTK<12 because backporting fixes is too much effort
8589 # We only test compute-sanitizer on python 3.12 arbitrarily; we don't need to use sanitizer on the entire matrix
@@ -93,10 +97,11 @@ elif [[ "${1}" == "test" ]]; then
9397 fi
9498 {
9599 echo " SETUP_SANITIZER=${SETUP_SANITIZER} "
100+ echo " BINDINGS_SOURCE=${BINDINGS_SOURCE} "
96101 echo " SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST} "
97102 echo " SKIP_CYTHON_TEST=${SKIP_CYTHON_TEST} "
98103 echo " TEST_CUDA_MAJOR=${TEST_CUDA_MAJOR} "
99- echo " USE_BACKPORT_BINDINGS =${USE_BACKPORT_BINDINGS } "
104+ echo " TEST_CUDA_MINOR =${TEST_CUDA_MINOR } "
100105 } >> $GITHUB_ENV
101106fi
102107
0 commit comments