From c1d8dd3f18bbb87450840d2f9c774e8c05aeb697 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Wed, 30 Sep 2026 13:27:51 -0400 Subject: [PATCH] ci: check out test sources at the commit the wheels were built from Nightly runs reuse wheels from the latest successful CI run on main, but the test job checked out the workflow's own commit. When main moved on after that run, new tests ran against old wheels: the aarch64 cuda.bindings job saw a cascade of failures and then a segfault in test_ffi_coverage_jit_wall_time_pointer_is_valid, where the old wheel returns a NULL cptr that the test dereferences through ctypes. Check out `inputs.sha || github.sha` in the Linux and Windows test workflows so sources match the wheels under test, and assert cptr is non-NULL in that test so a regression fails instead of crashing. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/test-wheel-linux.yml | 4 ++++ .github/workflows/test-wheel-windows.yml | 4 ++++ cuda_bindings/tests/test_cuda.py | 2 ++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 0bb470b26c3..e328939d052 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -128,6 +128,10 @@ jobs: steps: - name: Checkout ${{ github.event.repository.name }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + # Test sources must match the wheels under test (nightly runs + # reuse wheels built from an older commit of main). + ref: ${{ inputs.sha || github.sha }} - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 7abfc74126b..8256981bff8 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -107,6 +107,10 @@ jobs: steps: - name: Checkout ${{ github.event.repository.name }} uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + # Test sources must match the wheels under test (nightly runs + # reuse wheels built from an older commit of main). + ref: ${{ inputs.sha || github.sha }} - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main diff --git a/cuda_bindings/tests/test_cuda.py b/cuda_bindings/tests/test_cuda.py index 80ac5da0fd0..65212efbcb7 100644 --- a/cuda_bindings/tests/test_cuda.py +++ b/cuda_bindings/tests/test_cuda.py @@ -655,6 +655,8 @@ def test_ffi_coverage_jit_option_binary_loader_thread_count(): def test_ffi_coverage_jit_wall_time_pointer_is_valid(): """CU_JIT_WALL_TIME must give CUDA a valid writable float address, not a garbage pointer.""" helper = cuda._HelperCUjit_option(cuda.CUjit_option.CU_JIT_WALL_TIME, 0.0) + # Guard against NULL so a regression fails instead of segfaulting. + assert helper.cptr != 0 # Write a sentinel float via ctypes to confirm the pointer is addressable. ctypes.c_float.from_address(helper.cptr).value = 3.14 assert ctypes.c_float.from_address(helper.cptr).value == pytest.approx(3.14, rel=1e-5)