Query every benchmark point once instead of nine times - #467
Merged
Conversation
benchmarkPoint strides by 73 and 151 modulo 1152, and both strides are coprime to 1152, so the sequence has period 1152: an index past that repeats a point already queried. Iterating to 9999 asked the same 1152 questions nearly nine times over. That bought no coverage and cost enough interpreted work to reach the twenty second test budget, so the test failed as a timeout on a loaded machine while saying nothing about the polygon. One full period queries every point the helper can produce, and both aggregate assertions compare totals which scale with the iteration count, so they hold unchanged.
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.
acceleratedClassificationMatchesLinearFor10000Pointsfails as a timeout - "did not complete in 20 seconds, it might contain an endless loop" - and the ten thousand iterations are why.benchmarkPointis:Both strides are coprime to 1152, so each coordinate cycles through every residue and the pair has period 1152. Index 1152 is index 0 again. Iterating to 9999 asked the same 1152 questions nearly nine times over, which bought no coverage and cost enough interpreted work - 64 vertices scanned linearly per point, plus the accelerated query - to reach the test budget.
One full period queries every point the helper can produce, so coverage is identical and the test is roughly nine times cheaper. Both aggregate assertions compare totals which scale with the iteration count (
totalCandidates < linearEdges), so they hold unchanged. Renamed to say what it covers rather than a number which was never the point.Verified through the compiler's stdlib suite: the test times out reliably before and the suite passes 460/460 after.