test: pin the comparison-safety classifier, which mutation testing found open - #67
Merged
Merged
Conversation
…und open aihwbench/comparability.py decides whether two benchmark results may be compared at all. It is the mechanism behind this project's central claim -- that a number from one runtime and a number from another differ only in what they measured. Mutation testing scored it 45.5%: 12 of 22 mutants survived. Three survivors were safety-relevant rather than cosmetic: - `assert_comparable`'s `classification == NOT_COMPARABLE` could be inverted. The guard would then raise for comparable results and silently permit the incomparable ones -- the function allowing exactly what it exists to block, with the suite green. This is the single most consequential line in the module and nothing constrained it. - `_same`'s mixed-None branch returns False (a present value is not the same as a missing one). Flipping it to True survived, which would make a result that never recorded its seed compare "strictly" against one that did. The published comparison would then be between two different experiments. - `_same`'s both-None check could become `or`, making a single None mean "identical". All three are now pinned, along with every field in `_STRICT` being load-bearing rather than decorative, and `_CONDITIONAL` downgrading rather than blocking. Score is 68.2% (15/22). The remaining seven are equivalent mutants, verified rather than assumed: - The `continue` guards inside both diff loops are unreachable. `strict_diffs` is built with `_same`, and `_same(None, None)` is True, so a path where both sides are missing never enters the loop -- measured: zero such paths. That code is defensive in appearance only. - Mutating `_same`'s `or` to `and` is behaviour-preserving, because a one-None comparison falls through to `bool(None == value)`, which is already False. So the module is at 15 of 15 killable mutants. Reporting the raw number alongside that rather than the flattering one: a mutation score is a diagnostic, not a target. Verified: ruff, ruff format, mypy (73 files), 424 tests pass, coverage 70.85% against the 68% floor.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
aihwbench/comparability.pydecides whether two benchmark results may be compared at all. It is the mechanism behind this project's central claim — that a number from one runtime and a number from another differ only in what they measured.Mutation testing scored it 45.5%: 12 of 22 mutants survived.
Three survivors were safety-relevant
assert_comparable==→!=_samemixed-NoneFalse→True_sameboth-Noneand→orNonemeans identicalThe first is the single most consequential line in the module, and nothing constrained it.
All three are now pinned, along with every field in
_STRICTbeing load-bearing rather than decorative, and_CONDITIONALdowngrading rather than blocking.The remaining seven are equivalent mutants — verified, not assumed
continueguards inside both diff loops are unreachable.strict_diffsis built with_same, and_same(None, None)isTrue, so a path where both sides are missing never enters the loop. Measured: zero such paths. That code is defensive in appearance only._same'sortoandis behaviour-preserving: a one-Nonecomparison falls through tobool(None == value), which is alreadyFalse.So the module is at 15 of 15 killable mutants. Reporting the raw 68.2% alongside that rather than only the flattering number — a mutation score is a diagnostic, not a target.
Verification
ruff/ruff format --checkmypypytest