Skip to content

Fix conditional graph lifetime tests to use supported nodes - #3469

Merged
Andy-Jost merged 3 commits into
mainfrom
rwgk/fix-conditional-graph-lifetime-tests
Nov 17, 2026
Merged

Andy-Jost merged 3 commits into
mainfrom
rwgk/fix-conditional-graph-lifetime-tests

Conversation

@rwgk

@rwgk rwgk commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

— codex on behalf of Ralf —

Description

Two graph lifetime tests populate conditional bodies with host callback nodes, which violate CUDA's documented body-graph requirements. A development driver rejects this setup with CUDA_ERROR_INVALID_VALUE, so all eight parameterized cases fail before reaching their lifetime assertions.

Use memset nodes with explicit sentinel owners to check attachment retention and release, and empty nodes to check graph and node-handle invalidation. The tests continue to cover if, if_else, while, and switch. The device allocation stays alive until body-node destruction and deferred owner cleanup complete.

Validation

Tested locally on Ubuntu 24.04 x86_64 with Python 3.12:

  • Before the change: all eight affected cases reproduce the setup failure.
  • After the change: all eight pass without skips.
  • Complete graph test suite: 551 passed, 24 skipped.
  • Full pre-commit: all hooks pass except lychee, which reports three existing GitHub 404 links in release notes.

Checklist

  • I have read the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

rwgk added 2 commits November 16, 2026 08:31
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Nov 16, 2026
@rwgk rwgk self-assigned this Nov 16, 2026
@rwgk rwgk added this to the cuda.core 1.3.1 milestone Nov 16, 2026
@rwgk
rwgk marked this pull request as ready for review November 16, 2026 16:51
@rwgk rwgk added the P0 High priority - Must do! label Nov 16, 2026
@rwgk
rwgk requested a review from Andy-Jost November 16, 2026 16:52
@rwgk

rwgk commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9082ea9

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9082ea9 and 94f2721.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated coverage for attachment lifetimes in conditional branches, including release after destroying the parent node.
    • Adjusted branch-handle invalidation tests to use empty nodes.

The conditional-branch lifetime tests now use sentinel owners retained by branch memset attachments and empty branch nodes. They verify that destroying the parent ConditionalNode releases the owners and invalidates the branch nodes.

Changes: Graph definition lifetime tests

Layer / File(s) Summary
Conditional branch lifetime checks
cuda_core/tests/graph/test_graph_definition_lifetime.py
The attachment-release test checks that sentinel owners remain alive before parent destruction and are released afterward. The invalidation test uses empty branch nodes and retains its invalidation assertions.

Suggested labels: test

Suggested reviewers: andy-jost

Change: Other

Merge Risk: Minimal · previous review 9082e

This updates two conditional graph lifetime tests to use supported node types. It does not change production behavior, and no merge-blocking risk was found.

Security architecture risk: Minimal · up to 9082e

The change replaces unsupported test fixtures without changing production graph behavior or security boundaries. No introduced or worsened architecture risk was identified.

- [ ] 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 ba7dcd0 and 9082ea9.

Files selected for processing: 1

  • cuda_core/tests/graph/test_graph_definition_lifetime.py

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

@Andy-Jost Andy-Jost added the to-be-backported Trigger the bot to raise a backport PR upon merge label Nov 16, 2026
@Andy-Jost
Andy-Jost enabled auto-merge (squash) November 17, 2026 00:13
@Andy-Jost

Copy link
Copy Markdown
Contributor

/ok to test 94f2721

@github-actions

Copy link
Copy Markdown
Contributor

@Andy-Jost
Andy-Jost merged commit b80866b into main Nov 17, 2026
122 checks passed
@Andy-Jost
Andy-Jost deleted the rwgk/fix-conditional-graph-lifetime-tests branch November 17, 2026 05:50
Andy-Jost added a commit to Andy-Jost/cuda-python that referenced this pull request Nov 17, 2026
)

* Fix conditional graph lifetime tests to use supported nodes

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>

* ci: require manual copy-pr-bot approval

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>

---------

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Co-authored-by: Andy Jost <ajost@nvidia.com>
(cherry picked from commit b80866b)
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 P0 High priority - Must do! to-be-backported Trigger the bot to raise a backport PR upon merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants