Skip to content

[CI Visibility] Fix coverage rewriter and counter lifetime defects - #9663

Open
tonyredondo wants to merge 6 commits into
masterfrom
tony/coverage-rewriter-fixes
Open

tonyredondo wants to merge 6 commits into
masterfrom
tony/coverage-rewriter-fixes

Conversation

@tonyredondo

@tonyredondo tonyredondo commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary of changes

Fix eight problems in CI Visibility code coverage found while reviewing #9658/#9661, and add a corpus test that rewrites real compiler output so this class of bug is caught in CI. Follows #9661, which is already merged.

Rewriter (AssemblyProcessor):

  • A method whose only visible sequence point is the target of a branch back to the first instruction (F# let rec f () = f ()) no longer produces invalid IL (InvalidProgramException).
  • A line is no longer lost when execution leaves it before its last sequence point (if (x == null) throw ...;, if (a) return 1; return 2; in Release, F# one-line if/else). A sequence point is skipped only when every path to it goes through the previous one on the same line.
  • Methods with sequence points in several documents (field initializers from another partial file, #line in Razor or SpecFlow) report each line in its own document, and source-file exclusions apply per document.
  • Sequence points on line 0 (VB #ExternalSource(..., 0)) are ignored instead of making the rewriter write outside the line bitmap (AccessViolationException).
  • Method-level [ExcludeFromCodeCoverage] excludes the method again.

Runtime (Datadog.Trace):

  • Per-test counter buffers are recycled through a pool instead of being freed. An instrumented method keeps the raw counter pointer for its whole frame, and a frame running inside ExecutionContext.Run with another context could keep writing after the session freed its buffer (heap corruption). A late write now lands in coverage-owned memory, at worst marking a line in a later test that reuses the buffer.
  • GetFileCounter no longer throws into customer code (finalizers, type initializers) when the counters cannot be acquired. The global coverage and the current test's coverage are marked incomplete, the test reports no per-test coverage (as an aborted session does), and the probe writes into a per-module discard buffer.
  • Coverage capture only reports executable lines, so a late write into a reused buffer cannot mark a line that does not exist and make the global coverage artifact invalid.
  • FileBitmap checks Avx2.IsSupported before using AVX2 integer operations, and ignores lines outside the bitmap. The second fix also covers git diff -U0 hunks +0,0, which made GitCommandHelper call Set(0).

Reason for change

All of these produce invalid IL, crash the process or silently report wrong coverage. Missing lines and files reach per-test coverage, which Test Impact Analysis relies on.

Implementation details

  • The rewriter now records a probe per visible sequence point, with its own document and one counters local per document. The single-probe "no local" path is used only when the first instruction is reached once, from method entry: no exception handlers and no branch targeting it.
  • The pool lives in its own type, NativeBufferPool. ModuleValue keeps one instance for byte counters (line execution) and one for int counters (call counts), so a buffer is only reused for the same counter layout: a late write can then only add to a later owner's counters, apart from the wraparound 32-bit call counts already have. Each pool holds at most the peak number of concurrently live buffers of each size. Buffers are zeroed on reuse and never returned to the OS. Returning a buffer never throws: if the bookkeeping cannot be allocated, the block is left allocated. Global fallback buffers keep the existing lifetime.
  • The discard buffer is allocated on the first probe failure of a module, so successful runs don't keep a second counter buffer. If that allocation also fails, GetFileCounter rethrows as before. The module's coverage layout is initialized on first use inside GetFileCounter, so even a cached initialization failure marks every affected test incomplete. Invalid generated metadata still fails the reporter's type initializer, as InvalidReporterMetadataSuppressesGlobalOutput expects.
  • Six CoverageRewriteTests snapshots gain one line. The i++ of a for header is now also instrumented because its previous sequence point is on another line. Line counters are only consumed as executed or not executed, so results don't change.

Test coverage

  • CoverageRewriterCorpusTests compiles a C# and a Visual Basic corpus with Roslyn at test time (through TestAssemblyCompiler, shared with the C# finalizer fixture from [CI Visibility] Fix coverage instrumentation of expression-bodied finalizers #9661), in Debug and Release, and rewrites it in both coverage modes. It then checks that the JIT accepts every rewritten method, that lines marked // executed: are reported, that lines marked // not-covered: are not, and that every reported line belongs to the document it is reported in. New constructs can be added to the corpus.
  • BackwardBranchCoverageTests: the F# loop shape (one visible sequence point that a branch jumps back to), produced from C# in an optimized build with #line hidden. The test checks that the compiled fixture still has that shape before rewriting it.
  • NativeBufferPoolTests: each test uses its own pool. They cover zeroed allocation, reuse of a returned buffer of the same size (zeroed again), separation by size, the counters, rejection of negative sizes, concurrent renters never sharing a buffer, and Return keeping the buffer allocated when the pool cannot record it.
  • ModuleValueTests: context buffers go back to the pool on Dispose and from the finalizer, are not reused across counter widths, global fallback buffers are not pooled, and new buffers start zeroed.
  • CoverageEventHandlerTests: a buffer released while a frame is inside another ExecutionContext stays owned by coverage. A failed counter acquisition does not throw and allocates the discard buffer, later failures reuse it, and successful probes never allocate it. A session with a failed probe, including a cached reporter initialization failure, reports no coverage, and the next session reports normally.
  • ModuleCoverageDataTests: counters on non-executable lines are not reported, in both coverage modes.
  • FileBitmapBoundsTests: out-of-range lines are neither written nor read.

Each new test fails without its fix, and each deliberate break of NativeBufferPool (no zeroing, freeing instead of pooling, a throwing Return, handing out a buffer without removing it, missing counter updates) makes at least one test fail. Corpus probes miss or misplace their lines, the VB corpus crashes the test host with AccessViolationException, the backward-branch case throws InvalidProgramException, and the pool test aborts the test host with malloc(): unaligned tcache chunk detected.

Locally, on Linux x64 with SDK 11.0.100-rc.2, Datadog.Trace.Tools.Runner.Tests passes on netcoreapp2.1 through net11.0, with older runtimes in the official SDK containers. The coverage tests in Datadog.Trace.Tests pass on netcoreapp2.1, netcoreapp3.1 and net8.0, and the existing FileBitmapTests pass with and without DOTNET_EnableAVX2=0. The AVX2 guard has no automated test because CI machines support AVX2; it was verified with DOTNET_EnableAVX2=0. Windows, .NET Framework, macOS and arm64 rely on CI.

Other details

Adds Microsoft.CodeAnalysis.VisualBasic 4.13.0 to Datadog.Trace.Tools.Runner.Tests, next to the Microsoft.CodeAnalysis.CSharp reference added in #9661. No public API or configuration changes.

@github-actions

Copy link
Copy Markdown
Contributor

Snapshots difference summary

The following differences have been observed in committed snapshots. It is meant to help the reviewer.
The diff is simplistic, so please check some files anyway while we improve it.

@pr-commenter

pr-commenter Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-11-12 11:52:31

Comparing candidate commit c061244 in PR branch tony/coverage-rewriter-fixes with baseline commit 3caa7d2 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 72 metrics, 0 unstable metrics, 6 known flaky benchmarks, 119 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472

  • 🟩 execution_time [-369.452ns; -314.738ns] or [-6.188%; -5.271%]
  • 🟩 throughput [+9365.844op/s; +10917.346op/s] or [+5.591%; +6.517%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • unstable execution_time [-0.001ns; +0.005ns] or [-7.218%; +40.383%]
  • unstable throughput [-104089020425.171op/s; +12599626282.795op/s] or [-69.012%; +8.354%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [-259.411µs; -53.629µs] or [-14.361%; -2.969%]
  • unstable throughput [+14.635op/s; +79.321op/s] or [+2.578%; +13.973%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0

  • 🟥 execution_time [+77.459µs; +124.894µs] or [+5.504%; +8.874%]
  • 🟥 throughput [-59.978op/s; -37.669op/s] or [-8.421%; -5.289%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1

  • unstable throughput [+3.264op/s; +49.589op/s] or [+0.906%; +13.770%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • unstable execution_time [-0.009ns; +0.000ns] or [-51.730%; +0.492%]
  • unstable throughput [-72724447162.476op/s; +197361691418.754op/s] or [-46.853%; +127.152%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472
  • scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
  • scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0
  • scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1
  • scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0
  • scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0
  • scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1
  • scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472
  • scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0
  • scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0
  • scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0
  • scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (9663) and master.

✅ No regressions detected

📄 View the full report (charts + all metrics) →

@tonyredondo
tonyredondo force-pushed the tony/coverage-rewriter-fixes branch from 470f9ad to 49727d7 Compare November 10, 2026 14:43
@tonyredondo
tonyredondo marked this pull request as ready for review November 10, 2026 15:59
@tonyredondo
tonyredondo requested review from a team as code owners November 10, 2026 15:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T16:02:50.833622Z 49727d7 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-10T16:04:50.820196Z 49727d7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49727d7553

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Safety of retained counter buffers and rewritten IL was assessed through static inspection only; runtime tests were not executed.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 49727d7

Base automatically changed from tony/fix-finalizer-coverage to master November 10, 2026 17:22

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

Static review found no reportable defects in the probe-placement, buffer-lifetime, or bitmap changes. Buffer reuse deliberately permits over-coverage from late writes while keeping those writes in coverage-owned memory.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit a8f1020

Instrument each sequence point against its own document, keep lines whose
earlier sequence points can be bypassed, use the counters local when a
branch targets the first instruction, ignore line 0 and method-level
[ExcludeFromCodeCoverage] methods, recycle context buffers instead of
freeing them, keep probe failures out of customer code, and guard AVX2
and out-of-range bitmap access. Add a C#/VB corpus test that rewrites
compiler output and checks JIT acceptance and reported lines.
@tonyredondo
tonyredondo force-pushed the tony/coverage-rewriter-fixes branch from a8f1020 to c9ed430 Compare November 10, 2026 17:41

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: FAIL

Cross-module buffer reuse can invalidate an entire global coverage artifact after a late write. Probe-acquisition failures can also leave partial per-test dependencies eligible for publication, risking incorrect test skipping.

Open Bits AI session

🤖 Bits Code Review · Commit c9ed430

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The PR repairs coverage rewriting, bitmap bounds, AVX2 handling, and counter-buffer lifetime. Both earlier findings are resolved: capture filters non-executable late writes, preventing global artifact rejection, and probe failures—including cached reporter-initialization failures—suppress incomplete per-test payloads, protecting test dependencies; no findings remain open.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit c061244

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant