Skip to content

[AIROCMLIR-378] Add negative lit coverage for Rock/MIGraphX/MHAL#2415

Draft
bogdan-petkovic wants to merge 1 commit into
developfrom
users/bpetkovi/dialect-verifier-coverage
Draft

[AIROCMLIR-378] Add negative lit coverage for Rock/MIGraphX/MHAL#2415
bogdan-petkovic wants to merge 1 commit into
developfrom
users/bpetkovi/dialect-verifier-coverage

Conversation

@bogdan-petkovic

Copy link
Copy Markdown
Contributor

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

…fiers

Signed-off-by: bogdan-petkovic <bpetkovi@amd.com>
@bogdan-petkovic bogdan-petkovic self-assigned this Jun 19, 2026
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

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     
Flag Coverage Δ
gfx120x 83.13% <ø> (+0.60%) ⬆️
gfx950 83.04% <ø> (+0.70%) ⬆️
mfma 83.05% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant