Skip to content

Record coverage hits once on the Windows leg, where counting them slowed the suite threefold (#2671) - #2672

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
fix/windows-parametric-integral-timeout
Nov 30, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
fix/windows-parametric-integral-timeout

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

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.Increment on 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, and ln(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-3 holding 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) area wall
alone, no coverage 6 s 14 s
alone, coverlet counting 12 s 24 s
4 cores, no coverage 10 s 31 s 161 s
4 cores, coverlet counting (as CI ran it) 28 s 58 s 315 s
4 cores, coverlet SingleHit=true 10 s 32 s 209 s

The 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 a BudgetRecording around each records nothing. Tightening every lid's clock to one tick through MathS.Settings.Budget leaves all three timings unchanged (6.3 s, 3.9 s and 14.4 s).

The fix.

Suite: dotnet test -c Release Sources/Tests/UnitTests: 21,912 passed, 0 failed, 13 skipped, 7 m 20 s.

Left over. FSharpTest.yml and InteractiveTest.yml also collect coverage without SingleHit. 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

…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

codecov Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.73%. Comparing base (d394391) to head (73e724b).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.23% <ø> (+0.02%) ⬆️
fsharp 32.79% <ø> (ø)
interactive 40.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rafael-SOWNet

Copy link
Copy Markdown
Member Author

This PR's first Windows run (46325714123) passed: 21,949 tests in 18 m 20 s with SingleHit=true, and the coverage report recorded hits. The two failing master and PR runs took 22 m 50 s and 29 m 51 s, and the passing #2662 rerun 16 m 42 s. That is one run, so #2661 stays open until more Windows runs pass.

@Rafael-SOWNet
Rafael-SOWNet merged commit 8e8c045 into master Nov 30, 2026
28 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AngouriMath Nov 30, 2026
@Rafael-SOWNet
Rafael-SOWNet deleted the fix/windows-parametric-integral-timeout branch November 30, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

The Windows test leg times out on 1/(a + sin(x)) over [0, 2 pi]: coverlet's hit counting under parallel tests

1 participant