Skip to content

[hip-tests] Standardize test level discovery - #8932

Merged
amilanov-amd merged 5 commits into
developfrom
users/amilanov/hip_tests_standardize_level_discovery
Sep 28, 2026
Merged

amilanov-amd merged 5 commits into
developfrom
users/amilanov/hip_tests_standardize_level_discovery

Conversation

@amilanov-amd

@amilanov-amd amilanov-amd commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Currently, it is not strictly clear with which level hip-tests will be executed with, due to a lot of ways they can be actually executed.

Technical Details

Standardize to three possible ways:

  1. Catch2 command-line tag filter, e.g. ./test "[level_2]"
  2. HIP_TEST_LEVEL environment variable, e.g. HIP_TEST_LEVEL=level_2
  3. Hardcoded default (kDefaultLevel)

Remove all other invisible, non-deterministic, fallbacks.

Define level_2 as default level, using its parameters for test execution.

Define a strategy to determine level when multiple are passed - highest order wins (used for test parameters).

Issue Tracking

Test Plan

Ensure build passes. All tests pass

Test Result

Local build passed, local tests pass

Submission Checklist

@amilanov-amd
amilanov-amd requested a review from a team as a code owner July 21, 2026 14:45
Copilot AI review requested due to automatic review settings July 21, 2026 14:45
@therock-pr-bot

therock-pr-bot Bot commented Jul 21, 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 ✅ Pass —
🔎 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

therock-pr-bot Bot commented Jul 21, 2026 •

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

This PR standardizes how hip-tests resolves a single “test level” for an entire Catch2 run, making level selection deterministic (CLI tag filter → HIP_TEST_LEVEL → hardcoded default) and aligning fallback/default parameters with level_2 from definitions.yaml.

Changes:

  • Updated TestParameterStore fallback parameters to mirror level_2 (sizes, block sizes, iterations, warmups, max memory).
  • Removed prior “level_0-or-hardcoded” default initialization logic in TestParameterStore::initialize().
  • Reworked the Catch2 event listener to resolve the run’s level once at startup with strict precedence, validate it against a supported set, and apply it globally.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
projects/hip-tests/catch/include/hip_test_params.hh Updates hardcoded fallback parameters to match level_2 defaults.
projects/hip-tests/catch/hipTestMain/hip_test_params.cc Removes prior fallback-default selection logic in initialization.
projects/hip-tests/catch/hipTestMain/hip_test_listener.cc Implements strict, single-pass level resolution (CLI → env → default) and global application at run start.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@amilanov-amd
amilanov-amd force-pushed the users/amilanov/hip_tests_standardize_level_discovery branch from 27907fa to fe98b75 Compare July 28, 2026 15:22
@amilanov-amd
amilanov-amd force-pushed the users/amilanov/hip_tests_standardize_level_discovery branch 2 times, most recently from 26e305e to 86d831e Compare August 10, 2026 09:56
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label Sep 8, 2026
@amilanov-amd
amilanov-amd force-pushed the users/amilanov/hip_tests_standardize_level_discovery branch from 86d831e to d49c43d Compare September 8, 2026 13:32
@github-actions github-actions Bot removed the Stale PR has no activity for 25+ days label Sep 9, 2026

@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] New level-resolution grammar and fatal misconfiguration path have no test coverage and are not testable as written

This change replaces a one-line regex extraction with a multi-rule parser (comma-split OR filters, AND'd patterns, ~ negation, exclusion-only filters expanding to the full supported set, bare-tag mode only for the environment variable, strict level_N matching, highest-wins reduction) plus a new fatal std::exit(EXIT_FAILURE) path, and no test exercises any of it. The helpers are private statics inside the .cc with no header, so they cannot be unit-tested without a refactor, and a silent mis-resolution changes the parameters of every parameterized test in the suite rather than failing loudly.

Suggested fix: Move collectLevels()/highestLevel()/isSupportedLevel() into a small internal header (or an anonymous-namespace-free helper compiled into the test main) and add a Catch2 test case covering the four scenarios above, asserting the resolved level string for each input rather than only the final run parameters. Alternatively, if the fatal path cannot be unit-tested in-process, cover it with a ctest WILL_FAIL/expected-exit-code test that runs the binary with HIP_TEST_LEVEL=level_9.

@amilanov-amd
amilanov-amd requested a review from a team as a code owner September 18, 2026 12:50
@amilanov-amd
amilanov-amd force-pushed the users/amilanov/hip_tests_standardize_level_discovery branch from bd48524 to c9d3a30 Compare September 21, 2026 13:04
@amilanov-amd
amilanov-amd merged commit 7192381 into develop Sep 28, 2026
41 of 45 checks passed
@amilanov-amd
amilanov-amd deleted the users/amilanov/hip_tests_standardize_level_discovery branch September 28, 2026 13:26
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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