You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(cuda.core): untangle the cached IPC pointer import - #3549
Readability follow-up to #3511. Part 3 of 4 (stack: #3547 → #3548 → #3549 → #3552). No behavior change.
In deviceptr_import_ipc(), the cache's factory lambda wrote two loose outer variables that a third lambda reported from later, and the discard was written twice.
DiscardedIpcImport: one value for a failed discard. Made under the cache's mutex with the raw p_ call, reported after the mutex is released.
DeleteIpcPtrBox: the box's deleter, named, in place of a lambda in the constructor call.
resource != 0 is now holds_import().
Same driver calls under the same lock. The raw p_ calls keep their // raw: marks, which tests/test_rt_layout.py checks.
Testing
Top of the stack: the full cuda_core test suite passes on an RTX 5880 Ada (cu13), except test_object_code_load_rdc*, which cannot build its fixture on my machine (system nvcc rejects the environment's gcc).
clang-tidy clean, pre-commit clean.
No new tests: the existing tests cover this path.
PLC Local Security Evidence (Advisory)
Local advisory checks only, run over the whole stack. Not release-gate results.
Check
Status
Tool
Details
Secrets
SKIP
Pulse Secret Scanner
registry login failed locally; the repo trufflehog pre-commit hook passed
The cache's factory lambda wrote two loose outer variables that a third
lambda later reported from, and the discard was written twice. A failed
discard is now one value, DiscardedIpcImport, made under the cache's
mutex and reported after it. The box's deleter is the named
DeleteIpcPtrBox, and "resource != 0" becomes holds_import().
Same driver calls under the same lock. No behavior change.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Rob Parolin <rparolin@nvidia.com>
tests/test_rt_layout.py requires every raw p_ driver call to carry the
mark. The previous commit folded the marks into a block comment.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Rob Parolin <rparolin@nvidia.com>
Reviewing files that changed from the base of the PR and between f721c5a and 7aa6964.
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
Bug Fixes
Improved cleanup of cached device memory imports when import setup or deallocation-stream recording fails. Cleanup failures are now reported, and unsuccessful imports are discarded before setup continues.
Cached imports are released and removed from the registry when their owning resource is destroyed, helping prevent stale cache entries.
The IPC import path adds a dedicated deleter for cached imports. When deallocation-stream setup fails or throws, it discards the import under the cache mutex and reports free failures after releasing the mutex.
Changes: IPC import cleanup
Layer / File(s)
Summary
IPC import lifecycle and cleanup cuda_core/cuda/core/_cpp/rt/memory.cpp
A dedicated deleter frees cached imports and releases their cache entries. If stream recording fails or throws, the import is discarded under the cache mutex, and any free failure is reported after unlocking.
Suggested reviewers:juenglin, andy-jost, mdboom
Change: Refactor
Merge Risk: Minimal · previous review 6d231
This refactor of the IPC import cleanup path is not expected to change behavior. No merge-blocking risks were identified.
Security architecture risk: Minimal · up to 6d231
The refactor preserves who can import CUDA IPC pointers, when the cache takes ownership, and how cleanup failures are handled. No new design-level risk was identified.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 566ac1f and 6d23190.
Files selected for processing: 1
cuda_core/cuda/core/_cpp/rt/memory.cpp
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cuda.coreEverything related to the cuda.core moduleenhancementAny code-related improvements
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Readability follow-up to #3511. Part 3 of 4 (stack: #3547 → #3548 → #3549 → #3552). No behavior change.
In
deviceptr_import_ipc(), the cache's factory lambda wrote two loose outer variables that a third lambda reported from later, and the discard was written twice.DiscardedIpcImport: one value for a failed discard. Made under the cache's mutex with the rawp_call, reported after the mutex is released.DeleteIpcPtrBox: the box's deleter, named, in place of a lambda in the constructor call.resource != 0is nowholds_import().Same driver calls under the same lock. The raw
p_calls keep their// raw:marks, whichtests/test_rt_layout.pychecks.Testing
cuda_coretest suite passes on an RTX 5880 Ada (cu13), excepttest_object_code_load_rdc*, which cannot build its fixture on my machine (system nvcc rejects the environment's gcc).PLC Local Security Evidence (Advisory)
Local advisory checks only, run over the whole stack. Not release-gate results.
Checklist
🤖 Generated with Claude Code