Skip to content

test(cuda.core): don't collect host-callback-ctypes for the wrong-type update test - #3648

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

mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue3571

Conversation

@mdboom

@mdboom mdboom commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Closes #3571. Part of #2077.

Summary

test_definition_node_update_rejects_wrong_type skipped every definition_update_case whose invalid_argument_update is None. Only the ctypes host-callback case has none, so [host-callback-ctypes] never ran anywhere.

A ctypes callback's update() takes any callable. Its own type check (a mismatched ctypes prototype raises TypeError) is already covered by test_graph_definition.py::test_host_callback_ctypes_update_rejects_incompatible_signature. So this test no longer collects that case, rather than duplicating that check:

-@pytest.fixture(params=[...13 cases...])
-def definition_update_case(request, init_cuda): ...
+_DEFINITION_UPDATE_CASES = [...13 cases...]
+
+@pytest.fixture(params=_DEFINITION_UPDATE_CASES)
+def definition_update_case(request, init_cuda): ...
+
+@pytest.fixture(params=[p for p in _DEFINITION_UPDATE_CASES if p.id != "host-callback-ctypes"])
+def definition_update_case_with_typed_argument(request, init_cuda): ...

 def test_definition_node_update_rejects_wrong_type(
-    definition_update_case,
+    definition_update_case_with_typed_argument,
 ):
-    if case.invalid_argument_update is None:
-        pytest.skip("update method has no typed positional argument")
+    assert case.invalid_argument_update is not None

The two fixtures share their setup (the CUDA 12.2 driver check and per-call case construction). The "not currently run in any CI job" marker is removed. Every other definition_update_case test still runs all 13 cases, including host-callback-ctypes.

Evidence

CI coverage: on main, the other 12 cases of this test pass in all 65 CI configurations that run it, and [host-callback-ctypes] skips in all 65. After this change the test collects only those 12, so it skips nowhere.

Locally: 12 cases are collected (no ctypes case) and pass, and the whole file passes.

Confirming in CI: in this PR's CI run, no cuda.core job should report test_definition_node_update_rejects_wrong_type[host-callback-ctypes], and the other 12 cases should report PASSED. For example:

gh run view <CI run id> --repo NVIDIA/cuda-python --log | grep -F "test_definition_node_update_rejects_wrong_type" | grep -c SKIPPED   # expect 0

Merge Danger

Door: two-way. Test-only change.

Blast Radius: one test in cuda_core/tests/graph/test_graph_node_update.py. Every case that ran before still runs.

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

🤖 Generated with Claude Code

…e update test

test_definition_node_update_rejects_wrong_type skipped every case whose
invalid_argument_update is None. Only the ctypes host-callback case has
none, so test_definition_node_update_rejects_wrong_type[host-callback-ctypes]
never ran. A ctypes callback's update takes any callable; its prototype
check is already covered by
test_host_callback_ctypes_update_rejects_incompatible_signature.

Run this test over definition_update_case_with_typed_argument, which
leaves out the ctypes case and shares setup with definition_update_case,
and assert instead of skipping. Remove the "not currently run in any CI
job" marker.

Closes NVIDIA#3571.

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
    • Expanded validation of graph node updates across supported argument types, including cases with typed positional arguments. The test suite also continues to check driver compatibility for these scenarios. These changes improve confidence in the reliability of graph node updates and do not alter user-facing behavior.

The graph node update tests now share a definition-case list and factory. A second fixture excludes the ctypes host-callback case, and the wrong-type test uses that fixture instead of skipping cases without an invalid-argument update.

Changes: Graph update test coverage

Layer / File(s) Summary
Case fixtures and wrong-type validation
cuda_core/tests/graph/test_graph_node_update.py
The fixtures share the 13 update cases and a factory that retains the CUDA 12.2+ driver check and per-call Device construction. A typed-argument fixture excludes host-callback-ctypes. The wrong-type test uses this fixture and no longer skips cases without an invalid-argument update.

Assessment against linked issues

Objective Addressed Explanation
[#3571] Exclude host-callback-ctypes from the wrong-type test or give it a real wrong-type check, and remove the marker comment. ✅

Suggested reviewers: andy-jost

Change: Other · Severity of issue fixed: Low

Merge Risk: Minimal · up to 96bd4

This change only reorganizes graph update tests so the wrong-type test no longer includes a case it cannot check. It does not affect runtime behavior, and no merge-blocking risk remains.

Security architecture risk: Minimal · up to 96bd4

The wrong-type test no longer collects the ctypes callback case that it previously skipped. The full update-test matrix and CUDA Core runtime behavior are unchanged.

- [ ] 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 96bd4b3.

Files selected for processing: 1

  • cuda_core/tests/graph/test_graph_node_update.py

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

@github-actions

Copy link
Copy Markdown
Contributor

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

sol 6.1 high finds no problems, this lgtm.

@mdboom
mdboom merged commit d7af1aa into NVIDIA:main Nov 30, 2026
122 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): host-callback-ctypes case of test_definition_node_update_rejects_wrong_type never runs

2 participants