Implement ITR code coverage backfill#8626
Conversation
BenchmarksBenchmark execution time: 2026-05-14 20:46:24 Comparing candidate commit 1f33b65 in PR branch Some scenarios are present only in baseline or only in candidate runs. If you didn't create or remove some scenarios in your branch, this maybe a sign of crashed benchmarks 💥💥💥 Scenarios present only in baseline:
Found 2 performance improvements and 4 performance regressions! Performance is the same for 49 metrics, 17 unstable metrics, 86 known flaky benchmarks, 40 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8626) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8626) - mean (75ms) : 72, 78
master - mean (73ms) : 70, 75
section Bailout
This PR (8626) - mean (77ms) : 75, 79
master - mean (79ms) : 75, 83
section CallTarget+Inlining+NGEN
This PR (8626) - mean (1,108ms) : 1049, 1168
master - mean (1,104ms) : 1056, 1153
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8626) - mean (116ms) : 110, 122
master - mean (113ms) : 109, 117
section Bailout
This PR (8626) - mean (115ms) : 112, 118
master - mean (118ms) : 113, 124
section CallTarget+Inlining+NGEN
This PR (8626) - mean (790ms) : 761, 820
master - mean (787ms) : 759, 814
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8626) - mean (104ms) : 99, 108
master - mean (102ms) : 98, 106
section Bailout
This PR (8626) - mean (102ms) : 100, 105
master - mean (106ms) : 100, 111
section CallTarget+Inlining+NGEN
This PR (8626) - mean (946ms) : 912, 980
master - mean (946ms) : 907, 986
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8626) - mean (102ms) : 96, 107
master - mean (99ms) : 95, 103
section Bailout
This PR (8626) - mean (104ms) : 99, 109
master - mean (103ms) : 98, 108
section CallTarget+Inlining+NGEN
This PR (8626) - mean (824ms) : 783, 864
master - mean (822ms) : 788, 856
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8626) - mean (201ms) : 195, 206
master - mean (202ms) : 194, 210
section Bailout
This PR (8626) - mean (205ms) : 200, 209
master - mean (206ms) : 198, 213
section CallTarget+Inlining+NGEN
This PR (8626) - mean (1,202ms) : 1167, 1237
master - mean (1,205ms) : 1159, 1251
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8626) - mean (289ms) : 279, 299
master - mean (288ms) : 281, 295
section Bailout
This PR (8626) - mean (290ms) : 284, 297
master - mean (290ms) : 283, 296
section CallTarget+Inlining+NGEN
This PR (8626) - mean (963ms) : 938, 989
master - mean (967ms) : 941, 992
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8626) - mean (280ms) : 272, 288
master - mean (281ms) : 275, 287
section Bailout
This PR (8626) - mean (279ms) : 269, 290
master - mean (280ms) : 275, 285
section CallTarget+Inlining+NGEN
This PR (8626) - mean (1,160ms) : 1121, 1200
master - mean (1,163ms) : 1117, 1208
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8626) - mean (280ms) : 270, 289
master - mean (281ms) : 274, 289
section Bailout
This PR (8626) - mean (281ms) : 275, 287
master - mean (282ms) : 275, 288
section CallTarget+Inlining+NGEN
This PR (8626) - mean (1,040ms) : 998, 1081
master - mean (1,041ms) : 997, 1085
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3f0c9b0 to
7cf4fee
Compare
7cf4fee to
c30b95f
Compare
Summary of changes
meta.coverageparsing and scoped storage for ITR coverage backfill.Reason for change
When ITR skips tests, coverage tools can otherwise report incomplete line coverage. The backend now returns skipped-test line coverage in the skippable-tests response, and the tracer needs to merge that data with local coverage before publishing or rewriting report results.
RFC: https://docs.google.com/document/d/1234bLTvL-v9PzA3zIAf_2NN8DdTpfLM8NX4WiniPssw/edit?tab=t.0#heading=h.rnd972k0hiye
Java PR: DataDog/dd-trace-java#7367
Implementation details
test_levelandtest.bundlerequest scope for coverage-active skippable requests.LineCallCountvalues are treated as covered.Architecture overview
Skippable request initialization
flowchart TD A["TestOptimizationSkippableFeature constructor"] B{"TestsSkippingEnabled?"} C["Disabled: no skippable task"] D["CoverageBackfillCapability.IsCoverageBackfillRequired(settings)"] E{"Backfill required?"} F["Legacy/global mode: create _skippableTestsTask immediately"] G["Coverage-active mode: _skippableTestsTask = null"] H["Later: GetSkippableTestsTask(moduleName)"] I{"moduleName available?"} J["Create SkippableTestsRequestScope(test.bundle + runtime/config fingerprint)"] K["InternalGetSkippableTestsAsync(scope)"] L["ITestOptimizationClient.GetSkippableTestsAsync(scope)"] M["Parse skippable tests + meta.coverage"] N["CoverageBackfillDataStore.Persist(scope, data)"] O["No scoped task, no skippable candidates"] A --> B B -- "no" --> C B -- "yes" --> D --> E E -- "no" --> F --> K E -- "yes" --> G --> H H --> I I -- "yes" --> J --> K I -- "no" --> O K --> L --> M --> NSkip decision path
flowchart TD A["Common.ShouldSkip(testSuite, testName, args)"] B["moduleName = current Bundle ?? Module"] C["GetSkippableTestsFromSuiteAndName(testSuite, testName, moduleName)"] D{"Candidate matched by name/parameters?"} E["return false: do not skip"] F["CanSkipForCoverage(candidate, moduleName)"] G{"IsCoverageBackfillRequired()?"} H["return true: legacy behavior, skip allowed"] I["CanSkipWithCoverageBackfill(candidate, moduleName)"] J{"All coverage safety checks pass?"} K["return true: skip allowed"] L["return false: do not skip"] A --> B --> C --> D D -- "no" --> E D -- "yes" --> F --> G G -- "no" --> H G -- "yes" --> I --> J J -- "yes" --> K J -- "no" --> LImportant detail: when coverage backfill is not required,
CanSkipForCoveragereturnstruebefore callingCanSkipWithCoverageBackfill, so non-coverage-active ITR keeps the legacy behavior.Coverage backfill safety gate
flowchart TD A["CanSkipWithCoverageBackfill"] B{"Backend marked candidate missing line coverage?"} C["deny skip"] D{"Active coverage mode backfillable?"} E["deny skip"] F["Get scoped/global skippable task"] G{"Task available?"} H["deny skip"] I{"Ambiguous coverage scope?"} J["deny skip"] K{"Response coverage marked safe?"} L["deny skip"] M{"Backfill data present and valid?"} N["deny skip"] O["allow skip"] A --> B B -- "yes" --> C B -- "no" --> D D -- "no" --> E D -- "yes" --> F --> G G -- "no" --> H G -- "yes" --> I I -- "yes" --> J I -- "no" --> K K -- "no" --> L K -- "yes" --> M M -- "no" --> N M -- "yes" --> OActual skip tracking
flowchart TD A["Test closes with skip reason = ITR"] B["SkippableFeature.RecordTestSkippedByItr(bundle/module)"] C{"Coverage-active scoped mode and moduleName exists?"} D["Record in-memory actual skipped dictionary"] E["CoverageBackfillDataStore.RecordActualItrSkip(scope)"] F["CoverageBackfillDataStore.RecordActualItrSkip(default)"] A --> B --> C C -- "yes" --> D --> E C -- "no" --> FBackfill application is still guarded later by
IsCoverageBackfillRequired(). Recording an actual-skip marker does not by itself make non-coverage-active runs apply backfill.Session finalization and coverage publishing
flowchart TD A["DotnetCommon.FinalizeSession"] B["Datadog internal coverage JSON"] C["TryApplyItrCoverageBackfill"] D["TryGetCoverageBackfillDataForSession"] E{"Backfill required AND actual ITR skips?"} F["No backfill"] G["Use safe in-memory data or CoverageBackfillDataStore.TryLoad"] H["CoverageBackfillApplicator.ApplyToGlobalCoverage"] I["session.RecordCodeCoverage(DatadogInternal)"] J["External XML path"] K["TryProcessCoverageXml"] L["ExternalCoverageXmlBackfill.TryProcess"] M["session.RecordCodeCoverage(ExternalXml)"] N["Drain IPC messages from child coverage tools"] O["SessionCodeCoverageMessage from Coverlet/Microsoft"] P["session.RecordCodeCoverage(source)"] Q["CodeCoverageResultAggregator"] R["TestSession.PublishCodeCoverage"] A --> B --> C --> D --> E E -- "no" --> F E -- "yes" --> G --> H --> I --> Q A --> J --> K --> L --> M --> Q A --> N --> O --> P --> Q --> RChild coverage tool adapters
flowchart TD A["Coverlet GetCoverageResult()"] B["CoverageGetCoverageResultIntegration"] C["TryGetCoverageBackfillDataForCurrentProcess"] D{"Actual ITR skip marker exists?"} E["No backfill, calculate native percentage"] F["CoverletCoverageBackfill.TryApply"] G["Send SessionCodeCoverageMessage(Coverlet)"] H["Microsoft ManagedVanguard.Stop()"] I["ManagedVanguardStopIntegration"] J["ExternalCoverageXmlBackfill.TryProcess"] K["Send SessionCodeCoverageMessage(MicrosoftCodeCoverage)"] A --> B --> C --> D D -- "no" --> E --> G D -- "yes" --> F --> G H --> I --> C C --> J --> KType guide
CoverageBackfillCapabilityTestOptimizationSkippableFeatureSkippableTestsRequestScopetest.bundleand a fingerprint built from runtime, OS, service/env, repo/sha, and custom test configurations.SkippableTest_missing_line_code_coveragewhen the backend cannot provide line coverage for that candidate.CoverageBackfillDatameta.coverage: repository-relative source path to executed-line bitmap.CoverageBackfillDataStoreCoverageBackfillApplicatorGlobalCoverageInfo.ExternalCoverageXmlBackfillCoverletCoverageBackfillSessionCodeCoverageMessageCodeCoverageResultAggregatorExternalXml>Coverlet>MicrosoftCodeCoverage>Unknown>DatadogInternal.Key behavior cases
CanSkipWithCoverageBackfillis not called.Test coverage
Other details