Preserve exact fuzzy percentage for fully matched code - #406
Open
itsgrimetime wants to merge 1 commit into
Open
Conversation
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.
Fully matched reports can show a fuzzy percentage such as
99.999954even whenmatched_code == total_codeandmatched_code_percent == 100. The weightedf32accumulator can drift above or below the exact sum while accumulating function and unit scores.Return exactly 100% when the integer matched and total code byte counts are equal. The shared normalization method covers unit, category, and overall measures, preserves the existing empty-code behavior, and leaves partially matched weighted scores unchanged. No report schema changes are needed.
Adds regression coverage for accumulated sums on both sides of 100%, aggregation of 1,130 fully matched units, a near-complete partial match, and empty code.
Validation:
cargo testpasses (54 tests);git diff --checkpasses. The required nightly formatting and Clippy commands could not run because nightly/rustup is unavailable locally. A stable Clippy attempt stops on the existingclippy::useless_borrows_in_formattinglint being unknown to the installed toolchain; stable formatting also cannot honor the repository's nightly-only options.