diff --git a/wurst/math/PolygonTests.wurst b/wurst/math/PolygonTests.wurst index 613850f1..15730608 100644 --- a/wurst/math/PolygonTests.wurst +++ b/wurst/math/PolygonTests.wurst @@ -179,12 +179,17 @@ function benchmarkPoint(int index) returns vec2 (polygon.classify(vec2(96, 96)) == polygon.classifyLinear(vec2(96, 96))).assertTrue() destroy polygon -@Test function acceleratedClassificationMatchesLinearFor10000Points() +/** Every point benchmarkPoint can produce, which is fewer than it looks. + Both strides are coprime to 1152, so the sequence has period 1152 and an index past that + repeats a point already queried. Ten thousand iterations asked the same 1152 questions + nearly nine times over, for no coverage and enough interpreted work to reach the + twenty second test budget on a loaded machine. */ +@Test function acceleratedClassificationMatchesLinearForEveryBenchmarkPoint() let polygon = benchmarkPolygon() var totalCandidates = 0 var linearEdges = 0 var mixedQueries = 0 - for i = 0 to 9999 + for i = 0 to 1151 let point = benchmarkPoint(i) (polygon.classify(point) == polygon.classifyLinear(point)).assertTrue() if point.x >= 0 and point.x <= 1024 and point.y >= 0 and point.y <= 1024 @@ -195,7 +200,7 @@ function benchmarkPoint(int index) returns vec2 mixedQueries++ totalCandidates += candidates totalCandidates.assertLessThan(linearEdges) - print("Polygon 10000-lookups: mixed=" + mixedQueries + + print("Polygon 1152-lookups: mixed=" + mixedQueries + ", linearEdges=" + linearEdges + ", candidateEdges=" + totalCandidates) destroy polygon