Skip to content

Commit c1d8dd3

Browse files
mdboomclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 4b9dcbd commit c1d8dd3

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎.github/workflows/test-wheel-linux.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ jobs:
128128
steps:
129129
- name: Checkout ${{ github.event.repository.name }}
130130
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
131+
with:
132+
# Test sources must match the wheels under test (nightly runs
133+
# reuse wheels built from an older commit of main).
134+
ref: ${{ inputs.sha || github.sha }}
131135

132136
- name: Setup proxy cache
133137
uses: nv-gha-runners/setup-proxy-cache@main

‎.github/workflows/test-wheel-windows.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ jobs:
107107
steps:
108108
- name: Checkout ${{ github.event.repository.name }}
109109
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
110+
with:
111+
# Test sources must match the wheels under test (nightly runs
112+
# reuse wheels built from an older commit of main).
113+
ref: ${{ inputs.sha || github.sha }}
110114

111115
- name: Setup proxy cache
112116
uses: nv-gha-runners/setup-proxy-cache@main

‎cuda_bindings/tests/test_cuda.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,8 @@ def test_ffi_coverage_jit_option_binary_loader_thread_count():
655655
def test_ffi_coverage_jit_wall_time_pointer_is_valid():
656656
"""CU_JIT_WALL_TIME must give CUDA a valid writable float address, not a garbage pointer."""
657657
helper = cuda._HelperCUjit_option(cuda.CUjit_option.CU_JIT_WALL_TIME, 0.0)
658+
# Guard against NULL so a regression fails instead of segfaulting.
659+
assert helper.cptr != 0
658660
# Write a sentinel float via ctypes to confirm the pointer is addressable.
659661
ctypes.c_float.from_address(helper.cptr).value = 3.14
660662
assert ctypes.c_float.from_address(helper.cptr).value == pytest.approx(3.14, rel=1e-5)

0 commit comments

Comments
 (0)