Skip to content

Preserve exact fuzzy percentage for fully matched code - #406

Open
itsgrimetime wants to merge 1 commit into
encounter:mainfrom
itsgrimetime:codex/exact-fully-matched-fuzzy-percent
Open

Preserve exact fuzzy percentage for fully matched code#406
itsgrimetime wants to merge 1 commit into
encounter:mainfrom
itsgrimetime:codex/exact-fully-matched-fuzzy-percent

Conversation

@itsgrimetime

Copy link
Copy Markdown

Fully matched reports can show a fuzzy percentage such as 99.999954 even when matched_code == total_code and matched_code_percent == 100. The weighted f32 accumulator 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 test passes (54 tests); git diff --check passes. The required nightly formatting and Clippy commands could not run because nightly/rustup is unavailable locally. A stable Clippy attempt stops on the existing clippy::useless_borrows_in_formatting lint being unknown to the installed toolchain; stable formatting also cannot honor the repository's nightly-only options.

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