TheRock : Code Coverage - enable code coverage report generation #8602
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.55) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.55 · 515 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.374
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #8602"
general
weight: 0.35
endurthiabhilash
Motivation
GitHub issue: https://github.com/ROCm/TheRock/issues/6572
This is the report part of TheRock's code coverage support. It adds
merge_coverage_report.py, which turns the.profrawfiles collected by a coverage test run into coverage reports.It is the second of six PRs in the code coverage stack, which from the bottom is #9717, #8602, #10334, #8598, #10335 and #8605. It doesn't depend on #9717; it sits on it only because a stack is a single chain.
Technical Details
build_tools/github_actions/merge_coverage_report.py(new):.profrawfile under--profraw-dir, searching recursively. Instrumented binaries write one per process, so a sharded test job leaves many, spread across its downloaded artifacts.llvm-profdata merge -sparseinto one.profdataindex (--profdata-output, defaultcoverage-report/coverage.profdata).--object-globs(comma-separated, relative to--rocm-dir) to the instrumented binaries to report on. Versioned symlinks such aslibfoo.soandlibfoo.so.1count once.llvm-cov export(--lcov-output, defaultcoverage-report/coverage.info), which is what Codecov consumes. On request it also writes a per-file text summary (--summary-output) and an annotated HTML report (--html-output). Only the HTML report reads the sources;--path-equivalenceremaps the source paths recorded at build time when the sources have moved.llvm-profdataandllvm-covfrom<rocm-dir>/lib/llvm/binby default (--llvm-bin-diroverrides it), because they must match the compiler that built the instrumented binaries. If they aren't there, it falls back toPATHwith a warning.--allow-emptyis passed, and when none of the object globs match.build_tools/github_actions/tests/merge_coverage_report_test.py(new): 19 unit tests covering tool lookup, profile discovery, object resolution, thellvm-profdataandllvm-covcommand lines, and the main flow. They mocksubprocess.runandshutil.which, so they need no ROCm install.In CI, the per-project report job (#10334) will download the
.profrawfiles uploaded by the project's test shards, run this script, and upload the reports as an artifact.Producing a report locally after running an instrumented project's tests:
Test Plan
merge_coverage_report_test.py(Python 3.12).pre-commit runon the changed files.LLVM_PROFILE_FILEset. Then generate the lcov, text and HTML reports withmerge_coverage_report.pyand compare the totals with that run's own Coverage Report job.Test Result
- hipDNN's tests: 11/11 passed, writing 39
.profrawfiles.-
merge_coverage_report.py: lcov for 183 source files, the text summary, and a 181-page HTML report using--path-equivalence. Totals are 81.09% of lines, 75.42% of functions, 83.92% of regions and 80.07% of branches, identical to that run's own Coverage Report job.Submission Checklist