feat(integration-tests): add support-claim loader and enforcement_level plumbing - #10244
feat(integration-tests): add support-claim loader and enforcement_level plumbing#10244adickin-amd wants to merge 1 commit into
Conversation
…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
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
| if(!platformJson.is_string() | ||
| || validPlatformTokens().count(platformJson.get<std::string>()) == 0) | ||
| { | ||
| throw std::runtime_error( |
There was a problem hiding this comment.
[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()))); |
There was a problem hiding this comment.
[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.
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.jsonsidecar (single-graph and template-sweep shapes), anenforcement_levelfield onBundleMetadata, 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-2331Risk 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
hipdnn_integration_tests_unit_testsvia the repo superbuild (hipdnn-providerspreset), CPU-only.enforcement_levelmetadata field, and the discovery exclusion.Testing Checklist
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.exe- Status: Passed (320/322, 2 pre-existing GPU-only skips unrelated to this change)clang-formaton all touched/new files - Status: PassedTechnical Changes
src/harness/bundle/SupportClaims.hpp/.cpp:SupportClaims/SweepSupportClaimsmodel plusparseSupportClaimsJson/parseSweepSupportClaimsJson/loadSupportClaims/loadSweepSupportClaims, throwingstd::runtime_erroron malformed/checked-in-incoherent input (mirrorsreadSweepCaseIds's loud-not-silent contract for machine-owned files), and returningstd::nulloptonly when the sidecar is genuinely absent.EnforcementLevelenum (Applicability/Buildable/Full, defaultFull) and anenforcementLevelfield toBundleMetadata, parsed fromenforcement_levelinmeta.json/sweepcases[].metadata, rejecting the whole metadata on an invalid token (mirrorsformat_versionhandling).BundleDiscovery::companionKinds()to include"support"so a single-graph{Name}.support.jsonsidecar is excluded from graph discovery; the sweep's baresupport.jsonwas already excluded via the existing sweep-directory guard.SupportClaims.cppandTestSupportClaims.cppin the relevant CMake targets.TestSupportClaims.cpp(new),TestBundleMetadata.cpp, andTestBundleDiscovery.cpp.