Skip to content

coverage: add cuda.core tests for graph, IPC, launcher, program, and DLPack - #2728

Open
rluo8 wants to merge 1 commit into
NVIDIA:mainfrom
rluo8:test/expand-cuda-core-coverage
Open

coverage: add cuda.core tests for graph, IPC, launcher, program, and DLPack#2728
rluo8 wants to merge 1 commit into
NVIDIA:mainfrom
rluo8:test/expand-cuda-core-coverage

Conversation

@rluo8

@rluo8 rluo8 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds focused unit tests across cuda.core, targeting input-validation branches, error paths, and object-lifecycle behavior that were previously uncovered. All tests are real-path: host-only tests exercise pure helpers / argument validation directly, and GPU-required tests use the existing fixtures and skips. No production changes.

Measured effect on cuda/core/ line coverage: about +1.65%, +208 lines. Largest gains in _program.pyx, graph/_subclasses.pyx, _memory/_ipc.pyx, _memoryview.pyx, _kernel_arg_handler.pyx, and graph/_graph_builder.pyx.
Note that the coverage numbers are for cuda/core/ only, combined across local systems with Linux, Windows, H800, B10, and B100.

File Tests
graph/test_graph_builder.py join type check; __cuda_stream__ after close; capture guards (end_building / debug_dot_print / callback / create_condition / embed / if_then); factory-only GraphBuilder/Graph; close() ends an active capture
graph/test_graph_definition.py HOST AllocNode reconstructs memory_type from the driver via a pred walk (CUDA_ERROR_NOT_SUPPORTED skip)
graph/test_graph_definition_lifetime.py pred-chain _create_from_driver for memcpy / event record / event wait / free
graph/test_graph_node_update.py memset/memcpy owner + no-op + 2D geometry updates; factory-only ExecutableGraphNode; executable-node repr; clustered/cooperative update reject; ctypes host-callback repr
memory_ipc/test_errors.py factory-only IPC types; raw-fd from_allocation_handle; ForkingPickler fd dup; registry dedup of repeated imports (Linux)
test_launcher.py numpy scalar-subclass prepare_numpy_arg fallback (kernel readback); CUgraphConditionalHandle packed as uint64
test_memory.py Buffer() forbidden; context-manager close; abstract MemoryResource stubs; copy_to() without a memory resource
test_optional_dependency_imports.py NVVM import rejects cuda-bindings < 12.9 and caches the failure
test_program.py nested define_macro error; each NVVM-unsupported option; NVRTC as_bytes sequence flags; debug temp-write fallback; use_libdevice resolves __nv_sin
test_utils.py CAI-only proxy .view(); view(dtype=) itemsize mismatch
test_utils_dlpack.py CPU array-interface export; Buffer re-view owner reuse; CUDA stream=None; versioned readonly; malformed dtype; C-exchange API NULL/scalar/device-accessible cases

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Aug 28, 2026
@rluo8
rluo8 requested review from Andy-Jost and mdboom August 28, 2026 09:23
…DLPack

Signed-off-by: Rui Luo <ruluo@nvidia.com>
@rluo8
rluo8 force-pushed the test/expand-cuda-core-coverage branch from 1dab946 to 21f1913 Compare August 28, 2026 09:27
@rluo8 rluo8 self-assigned this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant