Fix flaky CI: montecarlo perf assertion - #29
Merged
Conversation
test_montecarlo asserted speedup > 1.0 for parallel(s), but whether the parallel form beats serial -O3 is core/size dependent. On the 2-core GitHub runner the tiny kernel is net-slower from thread overhead (0.016s -> 0.028s), failing CI. Assert it ran (speedup > 0) and keep the legality checks, matching the policy already stated in test_imperfect.py. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
testsCI was red on every run. Root cause is a single performance assertion, not an environment problem.tests/test_montecarlo.pyassertedparallel(s)is faster than serial (speedup > 1.0). Whether parallel beats serial-O3is core/size dependent — on the 2-core GitHub runner the tiny kernel is net-slower from thread overhead (0.016s -> 0.028s), so the assert fails. The legality semantics (parallel(s) legal + runs, parallel(t) rejected) are the actual contract and are unchanged; only the perf claim is relaxed to "it ran" (speedup > 0), matching the policy already documented intest_imperfect.py.Verified locally (2.07x here) and the rest of the suite is unaffected.
🤖 Generated with Claude Code