Skip to content

coverage: add cuda.core tests for host, launcher cluster, strided layout, program-cache, and DLPack utils - #2168

Merged
mdboom merged 4 commits into
NVIDIA:mainfrom
rluo8:main
Jun 9, 2026
Merged

coverage: add cuda.core tests for host, launcher cluster, strided layout, program-cache, and DLPack utils#2168
mdboom merged 4 commits into
NVIDIA:mainfrom
rluo8:main

Conversation

@rluo8

@rluo8rluo8 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Description

Tests covered:

FileNew testsTarget source
test_host.pyrepr for all three Host forms; pickle/copy round-trip preserves the singleton via __reduce___host.py
test_launcher.pythread-block-cluster cc gate (accept ≥9.0 / reject <9.0, Device mocked); cluster branch of _to_native_launch_config_launch_config.pyx
test_program_cache.pyFileStream size-cap __delitem__/clear, entry-path iteration with missing/stray dirs, tmp-size accounting, touch_atime fallback + swallowed open/fstat failuresutils/_program_cache/_file_stream.py
test_strided_layout.pyvalidation/error paths: dense_like, repr-with-offset, min/max offset, broadcast_to, unsqueezed, repacked pack/unpack, max_compatible_itemsize_layout.pyx
test_utils.pyas_tensor_map kwargs assembly; DLPack export round-trip over all NumPy-native dtypes + scalar/zero-volume shapes; versioned/unversioned capsule deleters; from_dlpack TypeError→unversioned fallback; CAI device-pointer/stream-ordering; DLPack C-exchange-API helpers_memoryview.pyx

Coverage impact

Measured with paired full-coverage runs (no-patch baseline vs this patch):

ScopeBeforeAfterΔ
cuda/core/ overall79.81%81.84%+2.03% (−213 missed)
_memoryview.pyx65.82%85.73%+19.92%
_host.py83.64%100.00%+16.36%
_launch_config.pyx77.46%91.55%+14.08%
_layout.pyx89.59%96.23%+6.64%
_file_stream.py84.51%90.49%+5.99%

Testing

  • Full local run on py314: all added tests pass.
  • Cross-platform on local GPU runners: Linux x64 + Windows x64, green.
  • Additionally verified on a B100 windows + Tesla T4 host.

@github-actionsgithub-actionsBot added the cuda.core Everything related to the cuda.core module label Jun 5, 2026
@github-actions

This comment has been minimized.

@leofangleofang added CI/CD CI/CD infrastructure P1 Medium priority - Should do labels Jun 5, 2026
@leofangleofang added this to the cuda.core v1.1.0 milestone Jun 5, 2026
@rluo8
rluo8 requested review from mdboom and rwgkJune 8, 2026 01:05
rwgk
rwgk approved these changes Jun 8, 2026

@rwgkrwgk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rwgkrwgk added the PR review get-together Mark PRs you'd like the team to review at the weekly PR review get-together. label Jun 8, 2026

@mdboommdboom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Leo. I have removed the tests in test_strided_layout.py.

@rluo8

rluo8 commented Jun 9, 2026

Copy link
Copy Markdown
ContributorAuthor

@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.

Thanks Mike. I have removed the test_utils.py changes, and created a new PR #2181.

@rluo8
rluo8 requested a review from mdboomJune 9, 2026 01:35
@mdboom
mdboom merged commit 788bbad into NVIDIA:mainJun 9, 2026
96 checks passed
@github-actions

Copy link
Copy Markdown
Doc Preview CI
Preview removed because the pull request was closed or merged.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CDCI/CD infrastructurecuda.coreEverything related to the cuda.core moduleP1Medium priority - Should doPR review get-togetherMark PRs you'd like the team to review at the weekly PR review get-together.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@rluo8@mdboom@rwgk@leofang