Skip to content

test(cuda.core): stop parametrizing pool-only IPC tests over VirtualMemoryResource - #3645

Merged
mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue3568
Nov 30, 2026
Merged

mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue3568

Conversation

@mdboom

@mdboom mdboom commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Closes #3568. Part of #2077.

Summary

Pool-only IPC tests were parametrized over VirtualMemoryResource, which has no allocation handles, registry, uuid, or pool import. Their VirtualMR cases skipped at runtime on every runner, so they could never run. They now use pool-only fixtures, so those cases are no longer collected.

 cuda_core/tests/conftest.py
   ipc_memory_resource             [DeviceMR, PinnedMR, VirtualMR]
+  ipc_pool_memory_resource        [DeviceMR, PinnedMR]
   ipc_memory_resource_factory     [DeviceMR, VirtualMR]
+  ipc_pool_memory_resource_factory [DeviceMR]
   (all four share one setup/teardown helper per kind)

 pool-only tests
-  ipc_memory_resource + `if not is_pool_resource(mr): pytest.skip(...)`
+  ipc_pool_memory_resource
  • test_errors.py: the registry and allocation-handle tests use the pool fixtures. ChildErrorHarness.POOL_ONLY is replaced by a class-level ipc_memory_resource override in TestDanglingBuffer.
  • test_ipc_pool_kind.py, test_ipc_pool_duplicate_import.py: the class-local pool_resource fixtures, which skipped VirtualMR, are replaced by ipc_pool_memory_resource.
  • test_leaks.py: test_alloc_handle uses the pool fixture. The alloc_handle case of test_pass_object becomes test_pass_alloc_handle, so test_pass_object keeps its 9 runnable VirtualMR cases.
  • test_send_buffers.py::TestIpcReexport, test_workerpool.py::TestIpcWorkerPoolUsingRegistry: pool fixtures. The VMM limits behind their old skips already have negative tests (test_vmm_ipc.py::TestReexport, and the VirtualMR cases of the other worker-pool tests).
  • test_register_keeps_the_uuid_object_the_resource_already_has had the same never-runs VirtualMR skip. It wasn't in the issue's list, but is included.
  • The "not currently run in any CI job" markers on these cases are removed.

Evidence

Collected test IDs, main vs this branch:

  • 33 VirtualMR cases that could never run are no longer collected. The issue counted 22; test_ipc_pool_duplicate_import.py has gained tests since (18 there now).
  • Every DeviceMR/PinnedMR ID is unchanged, except that the 6 test_pass_object[...-alloc_handle] IDs are now test_pass_alloc_handle[...].

cuda_core/tests/memory_ipc locally (Linux, RTX 5070 + RTX A400), main vs this branch:

  • main: 161 passed, 42 skipped, 14 failed.
  • This branch: 161 passed, 27 skipped, 14 failed.

The failure sets are identical: they come from a stale local cuda.core build, not this change. test_ipc_pool_duplicate_import.py can't be imported with that build, so it was excluded from both runs and checked by collection only.

Confirming in CI: in this PR's CI run, the Linux core jobs should report no [VirtualMR IDs for the tests above, and should report their DeviceMR/PinnedMR cases PASSED as on main. For example:

gh run view <CI run id> --repo NVIDIA/cuda-python --log | grep -E "test_pass_alloc_handle|TestDanglingBuffer|TestIpcPoolDuplicateImport" | grep -c VirtualMR   # expect 0

Merge Danger

Door: two-way. Test-only change.

Blast Radius: cuda_core/tests/memory_ipc. No test that ran before stops running; only always-skipped cases disappear, and 6 test IDs are renamed.

Reviewers: please feel free to push commits directly to this PR to improve it.

🤖 Generated with Claude Code

…emoryResource

Many memory IPC tests use the pool half of the IPC protocol (allocation
handles, from_allocation_handle, the registry, uuid, pool import). A
VirtualMemoryResource has none of these, so their VirtualMR cases skipped
at runtime on every runner and could never run.

Add ipc_pool_memory_resource (DeviceMR, PinnedMR) and
ipc_pool_memory_resource_factory (DeviceMR) to conftest.py, sharing setup
and teardown with the existing fixtures, and use them in the pool-only
tests. This replaces the in-body skips, the ChildErrorHarness POOL_ONLY
flag, and the class-local pool_resource fixtures. Split the alloc_handle
case of test_pass_object into test_pass_alloc_handle so its other VirtualMR
cases keep running. Remove the "not currently run in any CI job" markers
on these cases.

Closes NVIDIA#3568.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdboom mdboom added this to the cuda.core 1.4.0 milestone Nov 30, 2026
@mdboom mdboom added test Improvements or additions to tests cuda.core Everything related to the cuda.core module labels Nov 30, 2026
@mdboom mdboom self-assigned this Nov 30, 2026
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated IPC memory tests to use resource types suited to each scenario, reducing reliance on skipped test cases.
    • Expanded coverage for pool-based buffer imports, exports, allocation handles, and resource cleanup.
    • Added coverage for error cases and resource leaks across IPC workflows.
    • Clarified test coverage boundaries for virtual-memory resources and CUDA driver support.

Pool-only IPC tests now use dedicated fixtures for device and pinned pool resources. Tests that require pool-specific IPC operations no longer include VirtualMemoryResource cases that were skipped at runtime.

Changes: Pool-only IPC test fixtures

Layer / File(s) Summary
Shared IPC fixture setup
cuda_core/tests/conftest.py
Shared helpers create and clean up IPC-enabled resources and factories. New pool-only fixtures cover device and pinned resources, and device-resource factories.
Pool-only error tests
cuda_core/tests/memory_ipc/test_errors.py
Error tests and the dangling-buffer harness use pool-only fixtures instead of runtime skips for non-pool resources.
Pool import tests
cuda_core/tests/memory_ipc/test_ipc_pool_duplicate_import.py, cuda_core/tests/memory_ipc/test_ipc_pool_kind.py
Duplicate-import and pool-kind tests use pool-only fixtures for exported buffers, resource types, and allocation handles.
Leak, re-export, and worker-pool tests
cuda_core/tests/memory_ipc/test_leaks.py, cuda_core/tests/memory_ipc/test_send_buffers.py, cuda_core/tests/memory_ipc/test_workerpool.py
Allocation-handle leak checks are separated from other object leak checks. Re-export and registry worker-pool tests use pool-only fixtures.

Assessment against linked issues

Objective Addressed Explanation
Use pool-only fixtures for the pool-specific IPC tests listed in #3568, replacing runtime skips and the pool-only harness flag. ✅
Keep the supported VirtualMemoryResource leak-test cases while testing allocation handles with a pool-only fixture (#3568). ✅

Possibly related PRs

  • NVIDIA/cuda-python#3028: Adds VMM buffer IPC sharing; this PR adjusts test parametrization in the memory IPC suite associated with that work.

Suggested reviewers: andy-jost, juenglin

Change: Other

Merge Risk: Minimal · up to c14a2

This test-only change stops collecting impossible VirtualMemoryResource cases for pool-only IPC tests. It has no production impact, and no concrete merge-blocking risk was found.

Security architecture risk: Minimal · up to c14a2

Pool-only tests now request pool resources directly instead of collecting virtual-memory cases that always skipped. The general fixtures still support virtual-memory tests, and no production behavior change is indicated.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1c9ed66 and c14a2b9.

Files selected for processing: 7

  • cuda_core/tests/conftest.py
  • cuda_core/tests/memory_ipc/test_errors.py
  • cuda_core/tests/memory_ipc/test_ipc_pool_duplicate_import.py
  • cuda_core/tests/memory_ipc/test_ipc_pool_kind.py
  • cuda_core/tests/memory_ipc/test_leaks.py
  • cuda_core/tests/memory_ipc/test_send_buffers.py
  • cuda_core/tests/memory_ipc/test_workerpool.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

@mdboom
mdboom requested review from Andy-Jost and juenglin November 30, 2026 14:51
@github-actions

Copy link
Copy Markdown
Contributor

@mdboom
mdboom merged commit 0c7e6d5 into NVIDIA:main Nov 30, 2026
223 of 225 checks passed
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 test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(cuda.core): stop parametrizing pool-only IPC tests over VirtualMemoryResource

2 participants