Runtime, GC and HardwareIntrinsics report info is empty for in-process toolchains
BenchmarkReport.GetRuntimeInfo(), GetGcInfo() and GetHardwareIntrinsicsInfo() always return null when the benchmark ran under InProcessEmitToolchain or InProcessNoEmitToolchain.
Repro Any benchmark with [SimpleJob(RunStrategy.ColdStart)] + an in-process toolchain. // * Detailed results * prints: MyBench.Identity: Dry(Runtime=.NET 10.0, Toolchain=InProcessEmitToolchain 10.0, ...) Runtime = ; GC = and the summary header lists only [Host], with no line for the job: [Host] : .NET 10.0.11 (10.0.11, 10.0.1126.37416), X64 RyuJIT x86-64-v4 With an out-of-process toolchain both are filled in.
Cause The in-process runners write the lines (InProcessEmitRunner.cs:69-72, InProcessNoEmitRunner.cs:155), but InProcessHost.WriteLine only retains diagnoser lines, and ExecuteResult.FromRunResults builds the result through the constructor that sets PrefixedLines = [] (ExecuteResult.cs:49-60). GetInfoFromOutput reads PrefixedLines, so it never matches.
Affected output
- // * Detailed results * BenchmarkReportExporter.cs:27
- Summary.AllRuntimes skips reports whose runtime is null, so in-process jobs get no line (Summary.cs:111-124)
- JSON exporter —"HardwareIntrinsics": "" (JsonExporterBase.cs:81)
- Both test adapters, which copy BDN's format (TestingPlatform/BenchmarkEventProcessor.cs:195, VSTest/VSTestEventProcessor.cs:123)
Possible fixes
- Have InProcessHost collect //-prefixed lines and carry them through FromRunResults into ExecuteResult.PrefixedLines keeps one code path for both toolchain kinds.
- Or set the three values on the report directly, since in-process they're already available via BenchmarkEnvironmentInfo.GetCurrent() without a round-trip through text.
Source: dotnet/BenchmarkDotNet