Skip to content

[Debugger] Handle open generic types in probe expressions#8569

Merged
dudikeleti merged 6 commits into
masterfrom
dudik/probe-expression-parser-robustness
May 11, 2026
Merged

[Debugger] Handle open generic types in probe expressions#8569
dudikeleti merged 6 commits into
masterfrom
dudik/probe-expression-parser-robustness

Conversation

@dudikeleti

@dudikeleti dudikeleti commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

  • ProbeExpressionParser now closes open generic scope member types during expression compilation, including constructed open generics such as IEnumerable<T>, by substituting safe reference-type generic parameters.
  • Generic value-type parameters are rejected with a clear evaluation error when there is no concrete runtime type to use.
  • Binary comparisons between reference types and non-nullable value types now surface a friendly evaluation error.
  • Updated expression-language Verify snapshots for the intentional error message change.

Reason for change

  • Probe expression evaluation can receive declared types that still contain unresolved generic parameters, such as IEnumerable<T> from generic methods/types. Passing those types to expression-tree construction can produce opaque failures.
  • Invalid reference/value-type comparisons previously surfaced raw InvalidOperationException messages instead of actionable debugger evaluation errors.

Implementation details

  • Open generic types are normalized only during expression compilation/cache miss. The compiled delegate hot path does not repeat the reflection/type-closing work.
  • If a concrete runtime type is available, it is used. Otherwise, unresolved reference-type parameters are substituted with object, while value-type generic parameters are rejected because there is no safe substitute.

Test coverage

  • Added focused DebuggerExpressionLanguageTests for open generic definitions, constructed open generics, null constructed-open generic arguments, value-type generic rejection, and friendly comparison errors.
  • Updated affected Verify snapshots.

@dudikeleti
dudikeleti requested a review from a team as a code owner May 6, 2026 10:04
@github-actions github-actions Bot added area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) area:debugger labels May 6, 2026

@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: 48005dc6bf

ℹ️ 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".

Comment thread tracer/src/Datadog.Trace/Debugger/Expressions/ProbeExpressionParser.cs Outdated
@dudikeleti
dudikeleti marked this pull request as draft May 6, 2026 10:31
@pr-commenter

pr-commenter Bot commented May 6, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-05-11 13:37:50

Comparing candidate commit c812ed8 in PR branch dudik/probe-expression-parser-robustness with baseline commit d1e3a68 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 60 known flaky benchmarks, 27 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.Trace.ActivityBenchmark.StartStopWithChild net472

  • 🟥 throughput [-9323.491op/s; -8905.136op/s] or [-11.055%; -10.559%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • 🟥 throughput [-7036.301op/s; -5825.027op/s] or [-7.154%; -5.923%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+310.769ms; +316.290ms] or [+154.215%; +156.954%]
  • 🟥 throughput [-41.971op/s; -38.351op/s] or [-7.551%; -6.900%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟥 execution_time [+377.436ms; +379.084ms] or [+298.198%; +299.500%]
  • 🟩 throughput [+95.915op/s; +98.742op/s] or [+12.646%; +13.019%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+390.529ms; +393.052ms] or [+345.603%; +347.836%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-15.859ms; -11.682ms] or [-7.407%; -5.456%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.502%; +27.510%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-268248.425op/s; -264058.339op/s] or [-27.389%; -26.962%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-26.182ms; -21.341ms] or [-11.676%; -9.517%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-141235.196op/s; -125226.744op/s] or [-20.293%; -17.993%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net6.0

  • 🟩 throughput [+10228.299op/s; +13206.237op/s] or [+6.508%; +8.403%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody netcoreapp3.1

  • 🟩 throughput [+11017.547op/s; +13672.232op/s] or [+8.777%; +10.892%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0

  • 🟩 throughput [+400913.913op/s; +435878.697op/s] or [+13.368%; +14.534%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody netcoreapp3.1

  • 🟩 execution_time [-18.670ms; -14.306ms] or [-8.606%; -6.594%]
  • 🟩 throughput [+202152.997op/s; +255958.785op/s] or [+8.024%; +10.160%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟥 execution_time [+299.793ms; +300.453ms] or [+149.797%; +150.126%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟥 execution_time [+300.290ms; +303.609ms] or [+151.437%; +153.111%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs netcoreapp3.1

  • 🟥 execution_time [+299.402ms; +301.786ms] or [+150.815%; +152.016%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+297.630ms; +298.339ms] or [+146.184%; +146.532%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+293.204ms; +295.713ms] or [+143.337%; +144.563%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+302.899ms; +304.873ms] or [+151.389%; +152.375%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟥 execution_time [+22.663µs; +46.240µs] or [+7.235%; +14.762%]
  • 🟥 throughput [-430.514op/s; -232.099op/s] or [-13.420%; -7.235%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.570ms; +300.242ms] or [+149.516%; +149.852%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • unstable execution_time [+367.508ms; +405.822ms] or [+399.313%; +440.942%]
  • 🟩 throughput [+1063.038op/s; +1189.954op/s] or [+8.735%; +9.778%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • unstable execution_time [+304.648ms; +342.422ms] or [+231.317%; +259.998%]
  • 🟩 throughput [+651.698op/s; +848.550op/s] or [+6.309%; +8.215%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+286.370ms; +327.398ms] or [+131.670%; +150.534%]
  • 🟥 throughput [-541.675op/s; -505.254op/s] or [-49.081%; -45.781%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • unstable execution_time [+203.890ms; +337.127ms] or [+86.889%; +143.669%]
  • 🟥 throughput [-685.949op/s; -602.186op/s] or [-45.753%; -40.166%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+340.708ms; +349.734ms] or [+203.783%; +209.181%]
  • 🟥 throughput [-410.083op/s; -375.115op/s] or [-28.554%; -26.119%]

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

  • 🟩 execution_time [-82.037µs; -72.578µs] or [-7.608%; -6.731%]
  • 🟩 throughput [+66.975op/s; +77.279op/s] or [+7.221%; +8.332%]

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

  • unstable throughput [+0.531op/s; +56.637op/s] or [+0.099%; +10.572%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.424ms; +305.548ms] or [+152.798%; +153.868%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+302.498ms; +303.654ms] or [+151.582%; +152.161%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟥 execution_time [+300.673ms; +303.766ms] or [+151.045%; +152.599%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+303.793ms; +305.201ms] or [+152.555%; +153.262%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+299.467ms; +300.987ms] or [+148.073%; +148.825%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync netcoreapp3.1

  • 🟥 execution_time [+302.213ms; +305.754ms] or [+153.175%; +154.969%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+303.678ms; +305.685ms] or [+152.419%; +153.426%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+297.921ms; +300.286ms] or [+148.486%; +149.665%]
  • 🟩 throughput [+52468.619op/s; +60549.604op/s] or [+10.419%; +12.023%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+301.106ms; +303.590ms] or [+149.798%; +151.033%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net6.0

  • 🟩 execution_time [-16.714ms; -13.044ms] or [-7.772%; -6.065%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+4.233µs; +44.732µs] or [+1.046%; +11.049%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 allocated_mem [-27.117KB; -27.097KB] or [-9.892%; -9.884%]
  • unstable execution_time [-43.285µs; +9.394µs] or [-8.555%; +1.857%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • 🟩 allocated_mem [-15.920KB; -15.904KB] or [-5.804%; -5.798%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟥 execution_time [+5.492µs; +9.672µs] or [+12.983%; +22.862%]
  • 🟥 throughput [-4368.116op/s; -2568.438op/s] or [-18.388%; -10.812%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark netcoreapp3.1

  • unstable execution_time [-16.061µs; -9.223µs] or [-24.918%; -14.309%]
  • 🟩 throughput [+2466.692op/s; +3898.313op/s] or [+15.134%; +23.917%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+304.044ms; +306.047ms] or [+153.681%; +154.693%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+303.436ms; +305.925ms] or [+154.448%; +155.715%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+299.978ms; +302.267ms] or [+150.176%; +151.322%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+298.658ms; +300.245ms] or [+148.854%; +149.645%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net6.0

  • 🟥 execution_time [+301.895ms; +303.199ms] or [+151.597%; +152.252%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+302.896ms; +305.213ms] or [+153.610%; +154.784%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.282ms; +300.975ms] or [+149.782%; +150.128%]
  • 🟩 throughput [+66189577.751op/s; +66444207.530op/s] or [+48.203%; +48.389%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • unstable execution_time [+372.372ms; +409.375ms] or [+463.111%; +509.130%]
  • 🟩 throughput [+982.944op/s; +1158.079op/s] or [+7.599%; +8.953%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟥 execution_time [+299.309ms; +300.263ms] or [+149.288%; +149.764%]
  • 🟩 throughput [+13158508.580op/s; +17391016.929op/s] or [+5.828%; +7.703%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0

  • 🟩 throughput [+79977.871op/s; +88534.239op/s] or [+7.467%; +8.266%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1

  • 🟩 throughput [+56609.905op/s; +76101.528op/s] or [+6.552%; +8.809%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0

  • 🟩 throughput [+79017.091op/s; +108433.515op/s] or [+6.116%; +8.393%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan netcoreapp3.1

  • 🟩 throughput [+78819.889op/s; +86416.456op/s] or [+7.828%; +8.583%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟩 throughput [+43456.183op/s; +49861.683op/s] or [+7.891%; +9.054%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+80316.641op/s; +99051.515op/s] or [+8.973%; +11.067%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • 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 netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

dudikeleti and others added 2 commits May 6, 2026 15:50
… clearer error message

AddParameterAndVariable now closes a generic type definition by substituting
object for any reference-type argument. If a generic argument is a value type,
throw InvalidOperationException with a clear message instead of crashing later
in Expression.Variable / MakeGenericType.

ProbeExpressionParser.Binary: when a binary comparison throws
InvalidOperationException because one side is a value type and the other is a
reference type, report a friendly error ('A reference type cannot be compared
to a not nullable value type.') with a hint about using 'default' instead of
'null' when one side is the null constant.

Also drop an unused IbmMq using directive that was leaked into this file.

Co-authored-by: Cursor <[email protected]>
Close open generic scope member types during expression compilation, including constructed generics such as IEnumerable<T>, and return clear evaluation errors for unsupported value-type generic parameters.
@dudikeleti
dudikeleti force-pushed the dudik/probe-expression-parser-robustness branch from 48005dc to 119bbbd Compare May 6, 2026 13:50
@dudikeleti
dudikeleti marked this pull request as ready for review May 6, 2026 13:53
@dudikeleti dudikeleti removed the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label May 6, 2026
@dudikeleti dudikeleti changed the title [Debugger] ProbeExpressionParser: handle generic type definitions and clearer comparison error [Debugger] Handle open generic types in probe expressions May 6, 2026

@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: 119bbbdfca

ℹ️ 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".

Comment thread tracer/src/Datadog.Trace/Debugger/Expressions/ProbeExpressionParser.General.cs Outdated
var error = e.Message;
if (e is InvalidOperationException)
{
if ((left?.Type?.IsValueType == true && right?.Type?.IsValueType == false)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for && right?.Type?.IsValueType == false it means that if right or right.Type` is null, the condition will be true and will it be misleading?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, but it's still worth clarifying. ed7e753

Only rewrite reference/value comparison errors when the value side is non-nullable, and add coverage for nullable value type comparisons so Nullable<T> keeps its original expression-tree behavior.
Track generic parameters while closing open generic types so self-referential constraints return an evaluation error instead of recursing indefinitely. Add coverage for `where T : IComparable<T>`.
@dd-trace-dotnet-ci-bot

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

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

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration75.28 ± (74.97 - 75.58) ms74.77 ± (74.56 - 75.09) ms-0.7%
.NET Framework 4.8 - Bailout
duration78.09 ± (78.15 - 78.79) ms78.92 ± (78.82 - 79.34) ms+1.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1120.81 ± (1121.34 - 1128.97) ms1122.02 ± (1121.78 - 1128.19) ms+0.1%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.60 ± (22.54 - 22.66) ms22.81 ± (22.75 - 22.86) ms+0.9%✅⬆️
process.time_to_main_ms85.61 ± (85.29 - 85.94) ms87.13 ± (86.82 - 87.44) ms+1.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.92) MB10.91 ± (10.91 - 10.92) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.41 ± (22.36 - 22.45) ms22.46 ± (22.43 - 22.49) ms+0.2%✅⬆️
process.time_to_main_ms86.03 ± (85.84 - 86.23) ms85.68 ± (85.48 - 85.89) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.90 ± (10.89 - 10.90) MB10.95 ± (10.94 - 10.95) MB+0.5%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms205.14 ± (204.60 - 205.69) ms204.73 ± (204.17 - 205.30) ms-0.2%
process.time_to_main_ms567.03 ± (565.45 - 568.61) ms567.85 ± (566.39 - 569.31) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.86 ± (49.83 - 49.88) MB49.74 ± (49.71 - 49.77) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.3%
.NET 6 - Baseline
process.internal_duration_ms21.45 ± (21.39 - 21.50) ms21.60 ± (21.49 - 21.71) ms+0.7%✅⬆️
process.time_to_main_ms75.39 ± (75.05 - 75.72) ms75.94 ± (75.52 - 76.35) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.61) MB10.62 ± (10.62 - 10.62) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.39 ± (21.34 - 21.45) ms21.25 ± (21.21 - 21.30) ms-0.6%
process.time_to_main_ms76.36 ± (76.12 - 76.60) ms75.79 ± (75.53 - 76.05) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.74) MB10.75 ± (10.75 - 10.75) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms352.66 ± (350.79 - 354.52) ms355.37 ± (353.05 - 357.69) ms+0.8%✅⬆️
process.time_to_main_ms564.21 ± (562.60 - 565.81) ms560.82 ± (559.55 - 562.08) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.99 ± (50.97 - 51.02) MB51.11 ± (51.09 - 51.13) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.5%
.NET 8 - Baseline
process.internal_duration_ms19.43 ± (19.40 - 19.47) ms19.42 ± (19.38 - 19.46) ms-0.1%
process.time_to_main_ms72.68 ± (72.53 - 72.83) ms72.51 ± (72.34 - 72.69) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.66 - 7.67) MB7.67 ± (7.66 - 7.67) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.86 ± (19.81 - 19.92) ms19.67 ± (19.62 - 19.72) ms-1.0%
process.time_to_main_ms76.49 ± (76.21 - 76.77) ms75.76 ± (75.51 - 76.00) ms-1.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.71 - 7.72) MB7.73 ± (7.72 - 7.73) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms286.09 ± (282.45 - 289.73) ms281.91 ± (279.31 - 284.50) ms-1.5%
process.time_to_main_ms519.87 ± (518.61 - 521.12) ms519.47 ± (518.25 - 520.68) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.94 ± (37.91 - 37.97) MB37.90 ± (37.87 - 37.94) MB-0.1%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.3%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration194.53 ± (194.44 - 195.16) ms196.08 ± (196.11 - 196.88) ms+0.8%✅⬆️
.NET Framework 4.8 - Bailout
duration198.45 ± (198.25 - 198.78) ms199.10 ± (199.82 - 200.85) ms+0.3%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1210.00 ± (1209.50 - 1215.00) ms1208.12 ± (1208.46 - 1215.05) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms187.17 ± (186.78 - 187.56) ms189.95 ± (189.50 - 190.41) ms+1.5%✅⬆️
process.time_to_main_ms81.27 ± (81.09 - 81.46) ms83.24 ± (83.01 - 83.47) ms+2.4%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.05 ± (16.04 - 16.07) MB16.08 ± (16.06 - 16.10) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms186.80 ± (186.51 - 187.09) ms188.79 ± (188.46 - 189.13) ms+1.1%✅⬆️
process.time_to_main_ms82.92 ± (82.77 - 83.07) ms83.96 ± (83.80 - 84.11) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.20 ± (16.17 - 16.24) MB16.15 ± (16.11 - 16.18) MB-0.3%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (20 - 21)-0.7%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms373.76 ± (372.69 - 374.82) ms375.45 ± (374.45 - 376.45) ms+0.5%✅⬆️
process.time_to_main_ms551.42 ± (550.08 - 552.76) ms553.33 ± (551.99 - 554.68) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.46 ± (58.42 - 58.50) MB58.48 ± (58.44 - 58.52) MB+0.0%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.0%
.NET 6 - Baseline
process.internal_duration_ms195.73 ± (195.16 - 196.31) ms191.57 ± (191.32 - 191.82) ms-2.1%
process.time_to_main_ms72.01 ± (71.78 - 72.23) ms71.12 ± (70.96 - 71.28) ms-1.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.34 ± (16.33 - 16.36) MB16.09 ± (15.95 - 16.23) MB-1.5%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (18 - 19)-2.5%
.NET 6 - Bailout
process.internal_duration_ms193.06 ± (192.74 - 193.38) ms191.28 ± (190.92 - 191.65) ms-0.9%
process.time_to_main_ms72.03 ± (71.89 - 72.18) ms72.61 ± (72.44 - 72.78) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.30 ± (16.21 - 16.39) MB16.42 ± (16.33 - 16.50) MB+0.7%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.4%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms568.22 ± (565.17 - 571.26) ms569.73 ± (567.06 - 572.41) ms+0.3%✅⬆️
process.time_to_main_ms543.51 ± (542.52 - 544.51) ms552.85 ± (551.49 - 554.21) ms+1.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.93 ± (61.90 - 61.96) MB62.04 ± (62.01 - 62.07) MB+0.2%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)-0.4%
.NET 8 - Baseline
process.internal_duration_ms194.85 ± (194.35 - 195.36) ms190.47 ± (190.13 - 190.81) ms-2.2%
process.time_to_main_ms71.77 ± (71.59 - 71.95) ms70.61 ± (70.46 - 70.77) ms-1.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.73 ± (11.72 - 11.75) MB11.73 ± (11.70 - 11.75) MB-0.0%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.6%
.NET 8 - Bailout
process.internal_duration_ms193.07 ± (192.55 - 193.59) ms189.32 ± (189.05 - 189.59) ms-1.9%
process.time_to_main_ms72.44 ± (72.25 - 72.62) ms71.58 ± (71.46 - 71.70) ms-1.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.80 ± (11.78 - 11.81) MB11.80 ± (11.78 - 11.83) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.5%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms491.26 ± (488.81 - 493.72) ms495.19 ± (492.69 - 497.70) ms+0.8%✅⬆️
process.time_to_main_ms497.98 ± (497.09 - 498.88) ms503.59 ± (502.57 - 504.61) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed51.62 ± (51.59 - 51.64) MB51.55 ± (51.52 - 51.58) MB-0.1%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.5%✅⬆️
Comparison explanation

Execution-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:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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 charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8569) - mean (75ms)  : 71, 79
    master - mean (75ms)  : 71, 80

    section Bailout
    This PR (8569) - mean (79ms)  : 75, 83
    master - mean (78ms)  : 75, 82

    section CallTarget+Inlining+NGEN
    This PR (8569) - mean (1,125ms)  : 1078, 1172
    master - mean (1,125ms)  : 1071, 1179

Loading
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 (8569) - mean (117ms)  : 111, 123
    master - mean (115ms)  : 108, 123

    section Bailout
    This PR (8569) - mean (115ms)  : 112, 118
    master - mean (115ms)  : 112, 118

    section CallTarget+Inlining+NGEN
    This PR (8569) - mean (810ms)  : 782, 838
    master - mean (808ms)  : 783, 834

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8569) - mean (104ms)  : 97, 112
    master - mean (103ms)  : 98, 109

    section Bailout
    This PR (8569) - mean (104ms)  : 98, 109
    master - mean (104ms)  : 99, 109

    section CallTarget+Inlining+NGEN
    This PR (8569) - mean (944ms)  : 900, 987
    master - mean (946ms)  : 910, 981

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8569) - mean (100ms)  : 96, 104
    master - mean (100ms)  : 96, 104

    section Bailout
    This PR (8569) - mean (104ms)  : 98, 109
    master - mean (104ms)  : 99, 110

    section CallTarget+Inlining+NGEN
    This PR (8569) - mean (838ms)  : 774, 901
    master - mean (835ms)  : 778, 892

Loading
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 (8569) - mean (196ms)  : 193, 200
    master - mean (195ms)  : 191, 198

    section Bailout
    This PR (8569) - mean (200ms)  : 193, 208
    master - mean (199ms)  : 196, 201

    section CallTarget+Inlining+NGEN
    This PR (8569) - mean (1,212ms)  : 1165, 1259
    master - mean (1,212ms)  : 1173, 1251

Loading
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 (8569) - mean (282ms)  : 274, 291
    master - mean (277ms)  : 269, 284

    section Bailout
    This PR (8569) - mean (281ms)  : 277, 286
    master - mean (278ms)  : 274, 282

    section CallTarget+Inlining+NGEN
    This PR (8569) - mean (969ms)  : 937, 1001
    master - mean (964ms)  : 938, 990

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8569) - mean (271ms)  : 268, 274
    master - mean (276ms)  : 263, 290

    section Bailout
    This PR (8569) - mean (272ms)  : 267, 277
    master - mean (273ms)  : 268, 278

    section CallTarget+Inlining+NGEN
    This PR (8569) - mean (1,153ms)  : 1107, 1200
    master - mean (1,144ms)  : 1097, 1191

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8569) - mean (272ms)  : 266, 277
    master - mean (277ms)  : 266, 287

    section Bailout
    This PR (8569) - mean (271ms)  : 266, 275
    master - mean (275ms)  : 264, 287

    section CallTarget+Inlining+NGEN
    This PR (8569) - mean (1,033ms)  : 986, 1080
    master - mean (1,023ms)  : 980, 1067

Loading

@dudikeleti
dudikeleti requested a review from a team as a code owner May 11, 2026 12:19
@dudikeleti
dudikeleti enabled auto-merge (squash) May 11, 2026 12:29
@dudikeleti
dudikeleti merged commit 4abf6b3 into master May 11, 2026
71 of 76 checks passed
@dudikeleti
dudikeleti deleted the dudik/probe-expression-parser-robustness branch May 11, 2026 14:38
@github-actions github-actions Bot added this to the vNext-v3 milestone May 11, 2026
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.

3 participants