ci(coverage): Codecov integration (codecov.yml + upload tooling)#9288
Open
jainprad wants to merge 86 commits into
Open
ci(coverage): Codecov integration (codecov.yml + upload tooling)#9288jainprad wants to merge 86 commits into
jainprad wants to merge 86 commits into
Conversation
The current therock_configure_ci.py doesn't have a clean way to only configure the project that has changed, and not other components that the changed component has been grouped together with. For code coverage reports, it does not make sense to even test downstream components.
rocSPARSE coverage cannot build: enabling SPARSE pulls in the PRIM group, whose rocThrust configure fails on find_package(SQLite3 3.51.3) because the sysdeps-provided SQLite3 reports an unknown version. This is an upstream rocThrust/TheRock dependency issue, so remove the rocSPARSE coverage component (metadata, YAML entry, and CMake alias) until it is resolved. rocBLAS coverage is unaffected and retained. Co-authored-by: Cursor <cursoragent@cursor.com>
coverage_runner.py now skips report generation when a build produced no profraw, so no coverage.info is written. The downstream report bash runs under 'set -euo pipefail', where expanding the resulting empty SOURCES / OBJECTS arrays tripped 'unbound variable' and failed the job. Short-circuit the step with a clean exit 0 when coverage.info is absent. Co-authored-by: Cursor <cursoragent@cursor.com>
Header-only libraries have no shared object to instrument, so coverage is collected from their instrumented test binaries (all three add -fprofile-instr-generate/-fcoverage-mapping to the tests under their coverage flag). Changes: - CMake aliases ROCPRIM/HIPCUB/ROCTHRUST_ENABLE_COVERAGE mapping onto each project's BUILD_CODE_COVERAGE / CODE_COVERAGE option. - COVERAGE_PROJECT_METADATA + YAML entries (test_binaries name prefixes) and a rocPRIM codecov flag. - export_coverage_metadata.py resolves the instrumented test executables (ELF, scoped to the component build subdir, extension/CMakeFiles filtered) and stages them into coverage-objects so the report job can pass them to llvm-cov; coverage_runner.py already resolves them. - report step includes staged test binaries and guards empty arrays under set -u. Also make rocThrust resilient to a missing/mis-versioned system SQLite3 by falling back to its bundled download (find_package no longer REQUIRED). Without this the PRIM group coverage build fails at find_package(SQLite3 3.51.3) against TheRock's sysdeps SQLite3 (version "unknown") - the same issue that blocked rocSPARSE. Co-authored-by: Cursor <cursoragent@cursor.com>
rocPRIM's tests build in a dedicated TheRock subproject ("rocPRIM_tests"),
so the exact path-part scope match found no rocprim test binaries and the
report failed with "No coverage object files could be resolved". Match the
component build subdir as a substring of a path part so "<target>_tests"
subprojects are scoped correctly, while still excluding sibling components
in the shared PRIM build.
Co-authored-by: Cursor <cursoragent@cursor.com>
Review feedback (reboss): aliasing the standardized <PROJECT>_ENABLE_COVERAGE flag onto the shared BUILD_CODE_COVERAGE / CODE_COVERAGE / ROCBLAS_BUILD_COVERAGE switches risks inadvertently instrumenting other components. Instead, gate each project's instrumentation directly on its own <PROJECT>_ENABLE_COVERAGE (OR'd with the project's legacy local switch) and stop toggling the shared variables, matching the existing hipRAND/hipDNN convention. rocFFT additionally guards its -fgpu-rdc opt-out on ROCFFT_ENABLE_COVERAGE so a coverage build still disables relocatable device code. Co-authored-by: Cursor <cursoragent@cursor.com>
Per review feedback, the codecov.yml rocPRIM flag and the rocThrust SQLite3 fallback are out-of-scope for this PR. They now live in their own PRs: - codecov rocPRIM flag: #8955 - rocThrust SQLite fallback: #8956 Note: the header-only (PRIM group) coverage build here depends on #8956 landing so rocThrust configure does not fail on find_package(SQLite3). Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the legacy BUILD_CODE_COVERAGE / CODE_COVERAGE conditions from the instrumentation guards; the standardized <PROJECT>_ENABLE_COVERAGE flag is the only switch needed to instrument each component. Co-authored-by: Cursor <cursoragent@cursor.com>
…st guard Review feedback (reboss) on the coverage flow: - Inline the coverage report generation (llvm-profdata merge + llvm-cov report/show/export) directly in the report step of therock-ci-coverage.yml instead of calling the coverage_runner.py wrapper (which was only ever run with --skip-tests). coverage_runner.py is kept in-tree but unused for now. - Disable the header-only components (rocPRIM/hipCUB/rocThrust) rather than removing them: their metadata moves to a disabled dict in therock_configure_coverage.py and their YAML entries are marked enabled: false, so no coverage jobs are emitted while the flow is limited to shared-object components. Config is retained for easy re-enable. - Restore the gfx950-dcgpu test skip guard in therock-ci-linux.yml that was removed by accident, and drop a stray blank line. - Drop the noisy ls/ldd diagnostics from the llvm-tool staging step. Deferred (need TheRock-side support / cross-team design, per review): - Fetching llvm-profdata/llvm-cov via FETCH_ARTIFACT_ARGS (amd-llvm) instead of staging/uploading them. - Moving to per-project test_categories_*.yaml and reusing TheRock's test_runner.py (reworking export_coverage_metadata.py accordingly). Co-authored-by: Cursor <cursoragent@cursor.com>
…erage_lib_v2 Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .github/workflows/therock-test-component.yml # projects/rocfft/CMakeLists.txt
The develop merge pulled in "feat(rocrand): use primbench (#4454)", whose benchmark unconditionally links amd_smi and includes <amd_smi/amdsmi.h> on Linux. Narrowed builds that do not stage the amd-smi dev headers (e.g. the code-coverage builds, which enable only RAND/FFT) then fail to compile the rocRAND benchmark, which cascades to skipped test/report jobs so no profraw or coverage report is produced for hipRAND/rocRAND/rocFFT. Detect the amd-smi dev header and only enable monitoring (link amd_smi) when present; otherwise build the benchmark with PRIMBENCH_NO_MONITORING. This matches primbench's own soft-dependency design and keeps full builds (header present) unchanged while unblocking the coverage builds. Co-authored-by: Cursor <cursoragent@cursor.com>
Dedicated PR for the Codecov tooling, split out from the coverage-generation work per review (reboss). Owns codecov.yml (flags/targets) and the "Upload coverage to Codecov" step. Adds the required --git-service github so the tokenless upload path completes (without a token codecovcli cannot infer the git provider and fails with "Upload service is missing"). Co-authored-by: Cursor <cursoragent@cursor.com>
jainprad
added a commit
to jainprad/rocm-libraries
that referenced
this pull request
Jul 10, 2026
Per review, the Codecov config + upload tooling now live in a dedicated PR (users/jainprad/codecoverage_codecov_tool, ROCm#9288). Remove the "Upload coverage to Codecov" step here; this PR builds, tests, and produces the coverage report artifact only. The job summary points to the Codecov PR. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
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.
Summary
Dedicated PR for the Codecov integration, split out from the coverage-generation work per review feedback (reboss: keep codecov config + upload tooling separate).
This PR owns:
codecov.yml— the per-component flag/target configuration.therock-ci-coverage.yml— installscodecovcliand uploads the LCOV report (token for non-fork/postsubmit; tokenlessowner:branchpath for fork PRs). Adds the required--git-service githubso the tokenless upload completes (without a tokencodecovclicannot infer the git provider → "Upload service is missing").Branched from the coverage infrastructure (following #9221's
users/<user>/…→developconvention), so it runs standalone.Relationship to the other coverage PRs
Follow-up (separate, reboss #470)
Baking
codecov-cliinto the build container (instead ofpip installat runtime) is a TheRock container change and will be handled separately (cc @geomin12).Test plan
Made with Cursor
Made with Cursor