Skip to content

Inproc crashreport logging#3

Draft
mdh1418 wants to merge 103 commits into
inproc_crashreport_iosfrom
inproc_crashreport_logging
Draft

Inproc crashreport logging#3
mdh1418 wants to merge 103 commits into
inproc_crashreport_iosfrom
inproc_crashreport_logging

Conversation

@mdh1418
Copy link
Copy Markdown
Owner

@mdh1418 mdh1418 commented May 6, 2026

No description provided.

jakobbotsch and others added 30 commits May 5, 2026 18:33
This skill triages Fuzzlyn weekend runs. It:
- Downloads the artifacts and selects failures found by Fuzzlyn.
Currently it focuses only on assertion failures.
- Downloads the Core_Root that Fuzzlyn was testing.
- Uses superpmi to find a context that reproduces the failure and mcs to
extract that context.
- Uses superpmi to create a jitdump of the failure.
- Analyses the jitdump and JIT source to give its own input on what the
issue may be.
- Creates a zip with the repro.mc, jitdump.txt, and an issue.md file
that can be used to open a github issue

dotnet#127745 and dotnet#127747 are examples of what the issue.md file looks like
once posted. The idea is to give enough detail that we can evaluate
whether it sounds right or not, possibly come up with our own revisions,
and then have CCA pick it up and actually fix the issue.
`TypeMapHandler.MarkTypeMapAttribute` calls
`Annotations.MarkInstantiated` directly, which only records the type as
instantiated without running the full processing pipeline. When
`MarkRequirementsForInstantiatedTypes` is later called for the same type
(e.g. because of a `new` expression), it sees the type is already marked
as instantiated and returns early — skipping the calls to
`TypeMapHandler.ProcessType` and `TypeMapHandler.ProcessInstantiated`,
which are responsible for marking matching `TypeMap` and
`TypeMapAssociation` entries respectively.

This causes two bugs:

1. **`TypeMapAssociation` trimmed** (dotnet#127004): When a type appears as
the target in both a `TypeMap` and a `TypeMapAssociation`, the
`TypeMapAssociation` entry is incorrectly trimmed because
`ProcessInstantiated` is never called.

2. **`TypeMap` trimmed** (dotnet#127504): When a type is both the proxy target
of a `TypeMapAssociation` (arg\[1]) and the trimTarget of a `TypeMap`
(arg\[2]), and the proxy association's source type is instantiated
before the trim target, the `TypeMap` entry is incorrectly trimmed
because `ProcessType` is never called.

The fix changes `MarkTypeMapAttribute` to call
`MarkRequirementsForInstantiatedTypes` instead of
`Annotations.MarkInstantiated`. This ensures the full instantiation
pipeline runs (including both `ProcessType` and `ProcessInstantiated`),
so external `TypeMap` and proxy `TypeMapAssociation` entries are
properly retained regardless of instantiation order. The method's
visibility is widened from `protected` to `protected internal` to allow
the call from `TypeMapHandler`.

Test cases are added for both scenarios.

Fixes dotnet#127004.
Fixes dotnet#127504.

---------

Co-authored-by: Copilot <[email protected]>
… tvOS builds (dotnet#127178)

Applies size optimizations for CoreCLR WebAssembly, iOS, and tvOS builds
by removing GC modes that are unavailable or unnecessary on those
platforms.

### Size measurements (`corerun.wasm`)

| Configuration | Raw (bytes) | Brotli (bytes) |
|---|---|---|
| Original baseline | 4,497,135 | 1,340,828 |
| Disable server GC + background GC | **4,171,449** | **1,258,272** |
| **Total savings** | **325,686 (7.2%)** | **82,556 (6.2%)** |

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: davidwrighton <[email protected]>
Co-authored-by: janvorli <[email protected]>
Co-authored-by: Pavel Savara <[email protected]>
Co-authored-by: Radek Doulik <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: David Wrighton <[email protected]>
Co-authored-by: jkotas <[email protected]>
The hash table is created and filled with values. Add
`g_hash_table_destroy` to free memory.

Compilation occurs with `cfg->verbose_level >= 2`. Disassembled code is
written to standard output. The flow is as follows:
- An empty table is created.
- The table is filled with pairs of pointers:
Key: `bb->native_offset // The offset of the generated code, used for
fixups`
Value: `bb->block_num + 1 // unique block number identification`
- A hash table search is performed, followed by output of `bb_num` to a
temporary file `ofd` in ascending order of `bb->native_offset`.

A memory leak then occurs because the hash table is never destroyed.

Signed-off-by: Aleksandr Dovydenkov <[email protected]>
Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Aleksandr Dovydenkov <[email protected]>
It won't be possible to be used in source with new compiler
(dotnet/roslyn#83295). Specifically, it will
result in
```
error CS9379: Do not use 'RequiresUnsafeAttribute' in source; use the 'unsafe' modifier instead.
```
Related to dotnet#125800 and
dotnet/roslyn#81207.
Adding `TraverseVirtCallStubHeap` SOS API, using the same
`TraverseLoaderHeapCore` loader heap traversal structure added for the
`TraverseLoaderHeap` APIs.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: rcj1 <[email protected]>
Co-authored-by: max-charlamb <[email protected]>
Co-authored-by: rcj1 <[email protected]>
…otnet#127303)

## Background

`DateTime.UtcNow` can jump due to NTP sync, causing elapsed time
reported to EventCounter subscribers to be incorrect for that interval —
affecting rate calculations like requests/sec in monitoring dashboards.
Stopwatch is monotonic and not subject to clock adjustments.

`CounterGroup` is only directly referenced from `DiagnosticCounter`.
`DiagnosticCounter` is the base class of `EventCounter`,
`PollingCounter`, `IncrementingPollingCounter`,
`IncrementingEventCounter`, so they all are affected.
…#127773)

And no longer do this on the host side. This will let the host split out
funclets without having to parse the JIT-generated code.
## Automated Dependency Update

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `7c1931f` →
`0596a84` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `0ef2d61` →
`abd0864` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `051f8f1` →
`c9dc510` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `754a73d` →
`9e71dbc` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `20b45a0` →
`9d938f6` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `7a5b1a8` →
`030241e` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `f0d4e84` →
`ff0868b` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `2d2df03` →
`360a2dc` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `58f51fb` →
`010211f` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `6ad25da` →
`d61f2b7` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `05e16d1` →
`4bf6a0a` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `09e23d7` →
`ede2550` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `0d1628f` →
`28a8f1c` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `f3eb05c` →
`2191169` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `8dc85a0` →
`71ebe96` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `0fc4e37` →
`527933f` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `51d0879` →
`9ee81df` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `b6a2e70` →
`d442f29` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `7be7701` →
`a1d0aff` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `dc020b6` →
`664efcd` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `5b8a4bb` →
`75e59a4` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `e601475` →
`09e5e6a` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `9165c90` →
`0e9efcf` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `5908b2e` →
`6833f4b` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `6f5f90b` →
`f82e3fa` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `cd8001a` →
`3849fef` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `846c828` →
`a4b9035` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `3278744` →
`e364bac` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `567cec8` →
`d6ae4c8` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `f38b4db` →
`a18d858` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `3d3aa4e` →
`949fc61` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `e688700` →
`c71e530` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `a31af6e` →
`b3bccb9` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `46268aa` →
`943d8e8` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `2b2d3b9` →
`7345d8b` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `bbc4191` →
`d8cdb6c` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `8c9ecb5` →
`a219633` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `5a2238e` →
`a5f826c` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `b62d3e5` →
`0e01074` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `8e2b84e` →
`09f90b1` |
| mcr.microsoft.com/dotnet-buildtools/prereqs | digest | `462906a` →
`ac402d0` |

This PR has been created automatically by the [.NET Renovate
Bot](https://redirect.github.com/dotnet/arcade/blob/main/Documentation/Renovate.md)
to update one or more dependencies in your repo. Please review the
changes and merge the PR if everything looks good.

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
…27779)

## Description

`LoopbackServer.Connection` grows its read buffers by a fixed
`+BufferSize` (4000 bytes) on each resize, causing O(n²) copying for
large payloads. Changed to `*2` doubling in both `ReadToEndAsync` and
`ReadLineBytesAsync` using `Array.Resize`.

**`ReadToEndAsync`:**
- Fixed the resize trigger from `bytesRead == buffer.Length` to `offset
== buffer.Length` (the previous check would stop triggering after the
first resize, since subsequent reads only fill the remaining buffer
space)
- Replaced manual `new byte[] + CopyTo` with `Array.Resize(ref buffer,
buffer.Length * 2)`
- Removed the redundant `totalLength` variable; the final `GetString`
now uses `offset` directly

**`ReadLineBytesAsync`:**
- Replaced manual `new byte[] + Array.Copy` (into new buffer) with
in-place `Array.Copy` to compact live data, followed by
`Array.Resize(ref _readBuffer, _readBuffer.Length * 2)`
- Index resets (`_readStart`, `_readEnd`, `startSearch`) are now always
applied unconditionally after the compact step

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: agocke <[email protected]>
Co-authored-by: MihaZupan <[email protected]>
…dotnet#127819)

Fixes dotnet#127794

`string.Format` with `CompositeFormat` returned the raw format string
instead of unescaping `{{`→`{` and `}}`→`}` when no format holes were
present.

## Root Cause

Two fast-paths in `String.Manipulation.cs` short-circuit to
`format.Format` (the original unparsed string) without checking whether
brace escaping occurred:

1. `args.Length == 0` branch returns `format.Format` unconditionally
2. `_formattedCount == 0` guard in the private
`Format<TArg0,TArg1,TArg2>` returns `format.Format` unconditionally

`StringBuilder.AppendFormat` and `MemoryExtensions.TryWrite` lack these
fast-paths and work correctly by always iterating parsed segments.

## Fix

Both conditions additionally check `format._literalLength ==
format.Format.Length`. When escaped braces are present, the unescaped
literal length is shorter than the raw format string, so the condition
is `false` and execution falls through to the correct segment-iteration
path.

```csharp
// Before:
0 => format.Format,

// After:
0 => format._literalLength == format.Format.Length
    ? format.Format
    : Format(provider, format, (object?)null, 0, 0, args),
```

```csharp
// Before:
if (format._formattedCount == 0) { return format.Format; }

// After:
if (format._formattedCount == 0 && format._literalLength == format.Format.Length)
{ return format.Format; }
```

## Test Coverage

Three new entries in `Format_Valid_TestData` (reused by
`StringFormat_Valid`, `StringBuilderAppendFormat_Valid`, and
`MemoryExtensionsTryWrite_Valid`):

| Format | Expected |
|--------|----------|
| `"{{"` | `"{"` |
| `"}}"` | `"}"` |
| `"{{text}}"` | `"{text}"` |

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: tarekgh <[email protected]>
Adds generic numeric APIs to `System.Random`:
- `NextInteger<T>()`
- `NextInteger<T>(T maxValue)`
- `NextInteger<T>(T minValue, T maxValue)`
- `NextBinaryFloat<T>()`.

Fixes dotnet#75431

Co-authored-by: Copilot <[email protected]>
…et#127836)

> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.

## Problem

The OBJECT libraries created by `generate_data_descriptors()` in
`src/coreclr/clrdatadescriptors.cmake` compile `contract-descriptor.c`
and `contractpointerdata.cpp` with MSVC defaults, which routes debug
info into the compiler-default `vc140.pdb`. That PDB does not travel
with the `.obj` files when they are archived into a static library such
as `Runtime.ServerGC.lib`.

Downstream linkers — in particular the NativeAOT publish of
`ILCompiler`, `crossgen2`, and `ilasm` on Windows — then emit `LNK4099`
("PDB 'vc140.pdb' was not found") for each affected object, which is
fatal under `/WX`.

## Symptom

The `dotnet/runtime` → `dotnet/dotnet` codeflow PR
[dotnet/dotnet#6423](dotnet/dotnet#6423) is
blocked: the **VMR Vertical Build Windows_x64** and **VMR Vertical Build
Windows_x86** legs both fail with 22 `LNK4099` errors apiece, e.g.:

```
Runtime.ServerGC.lib(contract-descriptor.c.obj) : error LNK4099:
  PDB 'vc140.pdb' was not found with 'Runtime.ServerGC.lib(contract-descriptor.c.obj)'
  or at '...\artifacts\bin\ILCompiler_publish\x64\Release\native\vc140.pdb';
  linking object as if no debug info
   [src\coreclr\tools\aot\ILCompiler\ILCompiler_publish.csproj]
Runtime.ServerGC.lib(contractpointerdata.cpp.obj) : error LNK4099: ...
```

repeated for `crossgen2_publish.csproj` and `ilasm.csproj`.
Linux/macOS/WASM/iOS/Android verticals all pass — `LNK4099` is
MSVC-specific.

The regression was introduced by dotnet#126972 ("[NativeAOT] Add cDAC data
descriptor infrastructure"), which wired the new descriptor `OBJECT`
libraries into the NativeAOT runtime so they end up archived inside
`Runtime.ServerGC.lib`.

## Fix

Set `COMPILE_PDB_NAME` and `COMPILE_PDB_OUTPUT_DIRECTORY` on
`${LIBRARY}` so each descriptor library produces its own deterministic
PDB that the consuming linker can locate. This matches the convention
already used by `install_static_library` in
`eng/native/functions.cmake`.

## Validation

- CMake reconfigures cleanly.
- Ninja built `nativeaot_gc_svr_descriptor`,
`nativeaot_gc_wks_descriptor`, `nativeaot_cdac_contract_descriptor`, and
`cdac_contract_descriptor` without errors on linux-x64.
- The actual `LNK4099` resolution can only be verified on a Windows
NativeAOT publish leg in CI; please pay particular attention to the
Windows legs and to the next forward-flow into `dotnet/dotnet`.

cc @max-charlamb (author of dotnet#126972)

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
…/ Android (dotnet#127789)

## Description

`EncoderDecoderTestBase.RoundTrip_AllWindowLogs` (Deflate / ZLib / GZip
variants) deterministically returns
`OperationStatus.DestinationTooSmall` on every Apple-mobile and Android
architecture regardless of runtime flavor tracked in dotnet#127563.

Co-authored-by: Copilot <[email protected]>
dotnet#97893

This PR capture the original reader's `_lineNumber` and
`_bytePositionInLine` in `JsonSerializer.GetReaderScopedToNextValue`,
rewind them per token type to point immediately before the value token,
and pass them to the scoped reader through `JsonReaderState`. The scoped
reader, after consuming its first token, lands on the same position as
the original reader, so `JsonException` now reports positions relative
to the original input.

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
…ions (dotnet#126549)

Part of dotnet#127279
### Summary
`ImmutableSortedSet<T>.SetEquals` always creates a new intermediate
`SortedSet<T>` for the `other` collection, leading to avoidable
allocations and GC pressure, especially for large datasets

### Optimization Logic

* **Type-Specific Fast Paths:** Uses pattern matching to detect if
`other` is an `ImmutableSortedSet` or `SortedSet`, triggering optimized
logic only if their `Comparer` matches.
* **O(1) Early Exit:** Performs an immediate `ReferenceEquals` check and
leverages `ICollection` to return `false` early if `other.Count` is less
than `this.Count`.
* **Sequential Lock-Step Comparison:** Replaces the $O(\log n)$
per-element `.Contains()` check with a dual-enumerator `while` loop.
This leverages the sorted nature of both sets to achieve $O(n)$ linear
complexity.
* **Zero Allocation Path:** For compatible sorted sets, the comparison
is performed directly on existing instances, eliminating the memory
overhead of temporary collections.
* **Refined Fallback:** Even when a `new SortedSet<T>` is required for
general `IEnumerable` types, the final comparison now uses the same
efficient $O(n)$ sequential scan instead of repeated lookups.
<details>
<summary><b>Click to expand Benchmark Source Code</b></summary>

```csharp
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Order;
using BenchmarkDotNet.Running;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;

namespace ImmutableSortedSetBenchmarks
{
    [MemoryDiagnoser]
    [Orderer(SummaryOrderPolicy.FastestToSlowest)]
    [RankColumn]
    public class ImmutableSortedSetSetEqualsBenchmark_Int
    {
        private ImmutableSortedSet<int> _sourceSet = null!;
        private ImmutableSortedSet<int> _immutableSortedSetEqual = null!;
        private SortedSet<int> _bclSortedSetEqual = null!;
        private List<int> _listEqual = null!;
        private IEnumerable<int> _linqSelectEqual = null!;
        private int[] _arrayEqual = null!;
        private List<int> _listLastDiff = null!;
        private List<int> _listSmaller = null!;
        private ImmutableSortedSet<int> _immutableLarger = null!;
        private int[] _smallerArray = null!;
        private SortedSet<int> _smallerSortedSetDiffComparer = null!;

        private ImmutableSortedSet<int> _immutableSortedSetLastDiff = null!;
        private SortedSet<int> _bclSortedSetLastDiff = null!;
        private List<int> _listWithDuplicates = null!;
        private List<int> _listWithDuplicatesMatch = null!;

        private SortedSet<int> _bclSortedSetDiffComparer = null!;

        private ImmutableSortedSet<int> _immutableSortedSetSmaller = null!;
        private SortedSet<int> _bclSortedSetSmaller = null!;

        private IEnumerable<int> _lazyEnumerableLastDiff = null!;
       

        [Params(100000)]
        public int Size { get; set; }

        [GlobalSetup]
        public void Setup()
        {
            var elements = Enumerable.Range(0, Size).ToList();
            var elementsWithLastDiff = Enumerable.Range(0, Size - 1).Concat(new[] { Size + 1000 }).ToList();
            var smallerElements = Enumerable.Range(0, Size / 2).ToList();
            var duplicates = Enumerable.Repeat(1, Size).ToList();
            var smallerList = new List<int>();

            for(int i = 0; i < Size - 1; i++) smallerList.Add(i);

            var reverseComparer = new ReverseComparer<int>();

            _sourceSet = ImmutableSortedSet.CreateRange(elements);
            _immutableSortedSetEqual = ImmutableSortedSet.CreateRange(elements);
            _bclSortedSetEqual = new SortedSet<int>(elements);
            _listEqual = elements;
            _linqSelectEqual = elements.Select(x => x); 
            _arrayEqual = elements.ToArray();

            _immutableSortedSetLastDiff = ImmutableSortedSet.CreateRange(elementsWithLastDiff);
            _bclSortedSetLastDiff = new SortedSet<int>(elementsWithLastDiff);
            _listLastDiff = elementsWithLastDiff;

            _bclSortedSetDiffComparer = new SortedSet<int>(elements, reverseComparer);

            _immutableSortedSetSmaller = ImmutableSortedSet.CreateRange(smallerElements);
            _bclSortedSetSmaller = new SortedSet<int>(smallerElements);

            _lazyEnumerableLastDiff = elementsWithLastDiff.Select(x => x);
            _immutableLarger = ImmutableSortedSet.CreateRange(elements.Concat(new[] { -1 }));
            _listWithDuplicates = duplicates;
            _listWithDuplicatesMatch = elements.Concat(elements).ToList(); 
            _listSmaller = smallerList;
            _smallerArray = Enumerable.Range(0, Size - 1).ToArray();
            _smallerSortedSetDiffComparer = new SortedSet<int>(_listSmaller, reverseComparer);
        }

        #region Fast Path: Same Type and Comparer

        [Benchmark(Description = "ImmutableSortedSet (Match - Same Comparer)")]
        public bool Case_ImmutableSortedSet_Match() => _sourceSet.SetEquals(_immutableSortedSetEqual);

        [Benchmark(Description = "BCL SortedSet (Match - Same Comparer)")]
        public bool Case_BclSortedSet_Match() => _sourceSet.SetEquals(_bclSortedSetEqual);

        [Benchmark(Description = "ImmutableSortedSet (Mismatch - Same Count)")]
        public bool Case_ImmutableSortedSet_LastDiff() => _sourceSet.SetEquals(_immutableSortedSetLastDiff);

        [Benchmark(Description = "BCL SortedSet (Mismatch - Same Count)")]
        public bool Case_BclSortedSet_LastDiff() => _sourceSet.SetEquals(_bclSortedSetLastDiff);

        #endregion

        #region Early Exit: Count Mismatch

        [Benchmark(Description = "ImmutableSortedSet (Smaller Count)")]
        public bool Case_ImmutableSortedSet_SmallerCount() => _sourceSet.SetEquals(_immutableSortedSetSmaller);

        [Benchmark(Description = "BCL SortedSet (Smaller Count)")]
        public bool Case_BclSortedSet_SmallerCount() => _sourceSet.SetEquals(_bclSortedSetSmaller);

        [Benchmark(Description = "Array (Smaller Count)")]
        public bool Case_SmallerCollection_EarlyExit() => _sourceSet.SetEquals(_smallerArray);

        #endregion

        #region Fallback Path: Different Comparer

        [Benchmark(Description = "SortedSet (Different Comparer)")]
        public bool Case_SortedSet_DifferentComparer() => _sourceSet.SetEquals(_bclSortedSetDiffComparer);

        [Benchmark(Description = "SortedSet (Smaller Count - Different Comparer)")]
        public bool Case_SortedSet_SmallerCount_DiffComparer() => _sourceSet.SetEquals(_smallerSortedSetDiffComparer);

        #endregion

        #region Fallback Path: Non-Set Collections

        [Benchmark(Description = "List (Match - Fallback)")]
        public bool Case_List_Match() => _sourceSet.SetEquals(_listEqual);

        [Benchmark(Description = "LINQ (Mismatch - Lazy IEnumerable)")]
        public bool Case_LazyEnumerable_LastDiff() => _sourceSet.SetEquals(_lazyEnumerableLastDiff);

        [Benchmark(Description = "LINQ (Match - Lazy IEnumerable)")]
        public bool Case_LazyEnumerable_Match() => _sourceSet.SetEquals(_linqSelectEqual);

        [Benchmark(Description = "List (Last Diff - Fallback)")]
        public bool Case_List_LastDiff() => _sourceSet.SetEquals(_listLastDiff);

        [Benchmark(Description = "Array (Match - Fallback)")]
        public bool Case_Array_Match() => _sourceSet.SetEquals(_arrayEqual);

        [Benchmark(Description = "ImmutableSortedSet (Larger Count)")]
        public bool Case_LargerCount() => _sourceSet.SetEquals(_immutableLarger);

        #endregion

        #region Handling Duplicates

        [Benchmark(Description = "List with Duplicates (Mismatch)")]
        public bool Case_List_Duplicates_Mismatch() => _sourceSet.SetEquals(_listWithDuplicates);

        [Benchmark(Description = "List with Duplicates (Match)")]
        public bool Case_List_Duplicates_Match() => _sourceSet.SetEquals(_listWithDuplicatesMatch);

        #endregion
    }

    public class ReverseComparer<T> : IComparer<T> where T : IComparable<T>
    {
        public int Compare(T? x, T? y)
        {
            if (x == null && y == null) return 0;
            if (x == null) return 1;
            if (y == null) return -1;
            return y.CompareTo(x);
        }
    }

    public class Program
    {
        public static void Main(string[] args)
        {
            BenchmarkRunner.Run<ImmutableSortedSetSetEqualsBenchmark_Int>();
        }
    }
}
```
</details>

<details>
<summary><b>Click to expand Benchmark Results</b></summary>

### Benchmark Results (Before Optimization)

| Method | Size | Mean | Error | StdDev | Rank | Gen0 | Gen1 | Gen2 |
Allocated |

|--------------------------------------------------|--------|------------:|------------:|------------:|-----:|-----------:|-----------:|---------:|------------:|
| 'List with Duplicates (Mismatch)' | 100000 | 1.931 ms | 0.0321 ms |
0.0268 ms | 1 | 9.7656 | 9.7656 | 9.7656 | 390.8 KB |
| 'BCL SortedSet (Smaller Count)' | 100000 | 1.956 ms | 0.0249 ms |
0.0233 ms | 1 | 371.0938 | 285.1563 | - | 1953.73 KB |
| 'ImmutableSortedSet (Smaller Count)' | 100000 | 3.516 ms | 0.0413 ms |
0.0387 ms | 2 | 367.1875 | 304.6875 | 3.9063 | 2148.52 KB |
| 'Array (Smaller Count)' | 100000 | 4.910 ms | 0.0860 ms | 0.0718 ms |
3 | 671.8750 | 609.3750 | 7.8125 | 4296.91 KB |
| 'SortedSet (Smaller Count - Different Comparer)' | 100000 | 6.799 ms |
0.0873 ms | 0.0816 ms | 4 | 679.6875 | 609.3750 | 7.8125 | 4297.31 KB |
| 'ImmutableSortedSet (Larger Count)' | 100000 | 7.513 ms | 0.1106 ms |
0.0981 ms | 5 | 671.8750 | 625.0000 | 7.8125 | 4297 KB |
| 'List (Match - Fallback)' | 100000 | 13.665 ms | 0.1204 ms | 0.1005 ms
| 6 | 671.8750 | 625.0000 | - | 4297.26 KB |
| 'Array (Match - Fallback)' | 100000 | 13.797 ms | 0.0807 ms | 0.0716
ms | 6 | 656.2500 | 625.0000 | - | 4297.25 KB |
| 'List (Last Diff - Fallback)' | 100000 | 13.888 ms | 0.1573 ms |
0.1394 ms | 6 | 671.8750 | 609.3750 | - | 4297.25 KB |
| 'BCL SortedSet (Match - Same Comparer)' | 100000 | 14.849 ms | 0.2830
ms | 0.2647 ms | 7 | 671.8750 | 609.3750 | - | 3907.19 KB |
| 'BCL SortedSet (Mismatch - Same Count)' | 100000 | 15.137 ms | 0.2700
ms | 0.2526 ms | 7 | 671.8750 | 625.0000 | - | 3907.19 KB |
| 'LINQ (Mismatch - Lazy IEnumerable)' | 100000 | 15.202 ms | 0.1243 ms
| 0.1162 ms | 7 | 750.0000 | 625.0000 | 15.6250 | 4931.04 KB |
| 'SortedSet (Different Comparer)' | 100000 | 15.214 ms | 0.1632 ms |
0.1447 ms | 7 | 640.6250 | 625.0000 | - | 4297.65 KB |
| 'LINQ (Match - Lazy IEnumerable)' | 100000 | 15.360 ms | 0.1323 ms |
0.1238 ms | 7 | 734.3750 | 640.6250 | 15.6250 | 4931.13 KB |
| 'ImmutableSortedSet (Mismatch - Same Count)' | 100000 | 17.122 ms |
0.2080 ms | 0.1946 ms | 8 | 656.2500 | 593.7500 | - | 4297.26 KB |
| 'ImmutableSortedSet (Match - Same Comparer)' | 100000 | 17.256 ms |
0.2191 ms | 0.1829 ms | 8 | 750.0000 | 593.7500 | - | 4297.25 KB |
| 'List with Duplicates (Match)' | 100000 | 31.781 ms | 0.2065 ms |
0.1724 ms | 9 | 625.0000 | 562.5000 | - | 4687.9 KB |
---

### Benchmark Results (After Optimization)

| Method | Size | Mean | Error | StdDev | Gen0 | Gen1 | Gen2 | Allocated
|
|:---|---:|---:|---:|---:|---:|---:|---:|---:|
| 'ImmutableSortedSet (Larger Count)' | 100000 | 1.605 ns | 0.0427 ns |
0.0379 ns | - | - | - | - |
| 'ImmutableSortedSet (Smaller Count)' | 100000 | 1.624 ns | 0.0491 ns |
0.0459 ns | - | - | - | - |
| 'SortedSet (Smaller Count - Different Comparer)' | 100000 | 1.690 ns |
0.0456 ns | 0.0404 ns | - | - | - | - |
| 'BCL SortedSet (Smaller Count)' | 100000 | 1.816 ns | 0.0569 ns |
0.0532 ns | - | - | - | - |
| 'Array (Smaller Count)' | 100000 | 2.155 ns | 0.0625 ns | 0.0522 ns |
- | - | - | - |
| 'List with Duplicates (Mismatch)' | 100000 | 1,241,268.377 ns |
9,938.3202 ns | 8,810.0620 ns | 9.7656 | 9.7656 | 9.7656 | 400150 B |
| 'BCL SortedSet (Mismatch - Same Count)' | 100000 | 2,656,001.235 ns |
26,235.3715 ns | 23,256.9735 ns | - | - | - | 312 B |
| 'BCL SortedSet (Match - Same Comparer)' | 100000 | 2,656,167.835 ns |
36,661.1748 ns | 32,499.1766 ns | - | - | - | 314 B |
| 'ImmutableSortedSet (Mismatch - Same Count)' | 100000 | 3,658,683.860
ns | 43,801.7836 ns | 40,972.2155 ns | - | - | - | - |
| 'ImmutableSortedSet (Match - Same Comparer)' | 100000 | 3,672,184.801
ns | 28,641.6696 ns | 22,361.5316 ns | - | - | - | - |
| 'List (Match - Fallback)' | 100000 | 7,607,183.416 ns | 116,938.1638
ns | 97,648.6630 ns | 671.8750 | 625.0000 | - | 4400390 B |
| 'List (Last Diff - Fallback)' | 100000 | 7,713,407.057 ns |
123,214.3767 ns | 109,226.3356 ns | 671.8750 | 625.0000 | 7.8125 |
4400387 B |
| 'Array (Match - Fallback)' | 100000 | 7,717,749.754 ns | 124,099.3086
ns | 116,082.5703 ns | 664.0625 | 625.0000 | 7.8125 | 4400387 B |
| 'LINQ (Mismatch - Lazy IEnumerable)' | 100000 | 8,974,566.438 ns |
171,672.9513 ns | 160,582.9853 ns | 750.0000 | 593.7500 | 15.6250 |
5049380 B |
| 'LINQ (Match - Lazy IEnumerable)' | 100000 | 9,006,743.952 ns |
112,508.0211 ns | 105,240.0728 ns | 734.3750 | 640.6250 | 15.6250 |
5049380 B |
| 'SortedSet (Different Comparer)' | 100000 | 9,661,422.295 ns |
175,748.1986 ns | 164,394.9741 ns | 656.2500 | 609.3750 | - | 4400729 B
|
| 'List with Duplicates (Match)' | 100000 | 24,718,281.944 ns |
253,370.8073 ns | 224,606.6212 ns | 656.2500 | 593.7500 | - | 4800396 B
|
</details>


### Performance Analysis Summary (100,000 Elements)

### Performance Analysis Summary (100,000 Elements)

| Case | Speed Improvement | Memory Improvement |
| :--- | :--- | :--- |
| **ImmutableSortedSet (Larger Count)** | **~4,681,000x** | **Zero
Alloc** |
| **SortedSet (Smaller - Diff Comparer)** | **~4,023,000x** | **Zero
Alloc** |
| **ImmutableSortedSet (Smaller Count)** | **~2,165,000x** | **Zero
Alloc** |
| **Array (Smaller Count)** | **~2,278,000x** | **Zero Alloc** |
| **BCL SortedSet (Smaller Count)** | **~1,077,000x** | **Zero Alloc** |
| **BCL SortedSet (Mismatch - Same Count)** | **~5.70x** | **~99.99%** |
| **BCL SortedSet (Match - Same Comparer)** | **~5.59x** | **~99.99%** |
| **ImmutableSortedSet (Match - Same Comparer)** | **~4.70x** | **Zero
Alloc** |
| **ImmutableSortedSet (Mismatch - Same Count)** | **~4.68x** | **Zero
Alloc** |
| **List (Match - Fallback)** | **~1.80x** | Stable |
| **Array (Match - Fallback)** | **~1.79x** | Stable |
| **List (Last Diff - Fallback)** | **~1.80x** | Stable |
| **LINQ (Mismatch - Lazy IEnumerable)** | **~1.69x** | Stable |
| **LINQ (Match - Lazy IEnumerable)** | **~1.70x** | Stable |
| **List with Duplicates (Mismatch)** | **~1.56x** | Stable |
| **SortedSet (Different Comparer)** | **~1.57x** | Stable |
| **List with Duplicates (Match)** | **~1.29x** | Stable |

---

## Testing
In addition to the fix, I have added comprehensive unit tests covering
various scenarios to ensure correctness:

- **Mismatched Comparers (Ordinal vs. OrdinalIgnoreCase):** Verified
that `SetEquals` returns `true` when logically equal but with different
comparers, and `false` when logically different.
- **ICollection with Duplicates:** Verified the fallback path correctly
handles collections like `List<T>` with duplicate elements.
- **Count Optimizations:** 
- Verified that mismatched comparers correctly bypass the fast-path
count check.
- Verified that `SetEquals` still performs early-exit when `other.Count
< source.Count`.
- **Fast-Path Validation:** Ensured that when comparers match, the
optimized count-based comparison still works as expected.
- **Edge Cases:** Included tests for empty sets with different comparers
and content-specific mismatches.
Extending dotnet#126916 to iOS, tvOS,
and MacCatalyst.

---------

Co-authored-by: Copilot <[email protected]>
Implements the approved API from dotnet#97570, enabling O(1) transfer of a
`StringBuilder`'s chunk chain to a fresh instance so that callers (e.g.
Roslyn's `StringBuilderText`) can hold a no-copy, immutable view of the
contents while releasing the original.

```csharp
namespace System.Text;

public partial class StringBuilder
{
    public static StringBuilder MoveChunks(StringBuilder source);
}
```

## Description

- **`StringBuilder.MoveChunks`**
(`src/libraries/System.Private.CoreLib/.../StringBuilder.cs`)
- Constructs the returned `StringBuilder` via the existing private
`StringBuilder(StringBuilder from)` copy constructor, which transfers
`m_ChunkChars`, `m_ChunkPrevious`, `m_ChunkLength`, `m_ChunkOffset`, and
`m_MaxCapacity` from `source` and avoids the wasted 16-char default
buffer that `new StringBuilder()` would allocate.
- Drains `source` by zeroing `m_ChunkChars` (set to
`Array.Empty<char>()`), `m_ChunkPrevious`, `m_ChunkLength`, and
`m_ChunkOffset`, while **preserving `m_MaxCapacity`**. The drained
`source` is left in an empty but fully usable state — distinct from
`Clear()`, which retains the buffer. Subsequent append or insert
operations on `source` will succeed, allocating new buffers as needed.
  - Throws `ArgumentNullException` when `source` is `null`.
- **Ref assembly** updated (`System.Runtime.cs`).
- **Tests** in `StringBuilderTests` cover null arg, empty source, single
chunk, multi-chunk chain (using `MemoryMarshal.TryGetArray` to assert
backing-array identity by reference, not just content), calling
`MoveChunks` on an already-drained source, and that the drained source
remains usable with its original `MaxCapacity` preserved.

## Customer Impact

Unblocks the no-copy `SourceText` shape Roslyn has been waiting on
(dotnet/roslyn#61326) and provides a general primitive for transferring
ownership of a `StringBuilder`'s contents without materializing a
contiguous string or array of chunks.

## Regression?

- [ ] Yes
- [x] No

New API; no behavior change to existing members.

## Risk

- [x] Low
- [ ] Medium
- [ ] High

Pure addition; the implementation only manipulates internal fields
already reachable via existing code paths. After the call, `source`
retains its original `MaxCapacity` and is fully usable as an empty
`StringBuilder`.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: tannergooding <[email protected]>
Another experiment (for better
dotnet#127655)

Mark String.FastAllocateString with [Intrinsic] and teach RyuJIT to:
- Track the result as known non-null via VNF_StrFastAllocate
(knownNonNull=true)
- Fold ARR_LENGTH(VNF_StrFastAllocate(len)) -> len
- Emit a global assertion 'string.Length(result) == lenArg' in
optAssertionGen


Example:
```cs
int Foo()
{
    string a = "aaa";
    string b = "bbb";
    string c = a + b;
    return c[3]; // this PR removes this bound check
}
```

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ner (dotnet#127824)

## Summary

Generalizes the existing `.github/workflows/mobile-scan.md` (Apple
mobile + Android only, daily, sonnet-4.5, helix-centric) into
`.github/workflows/ci-failure-scan.md`. The new workflow scans every
public outer-loop pipeline on `dnceng-public/public`, classifies each
failure (build break vs test failure vs infra), and converges the
pipeline to green by either filing tracking issues, filing Known Build
Errors that Arcade Build Analysis can auto-match, opening companion PRs
that skip the failing test against an existing tracking issue, or
opening small product-fix PRs when a localized root cause is clear.

## What changed

| Aspect | Before | After |
|---|---|---|
| Pipelines scanned | runtime-extra-platforms (154) only | + JIT/GC/PGO
stress, libraries-jitstress, jit-experimental, ilasm, jit-cfg,
superpmi-replay, randomized stress (109–160, 230, 235) |
| Cadence | daily | every 12h (fuzzy schedule) |
| Model | claude-sonnet-4.5 | claude-sonnet-4.6 |
| Skill routing | mobile-platforms only | mobile-platforms
(Apple/Android/WASM), jit-regression-test + ci-pipeline-monitor
(JIT/GC/PGO), extensions-review / system-net-review where applicable |
| Failure classification | helix-workitem-only (silently no-op'd on
build breaks) | explicit walk: build break (Send-to-Helix skipped) vs
Phase-only failure vs Helix workitem vs infra |
| Outcomes | per-test PR or tracking issue | + Known Build Error issue
(Arcade Build Analysis JSON format, exact 3-backtick fences) + companion
skip-PR (csproj `<GCStressIncompatible>` for stress-incompatible JIT
tests; `[ActiveIssue(..., TestPlatforms.<plat>)]` for unit tests) +
small product-fix PR (≤20 lines, single file, non-API,
non-JIT/GC/threading/security, with the failing test as evidence) |
| Convergence | none — same failure re-issued each run | two-pass: run N
files tracking issue, run N+1 finds existing issue + still-failing test,
opens companion PR scoped to allowed paths |
| PR `allowed-files` | `src/libraries/**/tests/**` | `src/libraries/**`,
`src/coreclr/**`, `src/mono/**`, `src/tests/**`, `src/native/**`,
`eng/testing/**` |
| Title discipline | none | every issue/PR title starts with `[ci-scan]
`; titles use "Skip"/"Disable"/"Suppress", never "Mute" |
| Coverage discipline | none — picks failures opportunistically |
per-pipeline tally files; every signature is recorded as filed-issue /
filed-PR / reused-existing / skipped-with-reason |
| Caps | 5 PRs / 3 issues | 10 PRs / 5 issues |
| Filename | `mobile-scan.{md,lock.yml}` |
`ci-failure-scan.{md,lock.yml}` |

## Test runs

The test runs produced the following issues:
dotnet#127817
dotnet#127827
dotnet#127828
dotnet#127829
dotnet#127830
dotnet#127831

## Security

No new secrets and no new actions are introduced relative to the
workflow. The only changes are inside the `engine`, `tools`,
`safe-outputs`, `network`, and prompt sections of the markdown. The PR
`allowed-files` widening is the surface-area change: it lets the agent
edit any path under `src/libraries`, `src/coreclr`, `src/mono`,
`src/tests`, `src/native`, and `eng/testing/**` — including
product/runtime source — to enable small, well-localized product fixes.
The `protected-files: blocked` policy still prevents touching
`package.json`, lockfiles, `global.json`, `NuGet.Config`,
`Directory.Packages.props`, `CODEOWNERS`, and `.github/` / `.agents/`
paths. CODEOWNERS-mandated review remains the hard gate before any
merge.

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
…card support (dotnet#127878)

> [!NOTE]
> This PR was created with the assistance of GitHub Copilot
(AI-generated content).

## Problem

[dotnet/diagnostics PR
dotnet#5821](dotnet/diagnostics#5821) split the single
``SOS`` test class into 11 ``SOS``-prefixed classes
(``SOSStackTraceTests``, ``SOSExceptionTests``, ``SOSGCTests``,
``SOSDumpTests``, etc.) to enable parallelism. The existing
``classFilter: SOS`` in ``runtime-diagnostics.yml`` no longer matches
any class, so the cDAC, cDAC_no_fallback, and DAC test legs are now
silently running **zero** tests.

A naïve fix to ``classFilter: SOS*`` does not work either: xunit v2's
``-class`` filter is a ``HashSet<string>`` with exact-match
``Contains()`` only; it has no wildcard support. I verified this by
directly invoking ``XunitFilters.Filter()`` against
``xunit.runner.utility`` 2.9.2:

| Filter | Matches ``SOSStackTraceTests.TestMethod1`` |
|--------|--------------------------------------------|
| ``-class SOS*`` | ❌ No (literal HashSet contains) |
| **``-method SOS*``** | ✅ **Yes** |
| Multiple ``-class`` entries | ✅ Yes (would require enumerating all 11)
|

## Fix

xunit v2's ``-method`` filter is regex-based and operates on the fully
qualified ``ClassName.MethodName``, so ``SOS*`` matches every method on
any SOS-prefixed class.

This PR:

1. Adds a ``methodFilter`` parameter to
``eng/pipelines/diagnostics/runtime-diag-job.yml`` (parallel to the
existing ``classFilter``), wiring it through to the diagnostics
``build.ps1``'s already-supported ``-methodfilter`` argument.
2. Switches the three SOS test legs in
``eng/pipelines/runtime-diagnostics.yml`` (cDAC, cDAC_no_fallback, DAC)
to ``methodFilter: SOS*``.

The existing ``classFilter`` parameter is left in place for any other
consumer that needs exact-match class filtering.

Co-authored-by: Max Charlamb <[email protected]>
Co-authored-by: Copilot <[email protected]>
Fixes dotnet#124233
Fixes dotnet#127610

Tried to include feedback from
dotnet#124274 (comment).

Summary of changes:
- Change interface `IIndexOfOperator` to specialized
`IIndexOfMinMaxOperator`, where there are `Compare` methods that returns
masks of results/indices.
- `IndexOfMinMaxCore` delegates to ten different methods:
- `IndexOfMinMaxVectorized128/256/512Size4Plus` when `sizeof(T)` is 4 or
8. The result index fits in one vector.
- `IndexOfMinMaxVectorized128/256/512Size2` when `sizeof(T)` is 2. The
result index fits in two vectors.
- `IndexOfMinMaxVectorized128/256/512Size1` when `sizeof(T)` is 1. The
result index fits in four vectors.
    - `IndexOfMinMaxFallback` as fallback.
- For vector methods: the final aggregation is done by
horizontal-aggregation values in the lanes. Then the corresponding index
found by matching that value bitwise.
- The search is done left-to-right so there is no need for the
`IndexLessThan` methods
- Reintroduces some commented out TODO unit tests related to `IndexOf`
methods
…er API (dotnet#125895)

## Summary

Implements cDAC APIs for Objective-C interop diagnostics as a new
`ObjectiveCMarshal` contract, plus adds
`IsTrackedReferenceWithFinalizer` to the `RuntimeTypeSystem` contract.


> [!NOTE]
> This PR was generated with GitHub Copilot.

## Changes

### New `ObjectiveCMarshal` cDAC Contract

- **`IObjectiveCMarshal`**
(`Abstractions/Contracts/IObjectiveCMarshal.cs`): Interface with a
single API:
  ```csharp
TargetPointer GetTaggedMemory(TargetPointer address, out TargetNUInt
size);
  ```
Returns the tagged memory pointer for an Objective-C tracked reference
object (or `TargetPointer.Null` if none). Sets `size` to `2 *
pointerSize` bytes only on success.

- **`ObjectiveCMarshal_1`** (`Contracts/ObjectiveCMarshal_1.cs`):
Version 1 implementation — reads the sync block from the object header,
then extracts `InteropSyncBlockInfo.TaggedMemory`.

- **`ObjectiveCMarshalFactory`**
(`Contracts/ObjectiveCMarshalFactory.cs`): Contract factory.

- Registered in `ContractRegistry` and `CachingContractRegistry`.

- **`datadescriptor.inc`**: Added `TaggedMemory` field to
`InteropSyncBlockInfo` type (under `#ifdef FEATURE_OBJCMARSHAL`) and
`CDAC_GLOBAL_CONTRACT(ObjectiveCMarshal, 1)` (also guarded).

- **`syncblk.h`**: Added `TaggedMemory` offset to
`cdac_data<InteropSyncBlockInfo>` under `#ifdef FEATURE_OBJCMARSHAL`.

- **`InteropSyncBlockInfo.cs`** (Data class): Added `TaggedMemory`
property using `TryGetValue` to handle the optional
`FEATURE_OBJCMARSHAL` field.

### `IsTrackedReferenceWithFinalizer` on `RuntimeTypeSystem`

- Added `IsTrackedReferenceWithFinalizer = 0x04000000` to `WFLAGS_HIGH`
enum in `MethodTableFlags_1.cs`, plus a convenience property `bool
IsTrackedReferenceWithFinalizer`.

- Added `IsTrackedReferenceWithFinalizer(TypeHandle)` to
`IRuntimeTypeSystem.cs` and implemented it in `RuntimeTypeSystem_1.cs`.

### `SOSDacImpl.cs` — `ISOSDacInterface11`

Replaced the stub implementations of `IsTrackedType` and
`GetTaggedMemory` with full cDAC implementations:

- `IsTrackedType`: uses
`IRuntimeTypeSystem.IsTrackedReferenceWithFinalizer` and
`IObjectiveCMarshal.GetTaggedMemory`; returns `S_OK` if tracked,
`S_FALSE` if not, `E_INVALIDARG` for null inputs.
- `GetTaggedMemory`: uses `IObjectiveCMarshal.GetTaggedMemory`; returns
`S_OK` with address and size if tagged memory exists, `S_FALSE`
otherwise.

Both methods include `#if DEBUG` assertions against the legacy DAC
implementation for validation.

### Documentation

- **`docs/design/datacontracts/ObjectiveCMarshal.md`**: New contract
documentation.
- **`docs/design/datacontracts/RuntimeTypeSystem.md`**: Added
`IsTrackedReferenceWithFinalizer` to API listing and pseudocode.

## Testing

All 1322 existing cDAC unit tests pass. The new contract will be
exercised when running on an Apple platform with `FEATURE_OBJCMARSHAL`
enabled.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: rcj1 <[email protected]>
Co-authored-by: rcj1 <[email protected]>
…net#127842)

> [!NOTE]
> This PR description was AI/Copilot-generated.

Adds Azure Linux 4 to the libraries Helix extra-platforms queue set for
`linux_x64` (CoreCLR inner-loop) in
`eng/pipelines/libraries/helix-queues-setup.yml`.

Replaces dotnet#127613, which got tangled up in merge history. This is a
clean, single-commit version with the digest refreshed to the current
`azurelinux-4.0-helix-amd64` image (`sha256:d86d3499…`).

## Change

| File | Distro | Slot | Action |
|------|--------|------|--------|
| `eng/pipelines/libraries/helix-queues-setup.yml` | AzureLinux 4.0 |
extra-platforms `linux_x64` | Added |

Queue entry:

```
(AzureLinux.4.0.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:azurelinux-4.0-helix-amd64@sha256:d86d3499ccba1cc92ad045fbd3e055fdde21ed5c757f25d1245fea978711b3a6
```

Host queue is `AzureLinux.3.Amd64.Open`, matching the other
container-backed entries in the same section (Debian 13, Fedora 44,
openSUSE 16.0).

## Scope

`helix-platforms.yml` is intentionally **not** updated — those values
are reserved for GA releases, and Azure Linux 4 has not yet GA'd. This
change only adds opt-in coverage via the extra-platforms pipeline.

## CI

```
/azp run runtime-extra-platforms
```

## References

- dotnet#127613 (previous attempt)
- [OS onboarding
guide](https://github.com/dotnet/runtime/blob/main/docs/project/os-onboarding.md)
- [.NET OS Support Tracking](dotnet/core#9638)

Co-authored-by: Copilot <[email protected]>
`ThreadTasks` was a single-entry enum (`TT_CleanupSyncBlock`) backed by
a separate `m_ThreadTasks` field on `Thread`, even though `ThreadState`
had an unused bit (`0x00000020`) and already supported atomic set/reset
via `InterlockedOr`/`InterlockedAnd` on `m_State`. The old code even
contained a TODO noting the two should probably be merged.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jkotas <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
Removed newly implemented methods from the allowlist.
…tnet#127871)

> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.

## Problem

The cDAC x-plat dump tests (`CdacXPlatDumpTest` stages) hit two distinct
failure modes when running with `cdacDumpTestMode=xplat`:

1. **Helix SDK 2 GB `MemoryStream` cap.** `<PayloadDirectory>`
(`DirectoryPayload.UploadAsync`) zips the source directory into a
`MemoryStream` before uploading. `MemoryStream`'s backing array is
capped at `int.MaxValue` (~2 GiB), so per-platform dump payloads that
approach that size fail with `IOException: Stream was too long`.

2. **Helix host disk pressure on osx source dumps.** Even with the SDK
cap removed, x-plat tests download every source platform's dump
artifacts onto each host. The `osx_arm64` / `osx_x64` payloads are large
enough that the combined working set exceeds available disk and the
affected work items abort with exit code -3 (`Crash`).

Fixes dotnet#127859.

## Fix

**1. Pre-zip per-platform dumps with `ZipDirectory` +
`<PayloadArchive>`.** `ZipDirectory` calls
`ZipFile.CreateFromDirectory`, which writes the archive directly to a
`FileStream` -- no 2 GiB cap. The Helix SDK's `ArchivePayload` (selected
by `<PayloadArchive>`) uses `File.OpenRead` and streams the existing zip
to blob storage without any in-memory buffering.
`CompressionLevel="Fastest"` keeps the local zip step cheap; dump files
don't compress meaningfully anyway.

This is the same pattern already used in
`src/tests/Common/helixpublishwitharcade.proj`.

**2. Drop osx from the x-plat dump set (TODO).** Adds a separate
`cdacXPlatDumpPlatforms` parameter to
`eng/pipelines/runtime-diagnostics.yml` that excludes `osx_arm64` /
`osx_x64`, used by the three x-plat stages (`CdacXPlatDumpGen`,
`CdacXPlatDumpTests` host platforms + artifact downloads, and the
`SourcePlatforms` env var). Single-leg mode
(`cdacDumpTestMode=single-leg`) still uses the full `cdacDumpPlatforms`
list, so osx coverage there is preserved. Re-enable osx in the x-plat
flow once the dump set shrinks or the Helix queues provide more disk.

## Validation

- Verified locally that `ZipDirectory` + target-batching produces one
`.zip` per source platform with `Overwrite="true"`.
- Re-validating by re-running `runtime-diagnostics` with
`cdacDumpTestMode=xplat` against this PR.

---------

Co-authored-by: Max Charlamb <[email protected]>
Co-authored-by: Copilot <[email protected]>
vcsjones and others added 16 commits May 9, 2026 19:00
`EncodeUnsignedInteger` did not encode ASN.1 integers correctly when
there was a leading zero and the second octet had its high bit set,
requiring a leading zero to preserve positive sign. For example,
encoding the unsigned integer `[0x00, 0xFF]` would get encoded to the
ASN.1 `0201FF`, or -1. It should be encoded to `020200FF`. Conscrypt is
picky about the ASN.1 encoding.

This test had a ~0.46% failure chance (because it would fail if either r
or s were encoded incorrectly).

The first commit to this PR fixes `EncodeUnsignedInteger`.

However all of the hand-rolled ASN.1 encoding is unnecessary. We can

1. Use `AsnWriter` to do ASN.1 encoding. Let `BigInteger` and
`AsnWriter` do the correct encoding for us.
2. Use `DSASignatureFormat.Rfc3279DerSequence` so we don't have to
convert from IEEE.

Finally, this removed the ActiveIssue attribute.
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: EgorBo <[email protected]>
Co-authored-by: vcsjones <[email protected]>
…builds (dotnet#127997)

> [!NOTE]
> This PR description was generated with the assistance of GitHub
Copilot.

## Summary

Remove `buildConfig` (Debug/Release) from the sccache ADO Pipeline Cache
key so that PR builds can warm-start from rolling-build caches.

## Problem

The sccache cache key included `buildConfig`, which is `Debug` for PR
builds and `Release` for rolling builds. This created completely
separate cache namespaces, meaning:

- Rolling builds saved caches to `sccache|...|Release|...` keys in the
`refs/heads/main` scope
- PR builds looked for `sccache|...|Debug|...` keys, never finding
rolling build caches
- **Every first build of a new PR started with a cold sccache cache (0%
hit rate)**
- Cache hits only occurred on subsequent pushes to the *same* PR

## Why this is safe

The native compiler flags are determined by `-rc`
(RuntimeConfiguration), **not** `-c` (Configuration):

| Leg | `-rc` (native) | `-c` (managed) PR | `-c` (managed) Rolling |
|-----|----------------|-------------------|------------------------|
| CoreCLR_Libraries | **Release** | Debug | Release |
| Libraries_CheckedCoreCLR | **Checked** | Debug | Release |

Since `-rc` is hardcoded per leg, the CMake build type and native
compiler flags are identical between PR and rolling builds. The `-c`
flag only affects managed code, which sccache doesn't cache.

## Expected impact

PR builds will restore sccache caches from rolling builds (saved in the
main scope), giving ~99% hit rates on first push — a **33-46% reduction
in build time** for the linux-x64 native compilation legs based on
[prior
analysis](https://gist.github.com/steveisok/15758f11d9c5e8e2e29455cd768da955).

---------

Co-authored-by: Copilot <[email protected]>
)

> [!NOTE]
> This PR was filed by AI (GitHub Copilot CLI).

Inspired by a similar helper in Tensors. I guess we don't want to
consume Tensors in Linq due to IL size concerns. It also doesn't look
beneficial to share this function via source file due to different
generics being used. Maybe Vector128 will get this as public API at some
point.

## Benchmark

```cs
[Params(16, 64)]
public int Length;

private byte[]   _bytes;
private sbyte[]  _sbytes;
private short[]  _shorts;
private ushort[] _ushorts;
private int[]    _ints;
private uint[]   _uints;
private long[]   _longs;
private ulong[]  _ulongs;

[Benchmark] public byte   MaxByte()   => _bytes.Max();
[Benchmark] public sbyte  MaxSByte()  => _sbytes.Max();
[Benchmark] public short  MaxShort()  => _shorts.Max();
[Benchmark] public ushort MaxUShort() => _ushorts.Max();
[Benchmark] public int    MaxInt()    => _ints.Max();
[Benchmark] public uint   MaxUInt()   => _uints.Max();
[Benchmark] public long   MaxLong()   => _longs.Max();
[Benchmark] public ulong  MaxULong()  => _ulongs.Max();
```

Full benchmark request and raw output:
EgorBot/Benchmarks#198

## Results

Speed-up = `main` time / `PR` time (higher is better). Numbers below are
from EgorBot.

### ARM64 — Neoverse-N2 (`ubuntu24_azure_cobalt100`)

| Method    | Length | main         | PR           | Speed-up |
|-----------|-------:|-------------:|-------------:|---------:|
| MaxByte   |     16 |  51.54 ns    |   1.85 ns    | **27.85×** |
| MaxSByte  |     16 |  49.58 ns    |   1.90 ns    | **26.16×** |
| MaxShort  |     16 |  23.66 ns    |   0.98 ns    | **24.16×** |
| MaxUShort |     16 |  21.82 ns    |   1.22 ns    | **17.93×** |
| MaxInt    |     16 |   1.72 ns    |   1.84 ns    |    0.93× |
| MaxUInt   |     16 |   1.93 ns    |   1.74 ns    |    1.11× |
| MaxLong   |     16 |   3.77 ns    |   3.91 ns    |    0.96× |
| MaxULong  |     16 |   3.81 ns    |   3.93 ns    |    0.97× |
| MaxByte   |     64 |  49.64 ns    |   2.03 ns    | **24.51×** |
| MaxSByte  |     64 |  48.76 ns    |   2.04 ns    | **23.95×** |
| MaxShort  |     64 |  22.35 ns    |   3.53 ns    |  **6.33×** |
| MaxUShort |     64 |  22.33 ns    |   3.36 ns    |  **6.64×** |
| MaxInt    |     64 |   6.33 ns    |   6.21 ns    |    1.02× |
| MaxUInt   |     64 |   6.17 ns    |   6.51 ns    |    0.95× |
| MaxLong   |     64 |  23.55 ns    |  23.51 ns    |    1.00× |
| MaxULong  |     64 |  23.36 ns    |  23.44 ns    |    1.00× |

### Intel — Emerald Rapids / AVX-512 (`ubuntu24_azure_emeraldrapids`)

| Method    | Length | main         | PR           | Speed-up |
|-----------|-------:|-------------:|-------------:|---------:|
| MaxByte   |     16 |   8.88 ns    |   0.93 ns    |  **9.54×** |
| MaxSByte  |     16 |   9.86 ns    |   0.89 ns    | **11.10×** |
| MaxShort  |     16 |   4.42 ns    |   1.55 ns    |  **2.87×** |
| MaxUShort |     16 |   4.45 ns    |   1.02 ns    |  **4.38×** |
| MaxInt    |     16 |   1.66 ns    |   0.88 ns    |  **1.89×** |
| MaxUInt   |     16 |   1.81 ns    |   1.50 ns    |    1.20× |
| MaxLong   |     16 |   0.96 ns    |   0.89 ns    |    1.08× |
| MaxULong  |     16 |   1.00 ns    |   0.94 ns    |    1.06× |
| MaxByte   |     64 |  16.31 ns    |   1.44 ns    | **11.39×** |
| MaxSByte  |     64 |  10.03 ns    |   1.59 ns    |  **6.33×** |
| MaxShort  |     64 |   6.52 ns    |   1.37 ns    |  **4.77×** |
| MaxUShort |     64 |   6.54 ns    |   1.54 ns    |  **4.26×** |
| MaxInt    |     64 |   2.44 ns    |   1.68 ns    |  **1.47×** |
| MaxUInt   |     64 |   2.84 ns    |   1.94 ns    |  **1.47×** |
| MaxLong   |     64 |   2.72 ns    |   3.17 ns    |    0.86× |
| MaxULong  |     64 |   3.17 ns    |   2.97 ns    |    1.07× |

### AMD — EPYC 9V45 (Turin) / AVX-512 (`ubuntu24_azure_turin`)

| Method    | Length | main         | PR           | Speed-up |
|-----------|-------:|-------------:|-------------:|---------:|
| MaxByte   |     16 |   4.41 ns    |   0.70 ns    |  **6.27×** |
| MaxSByte  |     16 |   4.96 ns    |   0.83 ns    |  **5.96×** |
| MaxShort  |     16 |   3.01 ns    |   0.87 ns    |  **3.45×** |
| MaxUShort |     16 |   2.09 ns    |   0.89 ns    |  **2.35×** |
| MaxInt    |     16 |   1.48 ns    |   0.98 ns    |  **1.52×** |
| MaxUInt   |     16 |   1.64 ns    |   0.98 ns    |  **1.68×** |
| MaxLong   |     16 |   0.94 ns    |   0.91 ns    |    1.03× |
| MaxULong  |     16 |   1.05 ns    |   0.91 ns    |    1.16× |
| MaxByte   |     64 |   5.86 ns    |   1.27 ns    |  **4.61×** |
| MaxSByte  |     64 |   7.57 ns    |   1.28 ns    |  **5.93×** |
| MaxShort  |     64 |   2.78 ns    |   1.39 ns    |  **2.01×** |
| MaxUShort |     64 |   2.96 ns    |   1.13 ns    |  **2.61×** |
| MaxInt    |     64 |   2.27 ns    |   1.61 ns    |  **1.41×** |
| MaxUInt   |     64 |   1.97 ns    |   1.62 ns    |  **1.22×** |
| MaxLong   |     64 |   3.02 ns    |   3.00 ns    |    1.01× |
| MaxULong  |     64 |   2.87 ns    |   2.10 ns    |    1.37× |

---------

Co-authored-by: Copilot <[email protected]>
`IsIntegralConstUnsignedPow2` was passing in sign extended value to
`isPow2`. So it wasn't actually unsigned. For example: 1 << 31 would not
be recognized as pow2.

Add a `UnsignedIntegralValue` that gives the zero-extended literal. Use
it in `IsIntegralConstUnsignedPow2` to fix it's impl.
Also use it in `fgMorphUModToAndSub` and a place in lower.
….Yield (dotnet#128004)

> [!NOTE]
> This pull request was prepared with assistance from GitHub Copilot.

## Problem

`AsyncContinuationDumpTests.ThreadLocalContinuation_IsContinuation`
fails intermittently on **osx-arm64 R2R** with:

> Could not find AsyncDispatcherInfo type in CoreLib

Failure tracked in dotnet#127774. Recently observed in builds
[1413917](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1413917)
and
[1411121](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1411121).

Fixes dotnet#127774

## Root cause

The test relies on the runtime having executed
`AsyncHelpers+RuntimeAsyncTask<T>.DispatchContinuations()`, which writes
`AsyncDispatcherInfo.t_current` and forces the JIT to load the
`AsyncDispatcherInfo` MethodTable.

The current debuggee uses `await Task.Delay(1)` to force a suspension.
On fast machines (in particular Apple Silicon CI machines) the 1ms timer
can fire before the runtime-async `Await` helper checks `IsCompleted`,
so the awaiter is observed as already-completed and the await runs
straight through synchronously. With no suspension there is no dispatch,
no `t_current` write, and the `AsyncDispatcherInfo` MT is never loaded.

I downloaded the failing osx-arm64 dump and walked the crashed thread:

```
[2-4] FailFast
[5]   InnerAsync
[6]   OuterAsync   (async2 body)
[7]   OuterAsync   (thunk)
[8]   Main
[9]   CallEntryPoint
```

There is no `DispatchContinuations` frame on the stack. `OuterAsync`
calls `InnerAsync` directly, confirming the await did not suspend.

I also walked all 3 modules' `TypeDefToMethodTable` maps and confirmed
`AsyncDispatcherInfo` MT is genuinely null everywhere (i.e. cDAC is
reporting reality - the type never got loaded). `Object`, `Task`, and
`Continuation` MTs are all loaded as expected.

## Fix

Replace `await Task.Delay(1)` with `await Task.Yield()` in `InnerAsync`.

`Task.Yield()` returns a `YieldAwaitable` whose awaiter's `IsCompleted`
always returns `false`, so the continuation is unconditionally posted
back via `DispatchContinuations`. This guarantees
`AsyncDispatcherInfo.t_current` is written before `InnerAsync` resumes
and calls `FailFast`, regardless of machine timing.

## Validation

Posting as a draft to run CI across all platforms; the osx-arm64 R2R leg
is the one to watch.

Co-authored-by: Max Charlamb <[email protected]>
Co-authored-by: Copilot <[email protected]>
The suite was disabled due to suspected test failures, but investigation
shows all 5,670 tests pass on Release CoreCLR. The only 3 failures are
already covered by [ActiveIssue] attributes. Previous 0-tests-run
results were caused by a Debug-only SkipOnCoreClr trait filter.

Co-authored-by: Copilot <[email protected]>
…5) (dotnet#127636)

## Summary

Part 2 of 5 stacked PRs splitting
[dotnet#126408](dotnet#126408). Builds on
[dotnet#127395](dotnet#127395) (merged).

This PR adds a cDAC ECMA-335 signature decoder that closely mirrors
`System.Reflection.Metadata.SignatureDecoder` and supports the two
runtime-only extensions used in CoreCLR-internal signatures:
`ELEMENT_TYPE_INTERNAL` (`0x21`) and `ELEMENT_TYPE_CMOD_INTERNAL`
(`0x22`). The decoder is then used by both the Signature contract (for
field signatures) and the StackWalk contract (for signature-based GC
reference scanning of transition frames).

### What this PR contains

**`RuntimeSignatureDecoder` (SRM-aligned polyfill):**
- `RuntimeSignatureDecoder<TType, TGenericContext>` -- readonly struct
mirroring SRM's `SignatureDecoder<TType, TGenericContext>`
(`DecodeType`, `DecodeFieldSignature`, `DecodeMethodSignature`,
`DecodeLocalSignature`, all taking `ref BlobReader`).
- `IRuntimeSignatureTypeProvider<TType, TGenericContext>` -- superset of
SRM's `ISignatureTypeProvider` adding `GetInternalType(TargetPointer)`
and `GetInternalModifiedType(TargetPointer, TType, bool)` for the two
runtime-only encodings.
- `SignatureTypeProvider` (the existing field-signature provider)
implements `IRuntimeSignatureTypeProvider` so internal types in field
signatures resolve via `RuntimeTypeSystem.GetTypeHandle`.

**Signature-based GC reference scanning in StackWalk:**
- `GcSignatureTypeProvider` (internal, in `StackWalkHelpers`) classifies
each method-signature parameter as `Ref`, `Interior`, `Other` (value
type or larger-than-slot), or `None`.
- A new `GcSignatureContext(TypeHandle classContext, MethodDescHandle
methodContext)` record struct is plumbed through
`RuntimeSignatureDecoder<GcTypeKind, GcSignatureContext>` so
`ELEMENT_TYPE_VAR` / `ELEMENT_TYPE_MVAR` placeholders resolve to the
method's actual class / method instantiation -- matching native
`SigTypeContext`-driven `PeekElemTypeNormalized` behavior.
- `GcScanner.PromoteCallerStack` constructs the provider per call and
walks the `TransitionBlock` using a reserved-slot count derived from
`IsInstance` / return-buffer / `RequiresInstArg` / `IsAsyncMethod` /
ARM64 `x8`, reporting each parameter slot as a GC reference, interior
pointer, or skip.
- Signature acquisition mirrors native `MethodDesc::GetSig`: prefers
`IsStoredSigMethodDesc` (dynamic, EEImpl, array methods) before falling
back to the metadata token, so caller-stack roots of dynamic and
array-method transition frames are handled. Stored sigs are pinned with
an inline `fixed` block and read via a `BlobReader`, matching the
existing `SigFormat.cs` pattern.
- This is the cDAC equivalent of native
`TransitionFrame::PromoteCallerStack` and is used for
`PrestubMethodFrame`, `CallCountingHelperFrame`, and the
`StubDispatchFrame` / `ExternalMethodFrame` fallback when no GCRefMap is
available.

**Signature contract surface stays minimal:**
- `ISignatureDecoder` continues to expose only
`DecodeFieldSignature(BlobHandle, ModuleHandle, TypeHandle)`.
- GC-specific decoding lives entirely inside the StackWalk contract; the
Signature contract has no GC dependencies.

**cDAC documentation:**
- `docs/design/datacontracts/SignatureDecoder.md` -- describes
`RuntimeSignatureDecoder`, `IRuntimeSignatureTypeProvider`, and the
`ELEMENT_TYPE_INTERNAL` / `CMOD_INTERNAL` extensions; refreshed
`DecodeFieldSignature` code sample.
- `docs/design/datacontracts/StackWalk.md` -- new "Signature-Based
Scanning" section under GC stack reference scanning, covering
`GcSignatureTypeProvider` (with module scoping, `GcSignatureContext`,
and enum normalization), the `PromoteCallerStack` algorithm, the
reserved-slot table, and limitations vs. native.

### Testing
- Build: clean, 0 warnings / 0 errors.
- 1921 / 1921 cDAC unit tests pass.
- Behavioral verification against the legacy DAC happens via the
GC-stress verification harness introduced later in the PR series.

> [!NOTE]
> This PR description was created with AI assistance from Copilot.

---------

Co-authored-by: Max Charlamb <[email protected]>
Co-authored-by: Copilot <[email protected]>
Found that SList was taking up two pointer sizes because MSVC does not
do empty base class optimization by default. We already have
`EMPTY_BASES_DECL`, but it is not defined in NativeAOT. Given that SList
is used in both CoreCLR and NativeAOT I also refactored
`EMPTY_BASES_DECL` to be defined in minipal so it can be accessed by
both builds.

## Changes

- **`src/coreclr/pal/inc/pal.h`** — removed the unconditional `#define
EMPTY_BASES_DECL` (always empty, wrong on MSVC). `pal.h` already
`#include`s `<minipal/utils.h>` above that line, so the minipal
definition takes effect automatically.
- **`src/coreclr/inc/slist.h`** — switched to `#include
<minipal/utils.h>` and `EMPTY_BASES_DECL` directly; moved
`SListLayoutValidationElem` and related `static_assert`s under `#ifdef
_DEBUG` so they don't affect release builds.

`src/native/minipal/utils.h` is now the single source of truth for
`EMPTY_BASES_DECL`.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: max-charlamb <[email protected]>
Co-authored-by: Max Charlamb <[email protected]>
…net#127787)

## Description

The Mono SIMD intrinsic dispatch in `simd-intrinsics.c` did not match
`MONO_TYPE_I/U`, so the new `nint`/`nuint` overloads added by dotnet#127327
(`Crc32.ComputeCrc32(uint, nuint)`, `Crc32.ComputeCrc32C(uint, nuint)`,
`ArmBase.ReverseElementBits(nint/nuint)`) tripped
`g_assert_not_reached()` at line 4981 during AOT of
`System.Private.CoreLib.dll` on tvos-arm64 (build
[1406826](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1406826)).

This unblocks AOT precompilation of `System.Private.CoreLib.dll` on
64-bit ARM Mono targets and recovers four tvos appletv work items
(`System.Configuration.ConfigurationManager.Tests`,
`System.Reflection.MetadataLoadContext.Tests`,
`System.Security.Cryptography.Xml.Tests`, `System.Text.Json.Tests`) that
previously exited 21 before any test ran.

Fixes dotnet#127792

Co-authored-by: Copilot <[email protected]>
dotnet#127773 adds length prefixes directly to emitted Wasm code in the JIT.
This change is a follow up which adds length prefixes directly to
generated wasm import thunks and stubs in crossgen. It also removes the
logic in the Object Writer around handling length prefixes, since these
will now be encoded in the `ObjectData` itself.
When generating an async call, in EmitSuspend, we obtain the set of vars
that are alive at this point in time and we store this information
inside the suspenData. If they async call needs to suspend it will store
these vars into the ContinuationObject, with their values being restored
when we resume the continuation.

Previous code would store the result value as well into the
ContinuationObject. The problem is that this would lead to storing
uninitialized data into the object, which can result in random GC
crashes. This commit removes the result var from the set of live vars,
stores associated information specifically for the return var inside the
suspend data and we make use of this information to write the result
only on the suspend resume path.

Fixes dotnet#127855
Minimal example:
```cs
if (x > 10 && x < 100)
{
    if (y > x) // means y > 11
    {
        return y > 0; // always true 
```

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@mdh1418 mdh1418 force-pushed the inproc_crashreport_logging branch from d3151a1 to 95634bc Compare May 12, 2026 05:24
mdh1418 and others added 5 commits May 12, 2026 01:53
… namespace


Moves the async-signal-safe integer formatting helpers and buffer-size constants out of SignalSafeJsonWriter into a shared SignalSafeFormat namespace. The helpers are JSON-agnostic and are needed by both the JSON writer and later compact console output without introducing a sibling dependency.

This is intended as a behavior-preserving refactor: JSON writer call sites continue to use the same bounded fixed-buffer formatting logic, just through the shared helper namespace.

Co-authored-by: Copilot <[email protected]>
Adds SignalSafeConsoleWriter, a bounded line-oriented sink that writes DOTNET_CRASH entries through __android_log_write on Android and newline-terminated stderr lines elsewhere. CreateReport now emits a compact tombstone-style header/footer alongside the existing JSON report path.

The JSON header/footer emission is split into helpers, and DbgMiniDumpName becomes optional: when no JSON path is configured, the JSON writer uses a no-op sink while the compact log still runs. PROCGetSignalNameAscii exposes the existing signal-name table in the narrow form used by the compact log.

Co-authored-by: Copilot <[email protected]>
Adds shared frame-sink plumbing so each walked frame can feed both the JSON writer and the compact console writer. The compact log now emits per-thread headers, managed exception info, managed frame lines with IL offset/token, native frame lines with module offsets, and a marker when no managed frames were reported.

Both normal thread enumeration and the synthesized crash-thread fallback use the same console block helpers, keeping per-thread compact-log structure in one place.

Co-authored-by: Copilot <[email protected]>
…dule-index references


Adds ModuleTable, a 64-entry fixed-capacity table keyed by MVID for one crash report. Compact-log frames can refer to modules by short [N] indices, and the footer emits a modules block that maps each index back to the module filename and MVID.

If a managed frame's module cannot be stored because the table is full or the GUID is missing, the frame renders the module name inline as (in <name>) instead of using a lossy placeholder. JSON output is unchanged; module indices are only a compact-log representation detail.

Co-authored-by: Copilot <[email protected]>
Adds DOTNET_CrashReportFrameLimitPerThread, parsed as base 10 with default 32, to cap the number of frames written per thread to the compact log. Setting the value to 0 disables the limit.

Frames past the cap are still emitted to the JSON report. The compact log skips only the console frame line, tracks how many frames were omitted for the current thread, and emits an "... +N more frames" summary in the thread footer.

Co-authored-by: Copilot <[email protected]>
@mdh1418 mdh1418 force-pushed the inproc_crashreport_logging branch from 95634bc to 86f4659 Compare May 12, 2026 18:48
mdh1418 and others added 7 commits May 13, 2026 20:50
Preserve the fatal stack-overflow reason across the PAL abort path so the in-proc crash reporter does not try to run the generic managed thread walk on the constrained stack-overflow handler path.

Reuse the runtime stack-overflow helper thread's compressed managed stack trace and render it directly in the in-proc crash report JSON and compact log output.

Co-authored-by: Copilot <[email protected]>
Move reporter-owned temporary buffers and VM callback scratch out of crash-time stack locals so fatal signal paths do not depend on large stack allocations for report paths, method names, module IDs, and thread enumeration state.

Keep the existing one-report-at-a-time guard as the synchronization boundary for the reusable scratch storage.

Co-authored-by: Copilot <[email protected]>
Ensure full and truncated compact crash log lines end with a newline on non-Android sinks instead of relying on later writes for line framing.

Co-authored-by: Copilot <[email protected]>
Keep signal-name formatting in the crash reporter instead of exposing a PAL helper only used by this path.

Co-authored-by: Copilot <[email protected]>
Separate report-level begin/end flow from per-thread formatting helpers so JSON and compact console lifecycles are easier to review independently.
Keep behavior unchanged while centralizing JSON finalization in EndJsonReport.

Co-authored-by: Copilot <[email protected]>
Store only Module handles in the compact module table and resolve name/GUID when formatting the modules footer.
Preserve the existing per-frame JSON module metadata while making the compact console table follow the review feedback.

Co-authored-by: Copilot <[email protected]>
Remove the dead JSON-only frame callback and route walked frames through one JSON-plus-console emission path.
Also preserve token/IL identity when method names are unavailable and drop unused siginfo plumbing.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.