Skip to content

Commit 89d5497

Browse files
larsgebclaude
andcommitted
Fix CI: restore paravirtual skip for test_01, add numpy to Ty env
test_01_adder uses newDefaultLibrary() which the paravirtual CI GPU cannot load (results are silently all-zero regardless of array size), while tests 02 and 03 load their metallib explicitly and run fine. Restore the SKIP_RETURN_CODE 77 path; keep the 10K array override so the test executes quickly on real Apple Silicon. uvx --with numpy ty check: Ty needs numpy installed to resolve the 'from numpy import ndarray' stub import. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 038557e commit 89d5497

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: uvx ruff format --check python/ demo.py wave_demo.py
5656

5757
- name: Ty type check
58-
run: uvx ty check python/
58+
run: uvx --with numpy ty check python/
5959

6060
python-bindings:
6161
name: Python bindings smoke test (Apple Silicon, Metal)

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ set_target_properties(test_01_adder PROPERTIES
204204
add_test(NAME test_01_adder COMMAND test_01_adder
205205
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/01-MetalAdder"
206206
)
207+
# newDefaultLibrary() doesn't work on the CI paravirtual GPU; skip gracefully.
208+
set_tests_properties(test_01_adder PROPERTIES SKIP_RETURN_CODE 77)
207209

208210
add_executable(test_02_1d_ops
209211
tests/test_02_1d_ops.cpp

tests/test_01_adder.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,18 @@ int main()
2424
std::cerr << "FAIL: No Metal device found." << std::endl;
2525
return 1;
2626
}
27-
std::cout << "Running on " << device->name()->utf8String() << std::endl;
27+
std::string deviceName = device->name()->utf8String();
28+
std::cout << "Running on " << deviceName << std::endl;
29+
30+
// MetalAdder uses newDefaultLibrary() which the Apple Paravirtual device
31+
// cannot load correctly — results are silently all-zero regardless of size.
32+
// Tests 02 and 03 load their metallib explicitly and run fine on the VM.
33+
if (deviceName.find("Paravirtual") != std::string::npos)
34+
{
35+
std::cout << "SKIP: newDefaultLibrary() not supported on Paravirtual device." << std::endl;
36+
device->release();
37+
return 77; // CTest SKIP_RETURN_CODE
38+
}
2839

2940
MetalAdder *adder = new MetalAdder(device);
3041

0 commit comments

Comments
 (0)