Skip to content

add stream capture checks for MemPool APIs and tests - #10166

Open
lttamd wants to merge 12 commits into
developfrom
users/lttamd/mempool-sc-checks
Open

lttamd wants to merge 12 commits into
developfrom
users/lttamd/mempool-sc-checks

Conversation

@lttamd

@lttamd lttamd commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

add stream capture checks and tests for MemPool APIs

Technical Details

Add CHECK_STREAM_CAPTURE_SUPPORTED() to 11 MemPool API functions
so they return hipErrorStreamCaptureUnsupported when called
during non-relaxed stream capture.

Add corresponding stream capture tests for each affected API:
hipMemPoolTrimTo, hipMemPoolSetAttribute, hipMemPoolGetAttribute,
hipMemPoolSetAccess, hipMemPoolGetAccess, hipMemPoolCreate,
hipMemPoolDestroy, hipMemPoolExportToShareableHandle,
hipMemPoolImportFromShareableHandle, hipMemPoolExportPointer,
hipMemPoolImportPointer.

Issue Tracking

ROCM-22689

Test Plan

The tests in this PR

Test Result

Passed with the clr change in this PR.

Submission Checklist

Copilot AI lite review requested due to automatic review settings August 14, 2026 11:25
@lttamd
lttamd requested a review from a team as a code owner August 14, 2026 11:25
@therock-pr-bot

therock-pr-bot Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
📝 PR Description ❌ Fail Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
• JIRA ID : TESTAUTO-6039
• JIRA ID - #330
• JIRA ID #330
• JIRA ID (on separate line)
ROCM-25757
• ISSUE ID : TESTUTO-3334
• ISSUE ID #3334
• ISSUE ID - TESTAUTO-3433
• ISSUE ID (on separate line)
AIRUNTIME-2352
• ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
• Closes #10
• Fixes octo-org/octo-repo#100
• Resolves: #123
• #123
• https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/clr/hipamd/src/hip_mempool.cpp, projects/hip-tests/catch/unit/memory/hipMemPoolCreate.cc, projects/hip-tests/catch/unit/memory/hipMemPoolDestroy.cc, projects/hip-tests/catch/unit/memory/hipMemPoolExportPointer.cc, projects/hip-tests/catch/unit/memory/hipMemPoolExportToShareableHandle.cc (+5 more); no test file found
🔎 pre-commit ⏳ Pending ⏳ Still running…
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Description

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

Copilot AI 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.

Pull request overview

Adds new Catch2 unit tests in the HIP test suite to validate expected behavior of several MemPool APIs when invoked during stream capture (relaxed mode allowed; global/thread-local modes return hipErrorStreamCaptureUnsupported).

Changes:

  • Added new *_Capture test cases for multiple MemPool APIs (create/destroy/trim/set-get attribute/set-get access/export/import).
  • Registered the new tests in catch/config/configs/unit/memory.yaml with [alloc, capture] tags.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/hip-tests/catch/unit/memory/hipMemPoolTrimTo.cc Adds Unit_hipMemPoolTrimTo_Capture stream-capture behavior test.
projects/hip-tests/catch/unit/memory/hipMemPoolSetGetAttribute.cc Adds Unit_hipMemPoolSetAttribute_Capture and Unit_hipMemPoolGetAttribute_Capture tests.
projects/hip-tests/catch/unit/memory/hipMemPoolSetGetAccess.cc Adds Unit_hipMemPoolSetAccess_Capture and Unit_hipMemPoolGetAccess_Capture tests.
projects/hip-tests/catch/unit/memory/hipMemPoolImportPointer.cc Adds Unit_hipMemPoolImportPointer_Capture test.
projects/hip-tests/catch/unit/memory/hipMemPoolImportFromShareableHandle.cc Adds Unit_hipMemPoolImportFromShareableHandle_Capture test.
projects/hip-tests/catch/unit/memory/hipMemPoolExportToShareableHandle.cc Adds Unit_hipMemPoolExportToShareableHandle_Capture test.
projects/hip-tests/catch/unit/memory/hipMemPoolExportPointer.cc Adds Unit_hipMemPoolExportPointer_Capture test.
projects/hip-tests/catch/unit/memory/hipMemPoolDestroy.cc Adds Unit_hipMemPoolDestroy_Capture test.
projects/hip-tests/catch/unit/memory/hipMemPoolCreate.cc Adds Unit_hipMemPoolCreate_Capture test.
projects/hip-tests/catch/config/configs/unit/memory.yaml Registers the new capture tests and tags them.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread projects/hip-tests/catch/unit/memory/hipMemPoolTrimTo.cc Outdated
@lttamd
lttamd force-pushed the users/lttamd/mempool-sc-checks branch from 55ac8c4 to 457afee Compare August 18, 2026 09:14
@lttamd
lttamd requested a review from a team as a code owner August 18, 2026 09:14
@lttamd lttamd changed the title add stream capture tests for MemPool APIs add stream capture checks for MemPool APIs and tests Aug 18, 2026
@lttamd
lttamd force-pushed the users/lttamd/mempool-sc-checks branch 4 times, most recently from b1fd4aa to a786bc9 Compare August 22, 2026 08:05
Add CHECK_STREAM_CAPTURE_SUPPORTED() to 11 MemPool API functions
so they return hipErrorStreamCaptureUnsupported when called
during non-relaxed stream capture.

Add corresponding stream capture tests for each affected API:
hipMemPoolTrimTo, hipMemPoolSetAttribute, hipMemPoolGetAttribute,
hipMemPoolSetAccess, hipMemPoolGetAccess, hipMemPoolCreate,
hipMemPoolDestroy, hipMemPoolExportToShareableHandle,
hipMemPoolImportFromShareableHandle, hipMemPoolExportPointer,
hipMemPoolImportPointer.
@lttamd
lttamd force-pushed the users/lttamd/mempool-sc-checks branch from a786bc9 to 5bf43e8 Compare August 24, 2026 08:42

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

🤖 AI-assisted pre-review (for @mangupta)

[IMPORTANT] Public-API behavior change has no contract test / uncovered_apis rationale and TEST_PLAN.md is not regenerated

The PR changes a public-API invariant for eleven APIs (they must now return hipErrorStreamCaptureUnsupported during non-relaxed capture) but adds coverage only under catch/unit/memory/. There is no projects/hip-tests/catch/contract/ test with an @asserts: API - invariant annotation, no entry added to projects/hip-tests/catch/contract/uncovered_apis.txt, and no update to the generated projects/hip-tests/catch/TEST_PLAN.md even though the test configuration (catch/config/configs/unit/memory.yaml) changed.

Suggested fix: Add a catch/contract/ test asserting the capture invariant for the affected mempool APIs (using the format in catch/contract/AUTHORING.md), or record a concrete rationale in catch/contract/uncovered_apis.txt, and regenerate catch/TEST_PLAN.md so it reflects the new cases and config entries.

Comment thread projects/hip-tests/catch/config/configs/unit/memory.yaml
Comment thread projects/hip-tests/catch/config/configs/unit/memory.yaml
Comment thread projects/clr/hipamd/src/hip_mempool.cpp
Comment thread projects/hip-tests/catch/unit/memory/hipMemPoolTrimTo.cc
Comment thread projects/clr/hipamd/src/hip_mempool.cpp
@mangupta

mangupta commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

🤖 AI-assisted pre-review (for @mangupta)

Re-reviewed the updated head (0ffdf6661a6f) — no new findings at or above the posting threshold.

@mangupta

mangupta commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🤖 AI-assisted pre-review (for @mangupta)

Re-reviewed the updated head (73a9e7d99063) — no new findings at or above the posting threshold.

@mangupta

Copy link
Copy Markdown
Contributor

🤖 AI-assisted pre-review (for @mangupta)

Re-reviewed the updated head (2f7447f785da) — no new findings at or above the posting threshold.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants