Repository navigation
Record coverage hits once on the Windows leg, where counting them slowed the suite threefold (#2671) - #2672
Merged
Conversation
…wed the suite threefold (#2671) The Windows leg of C# Test is the only one that runs the suite under coverlet. By default coverlet counts every sequence point it passes with an interlocked increment on one shared array, so tests running in parallel fight over the same cache lines. With the Calculus area pinned to four cores, as many as the runner has, the area took 315 s against 161 s without coverage. The integral of 1/(a + sin(x)) over [0, 2 pi] took 28 s against 10 s, and ln(x) erf(x) over [0, 1] took 58 s against 31 s. The first hit its 60 s timeout on Windows three times, and the second its 5-minute one twice (#2661). With SingleHit, coverlet records whether a line ran and not how often. The same run took 209 s, 10 s and 32 s, and the report visited the same 58,219 of 81,596 sequence points. The wall-clock budgets play no part. Neither integral runs a computation with a WorkBudget, and tightening every lid's clock to one tick leaves both times unchanged. The test's wall goes from 60 s to 120 s. Without #2662's cache the sine integral takes 190 s alone, so 120 s still fails on that regression and leaves the runner room. The reason is written in the test. Part of #2671. Part of #2661. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2672 +/- ##
==========================================
+ Coverage 86.70% 86.73% +0.02%
==========================================
Files 346 346
Lines 75719 75897 +178
Branches 22144 22224 +80
==========================================
+ Hits 65655 65829 +174
+ Misses 5430 5424 -6
- Partials 4634 4644 +10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Member
Author
|
This PR's first Windows run (46325714123) passed: 21,949 tests in 18 m 20 s with |
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.
Fixes #2671. Part of #2661.
What was wrong. The Windows leg of C# Test is the only one that runs the suite under coverlet. By default coverlet counts every sequence point it passes with an
Interlocked.Incrementon one shared array, and tests running in parallel fight over the same cache lines. Because of that,1/(a + sin(x))over[0, 2 pi](#2662's test, 6 s alone) hit its 60 s wall on windows-latest three times, andln(x) erf(x)over[0, 1](#2661, 14 s alone) hit its 5-minute wall twice. Both failures that show a timestamp came 3-4 minutes into the suite, while the test pool was full.Measured on Linux, with
taskset -c 0-3holding the Calculus area to four cores, as many as the runner has. Each configuration ran once, with nothing else running:1/(a + sin(x))ln(x) erf(x)SingleHit=trueThe counted and the single-hit reports visit the same 58,219 of 81,596 sequence points. The branch points differ by one: 59,799 against 59,800.
Ruled out. The two wall-clock budgets in the library are the perfect-square proof's 50 ms and the system solver's 60 s. They play no part here: neither integral runs a computation with a
WorkBudget, so aBudgetRecordingaround each records nothing. Tightening every lid's clock to one tick throughMathS.Settings.Budgetleaves all three timings unchanged (6.3 s, 3.9 s and 14.4 s).The fix.
CSharpTest.yml: the Windows leg passesSingleHit=trueto the collector. It records whether a line ran, not how often, which is all the uploaded report is used for.ALimitAtABreakIsRememberedTest: the wall goes from 60 s to 120 s. Without Remember the limits at a break as the limits at a bound are remembered (#2658) #2662's cache the sine integral takes 190 s alone (measured with that commit's change toIntegration.Definition.csreverted). So a wall of 5 minutes, as ln(x) erf(x) improper-integral decline takes 16 s and times out on the Windows runner #2661's test has, would no longer catch the regression the test exists for, while 120 s still does and leaves the runner room. The reason is written in the test.Suite:
dotnet test -c Release Sources/Tests/UnitTests: 21,912 passed, 0 failed, 13 skipped, 7 m 20 s.Left over.
FSharpTest.ymlandInteractiveTest.ymlalso collect coverage withoutSingleHit. They were not measured, so they are not changed here. This PR's own Windows run is the evidence for #2661; it stays open until a few Windows runs have passed.🤖 Generated with Claude Code