Skip to content

Count the typed and devptr wrappers in the coverage report - #599

Merged
amontoison merged 1 commit into
developfrom
coverage_followup
Oct 9, 2026
Merged

amontoison merged 1 commit into
developfrom
coverage_followup

Conversation

@amontoison

Copy link
Copy Markdown
Collaborator

Follow-up to #551.

The coverage report only recognised the _rank_N / _full_rank array overloads. Since the typed forms landed (#581, #584), the generator also wraps most routines in <routine>_typed, <routine>_devptr and _rank_N_devptr / _full_rank_devptr. That is about 3,100 more wrapper bodies, and for many routines (getters, rocFFT, rocRAND, hipRAND, the hipfort runtime module) they are the only wrappers. They were not counted, so a test that called the typed form looked untested.

Changes

  • VARIANT_RE matches every generated wrapper, and all of a routine's wrappers form one family. Assumed-rank names are skipped explicitly, as before.
  • The HIP runtime row now also scans the hipfort module, which holds its _typed wrappers, and roctx gets its own row.
  • A row whose wrappers no test reached now reads none tested (roctx in the run below). no wrappers is kept for libraries that have none (hipFFTW). Both labels used to read no array overloads.
  • When the script is run by hand without --gcov, it uses gcov-<major> for the gfortran on PATH instead of a hard-coded gcov-13. The CMake target already passed --gcov.
  • CodeCoverage.cmake and variant_coverage.py get the MIT/SPDX header that every source file carries since Add a uniform MIT/SPDX license header across the repository #563.

Result

I ran the full coverage target locally: gfortran 13, ROCm 10.1, 1254 tests on a GPU. The 3 failures (hip_mem_advise ×2, hip_module_kernel) are known WSL-only failures. Then I ran the old and the new script on the same counters:

library before (run/gen) after (run/gen)
rocblas 54/151 70/237
rocsolver 68/203 70/205
rocsparse 56/118 95/182
rocfft no array overloads 2/2
rocrand no array overloads 1/1
hipblas 46/127 72/260
hipsolver 37/111 139/371
hipsparse 41/88 69/123
hipfft 9/30 23/44
hipfftw no array overloads no wrappers
hiprand no array overloads 1/1
roctx (not reported) none tested
hip runtime 47/338 74/365
total 358/1166 (31%) 616/1791 (34%)

The number of tested routines rises with the denominator (for example hipsolver: 37 → 107). Those routines were tested through their typed form all along.

variant_coverage.py only recognised the _rank_N and _full_rank array
overloads. Since the typed forms landed, the generator also wraps most
routines in <routine>_typed, <routine>_devptr and _rank_N_devptr /
_full_rank_devptr: about 3,100 more wrapper bodies, and for many routines
(getters, rocFFT/rocRAND/hipRAND, the HIP runtime module) the only ones.
They were invisible, so a test calling the typed form counted as untested.

- The variant pattern now matches all of them; a routine's wrappers form
  one family. Assumed-rank names are skipped explicitly, as before.
- The HIP runtime row also scans hipfort (its _typed wrappers), and roctx
  gets a row.
- A row whose wrappers no test reached reads "none tested" instead of
  "no wrappers", which is kept for libraries with none (hipFFTW).
- Run by hand without --gcov, the script picks gcov-<major> for the
  gfortran on PATH instead of a hard-coded gcov-13.
- Both files get the MIT/SPDX header every source file carries.

On the same counters, the wrappers counted for the tested routines go
from 1166 to 1791 and those executed from 358 to 616.
@amontoison
amontoison merged commit 26bfce0 into develop Oct 9, 2026
1 check was pending
@amontoison
amontoison deleted the coverage_followup branch October 9, 2026 18:53
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