build: add a coverage target and CI job - #154
Merged
Merged
Conversation
make coverage builds kath and trunner instrumented into their own object tree, runs the suite, and reports via gcovr. kath is instrumented too since trv_elf, ttdf and ttriton reach the backend by shelling out to it. Needs -U_FORTIFY_SOURCE (glibc warns at -O0) and -w (-O0 loses the range info -Wformat-truncation needs, so the strict set fires on fine code). The normal build stays the warnings gate. CI reports only, no threshold, until the baseline settles.
Zaneham
force-pushed
the
coverage-target
branch
from
August 2, 2026 05:23
cc8c715 to
53436e0
Compare
ra_ssa.c was at 0% -- it sits behind --ssa-ra and nothing passed the flag. These drive it end to end and check what an allocator must not get wrong: no virtual registers left behind, and nothing used past the count the kernel descriptor declares. 0% to 93%, and the tree goes 70.7% to 73.7%. Two real bugs fell out. Six fixtures (canonical, notgpt, stress, cuda_features, device_calls, test_struct) leave vregs unallocated, and so does any --max-vgprs below 8 on kernels the default allocator handles down to 2. Smallest repro is device_calls.cu, two leaks on the final store's address pair. Both are pinned as expected failures rather than skipped, so fixing the allocator trips this file and forces the lists to be updated. Also adds ra_ssa to cat_order so --cat reaches it. Unlisted categories only run in the orphan pass, unlabelled and unfilterable.
# Conflicts: # Makefile
Owner
Author
|
It goes without saying this doesn't count MOA or the SLATEC CI jobs |
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.
Adds
make coverageplus a CI job that posts the gcovr summary to the PR and uploads the HTML report. No threshold yet, since the baseline needed to exist first.kathis instrumented alongsidetrunnerbecausetrv_elf,ttdfandttritonreach the backend by shelling out to it. The build needs-U_FORTIFY_SOURCEand-w: at-O0glibc warns on the former, and-Wformat-truncationloses the range info it uses to prove bounds at-O2. The normal build is untouched and stays the warnings gate.The first run showed
src/amdgpu/ra_ssa.cat 0% across 759 lines, sotests/tra_ssa.cfollows. The SSA allocator is gated behind--ssa-raand nothing had ever passed the flag. Seven tests now drive it end to end and check the two things an allocator must not get wrong: no virtual registers left behind, and nothing used past the count the kernel descriptor declares.ra_ssa.cTwo bugs this turned up
--ssa-raleaves virtual registers unallocated, andverify.crejects the result:canonical.cu,notgpt.cu,stress.cu,cuda_features.cu,device_calls.cu,test_struct.cu. Smallest repro isdevice_calls.cu, two leaks on the finalglobal_store_dwordaddress pair.--max-vgprsbelow 8 leaks on kernels the default allocator handles down to 2, so the spill path is affected as well.Both are pinned as expected failures in
tests/tra_ssa.crather than skipped, so fixing the allocator trips this file and forces the lists to be updated. Neither is fixed here.Separately, the
nv > RS_MAX_VRguard at the top ofra_ssa()is dead:nvis clamped toRS_MAX_VRon the line above, so the too-many-vregs fallback is unreachable. Left alone, flagging it.ra_ssaalso joinscat_orderintmain.cso--catcan reach it; unlisted categories only run in the orphan pass, unlabelled and unfilterable.