Skip to content

feat(integration-tests): add support-claim loader and enforcement_level plumbing - #10244

Draft
adickin-amd wants to merge 1 commit into
developfrom
users/addickin/support-claims-plumbing
Draft

feat(integration-tests): add support-claim loader and enforcement_level plumbing#10244
adickin-amd wants to merge 1 commit into
developfrom
users/addickin/support-claims-plumbing

Conversation

@adickin-amd

Copy link
Copy Markdown
Contributor

Summary

Implements the RFC 0015 (Per-Graph Engine Support Claims) data-and-plumbing layer in the hipDNN integration-tests harness: an in-memory claim model + loader for the support.json/{Name}.support.json sidecar (single-graph and template-sweep shapes), an enforcement_level field on BundleMetadata, and a bundle-discovery fix so a single-graph support sidecar no longer registers as a spurious test. No enforcement/runner wiring — that is downstream work. JIRA ID : ALMIOPEN-2331

Risk Assessment

Low risk. Additive data model + parser (new files, no existing caller), one field appended to BundleMetadata (default-preserving), and a one-line discovery exclusion-set change. No public API, dispatch, or kernel-selection behavior changes; covered by unit tests with no known gaps.

ASIC Coverage

ASIC-independent plumbing: pure host-side JSON parsing, data model, and file-discovery logic with no kernel selection, dispatch, or default-behavior changes. Standard PR CI is sufficient; no dedicated multi-arch sweep is required.

Testing Summary

  • Local build of hipdnn_integration_tests_unit_tests via the repo superbuild (hipdnn-providers preset), CPU-only.
  • Full existing unit suite re-run after the change to confirm no regressions.
  • New unit tests covering both support-claim loader shapes (single-graph and template-sweep), the enforcement_level metadata field, and the discovery exclusion.

Testing Checklist

  • hipdnn_integration_tests_unit_tests (new/changed tests, filtered) - hipdnn_integration_tests_unit_tests.exe --gtest_filter="TestSupportClaims.*:TestParseSupportClaimsJson.*:TestParseSweepSupportClaimsJson.*:TestSupportJsonPath.*:TestLoadSupportClaims.*:TestLoadSweepSupportClaims.*:TestGraphFile.*:TestBundleDiscoveryFixture.SkipsSupportJson:TestBundleDiscoveryFixture.SweepSupportJsonIsNotDiscoveredAsGraph:TestLoadBundleMetadata.*" - Status: Passed (61/61)
  • hipdnn_integration_tests_unit_tests (full suite) - hipdnn_integration_tests_unit_tests.exe - Status: Passed (320/322, 2 pre-existing GPU-only skips unrelated to this change)
  • clang-format - clang-format on all touched/new files - Status: Passed
  • PR CI - GitHub PR checks - Status: Pending

Technical Changes

  • Adds src/harness/bundle/SupportClaims.hpp/.cpp: SupportClaims/SweepSupportClaims model plus parseSupportClaimsJson/parseSweepSupportClaimsJson/loadSupportClaims/loadSweepSupportClaims, throwing std::runtime_error on malformed/checked-in-incoherent input (mirrors readSweepCaseIds's loud-not-silent contract for machine-owned files), and returning std::nullopt only when the sidecar is genuinely absent.
  • Adds EnforcementLevel enum (Applicability/Buildable/Full, default Full) and an enforcementLevel field to BundleMetadata, parsed from enforcement_level in meta.json/sweep cases[].metadata, rejecting the whole metadata on an invalid token (mirrors format_version handling).
  • Fixes BundleDiscovery::companionKinds() to include "support" so a single-graph {Name}.support.json sidecar is excluded from graph discovery; the sweep's bare support.json was already excluded via the existing sweep-directory guard.
  • Registers SupportClaims.cpp and TestSupportClaims.cpp in the relevant CMake targets.
  • Adds unit test coverage in TestSupportClaims.cpp (new), TestBundleMetadata.cpp, and TestBundleDiscovery.cpp.

…el plumbing

Implements the RFC 0015 data-and-plumbing layer for per-graph engine
support claims, with no enforcement/runner wiring (downstream):

- New SupportClaims.hpp/.cpp: in-memory claim model + loader for the
  single-graph {Name}.support.json (RFC 0015 SS5.1-5.2) and the
  template-sweep support.json (SS5.4) shapes, honoring all SS5.3 loader
  rules. Throws on malformed/checked-in-incoherent input, matching
  readSweepCaseIds' loud-not-silent contract for machine-owned files.
- BundleMetadata gains enforcement_level (applicability|buildable|full,
  default full), readable from meta.json and sweep cases[].metadata.
- BundleDiscovery::companionKinds() now excludes "support" so a
  single-graph {Name}.support.json sidecar no longer registers a
  spurious test; the sweep's bare support.json was already excluded.
- Unit tests for loader rules (both claim shapes), the metadata field,
  and the discovery exclusion.

Ref: ALMIOPEN-2331
@therock-pr-bot

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 ✅ Pass
🚫 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.

if(!platformJson.is_string()
|| validPlatformTokens().count(platformJson.get<std::string>()) == 0)
{
throw std::runtime_error(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit] The invalid-platform-token error message omits the offending value ("arch 'X' has an invalid platform token"), whereas the analogous enforcement_level message in BundleMetadata.hpp does echo the bad token. Including the actual string (and ideally the arch's allowed set) would make a broken committed support.json faster to fix.

TEST(TestLoadSupportClaims, ReturnsNulloptWhenSidecarDoesNotExist)
{
const ScopedDirectory dir(std::filesystem::temp_directory_path()
/ ("test_support_claims_" + std::to_string(std::rand())));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit] Temp directory uniqueness relies on unseeded std::rand(). Within one process the sequence advances so intra-run collisions are unlikely, but two concurrent test processes share the same default seed and could pick the same directory. The TestBundleDiscovery fixture's approach (deriving the temp path from the test's source line and remove_all-ing first) is more robust; consider aligning these newer tests with it.

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.

1 participant