Skip to content

Query every benchmark point once instead of nine times - #467

Merged
Frotty merged 1 commit into
masterfrom
fix/polygon-benchmark-period
Aug 18, 2026
Merged

Query every benchmark point once instead of nine times#467
Frotty merged 1 commit into
masterfrom
fix/polygon-benchmark-period

Conversation

@Frotty

@Frotty Frotty commented Aug 17, 2026

Copy link
Copy Markdown
Member

acceleratedClassificationMatchesLinearFor10000Points fails as a timeout - "did not complete in 20 seconds, it might contain an endless loop" - and the ten thousand iterations are why.

benchmarkPoint is:

function benchmarkPoint(int index) returns vec2
	return vec2(((index * 73) mod 1152 - 64).toReal(), ((index * 151) mod 1152 - 64).toReal())

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.

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.
@Frotty
Frotty merged commit a85001e into master Aug 18, 2026
2 checks passed
@Frotty
Frotty deleted the fix/polygon-benchmark-period branch August 18, 2026 09:06
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