[AIROCMLIR-378] Add negative lit coverage for Rock/MIGraphX/MHAL#2415
Draft
bogdan-petkovic wants to merge 1 commit into
Draft
[AIROCMLIR-378] Add negative lit coverage for Rock/MIGraphX/MHAL#2415bogdan-petkovic wants to merge 1 commit into
bogdan-petkovic wants to merge 1 commit into
Conversation
…fiers Signed-off-by: bogdan-petkovic <bpetkovi@amd.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2415 +/- ##
===========================================
+ Coverage 82.57% 83.26% +0.70%
===========================================
Files 120 120
Lines 42852 42828 -24
Branches 7110 7106 -4
===========================================
+ Hits 35381 35660 +279
+ Misses 4815 4613 -202
+ Partials 2656 2555 -101
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
This PR increases rocMLIR's code coverage toward the 85% target tracked in issue #1825 , building on the earlier MHAL coverage work in #2394. It focuses on the cheapest, highest-confidence wins: error branches of dialect op verifiers, attribute/type parsers, and the conv-transpose decomposition pass that were previously exercised only on their happy paths (so the failure branches showed up as miss/partial in Codecov). These are pure host-side checks that need no GPU, so they run in every CI configuration and harden the dialects against regressions in parsing/printing/verification.
Technical Details
Adds nine new -split-input-file -verify-diagnostics lit test files (71 cases total) that each trip a specific, previously-uncovered verifier or parser error branch. No source code changes — tests only. Coverage targets, by file: mlir/test/Dialect/Rock/transform_attr_invalid.mlir covers TransformAttr::verify, TransformMapAttr::verify, and TransformAttr::parse (every transform-type rule plus the unknown-name path); transforming_for_invalid.mlir covers TransformingForOp::parse/::verify; reduce_invalid.mlir covers ReduceOp::verify; op_verifier_invalid.mlir covers InsertSliceOp, GpuAllocOp, LiveInOp, LiveOutOp, GlobalStoreOp, InBoundsLoadOp, and InBoundsStoreOp; threadwise_blockwise_invalid.mlir covers ThreadwiseGemmOp, BlockwiseGemmOp, BlockwiseFillOp, and the remaining GlobalLoadToLDSOp branches; mlir/test/Dialect/MIGraphX/literal_unpack_invalid.mlir covers LiteralOp::verify/UnpackOp::verify; shaped_type_invalid.mlir covers MIXRShapedType::parse; mlir/test/Dialect/MHAL/attrs-invalid.mlir covers the unknown-type-name branches of TargetObjectAttr::parse and KernelPackageAttr::parse; and mlir/test/Conversion/RocmlirCustomTosaDecompose/rocmlir-custom-tosa-decompose-invalid.mlir covers the stride/out_pad/output-dim/bias branches of verifyConvTranspose. Where the diagnostics are emitted through the dialect-conversion driver (the decompose pass) or the attribute parser wrapper, the tests expect both the specific verifier message and the framework's follow-up diagnostic, matching the deterministic emission order. Each file's leading // COM: comments cite the exact source function being exercised.
Test Plan
PR CI, including the Codecov coverage stage which builds with -DLLVM_BUILD_INSTRUMENTED_COVERAGE=ON and runs the full check-rocmlir lit suite. Locally, every new file was validated by running its exact RUN command (rocmlir-opt ... -split-input-file -verify-diagnostics, and the decompose pass for the conversion test) against a local build; all 71 cases pass and the diagnostic expectations are deterministic across repeated runs.
Test Result
All 9 new lit files pass locally (71/71 cases). The targeted branches were confirmed reachable from textual IR, so they convert prior miss/partial lines into hits; the exact coverage delta will be reported by the Codecov bot on this PR.
Submission Checklist