Repository navigation
Conversation
Every fixture in the file writes one frame rate, so median, mean and maximum were the samenumber and replacing statistics.median() with max() in parse_frames left all 21 passing. This adds two halves with equal presents - 60 s at 40 fps and 40 s at 60 fps, 2400 each - so the median gap sits between the two and reads 48, while max() answers 40. Measured: with the mutation the case fails 40.0 != 48.0, and the other 21 still pass, so the case is pointed rather than collateral.
Collaborator
|
Verified by OreoFR on macOS 27.2.1, Apple M5, head MEASURED
READ IN CODE
AI-assisted: Claude Code |
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.
The
game_gatesuite cannot currently tell a median from a maximum. This adds the case that can, and it is one test.The gap, found by mutation on #2782 before it merged: replacing
statistics.median()withmax()inparse_frames(both sites,tools/game_gate.py:291and:311) left all 20 tests passing. The reason is in the fixtures: every case writes one frame rate, so for each of themmedian == mean == max, andassertAlmostEqual(s["fps"]["median"], 50.0)is satisfied by any of the three.That is now in
main, since #2782 merged - so the assertion that reads "median" is not testing a median.The case added:
The windows are unequal on purpose and the presents are equal: 60 s at 40 fps and 40 s at 60 fps both give 2400 gaps, so the median gap is the mean of 16.67 and 25 ms - 48 fps - while
max()answers1000 / 25= 40. Equal durations would not have worked: the 60 fps half contributes 9000 presents to 6000, the median lands on 16.67, and the case reads 60 for both implementations. I tried that first and it passed the mutation.Measured, both arms:
So the mutation now fails on this case and the other 21 still pass - the case is pointed, which is what a regression test for a statistic should be.
p5is asserted too, because it is the other place a rate statistic is derived and it was equally indistinguishable:percentile(counted, 95)reads the slow half (40 fps) here.One file,
+16/-0, no tool code touched.AI-assisted: yes - DeepSeek v4.1 (flash). Found while reviewing #2782, whose author merged with the note on record; this closes it rather than re-litigating it.
Written with an AI assistant.