coverage: add cuda.core tests for host, launcher cluster, strided layout, program-cache, and DLPack utils#2168
coverage: add cuda.core tests for host, launcher cluster, strided layout, program-cache, and DLPack utils#2168rluo8 wants to merge 2 commits into
Conversation
…out, program-cache, and DLPack utils
|
rwgk
left a comment
There was a problem hiding this comment.
I glanced through manually and asked GPT-5.5 to do a full review. This looks solid to me. Great to see that our coverage numbers are getting significantly better.
mdboom
left a comment
There was a problem hiding this comment.
@rluo8: Thanks for this. It's really nice to see coverage improve.
These all look fine to me except the ones in test_utils.py. Rather than holding the rest of this up, could you remove those changes, and the submit test_utils.py alone as it's on PR? I'll comment on what I think could be improved there.
There was a problem hiding this comment.
FYI, I mentioned in our team sync today. _StridedLayout is currently not exposed to the public, so all of these complexity is not touching the public API surface. In the near future we'll need to discuss if we still want to keep this object in cuda.core since in addition to maintenance burden it also adds to performance overhead (of creating StridedMemoryView), and if we decide to remove it all of these tests will be deleted right away.
As a result, I would recommend to not expand the tests here, although I don't feel strongly (since this file is already awfully long, before this PR).
Description
Tests covered:
test_host.pyreprfor all threeHostforms; pickle/copy round-trip preserves the singleton via__reduce___host.pytest_launcher.pyDevicemocked); cluster branch of_to_native_launch_config_launch_config.pyxtest_program_cache.pyFileStreamsize-cap__delitem__/clear, entry-path iteration with missing/stray dirs, tmp-size accounting,touch_atimefallback + swallowed open/fstat failuresutils/_program_cache/_file_stream.pytest_strided_layout.pydense_like, repr-with-offset, min/max offset,broadcast_to,unsqueezed,repackedpack/unpack,max_compatible_itemsize_layout.pyxtest_utils.pyas_tensor_mapkwargs assembly; DLPack export round-trip over all NumPy-native dtypes + scalar/zero-volume shapes; versioned/unversioned capsule deleters;from_dlpackTypeError→unversioned fallback; CAI device-pointer/stream-ordering; DLPack C-exchange-API helpers_memoryview.pyxCoverage impact
Measured with paired full-coverage runs (no-patch baseline vs this patch):
cuda/core/overall_memoryview.pyx_host.py_launch_config.pyx_layout.pyx_file_stream.pyTesting