Repository navigation
Fixes coverage map updates and bit counting logic - #309
Conversation
Removes redundant coverage map assignment. Changed the denominator from βlines ever coveredβ to βcoverable/instrumented lines observed in LCOVβ. Adjusts total bit calculation to prevent overcounting (unnecessary multiplication by 8 to covert to bit level).
|
I also noticed a strange calculation of the initial coverage - WuppieFuzz/src/coverage_clients/mod.rs Line 66 in e346fb9 |
@grebnetiew, we introduced this in #145. Seems like I committed this and you reviewed. I have no clue why this is such a strange formula. Guess some copy-paste mistake, or am I missing something here? |
This has to do with integer rounding, readability is a bit of a mess.. |
There are three changes with this pull request
The most obvious one is changing how the
totalis calculated inmax_coverage_ratiobefore this was done by multiplying the total by 8, which is a mistake because each mapped line uses one byte as a boolean slot, not eight independent coverage bits.
Before
Second change is removing the unnecessary assignment of the
cov_bitto the total mapThis is unnecessary since the total coverage map is merged with the cov_map a few lines under, and is not required in between steps.
The third and the debatable change is lcov_client.rs:254:
Mapping every LineData, including count == 0, changes the denominator from βlines ever coveredβ to βcoverable/instrumented lines observed in LCOVβ. That is probably the more precise coverage ratio, but it can lower reported ratios compared with the old implementation. If that is intended, this version is better.
Fixes #103